aqibsaeed / genetic-cnn Goto Github PK
View Code? Open in Web Editor NEWCNN architecture exploration using Genetic Algorithm
License: Apache License 2.0
CNN architecture exploration using Genetic Algorithm
License: Apache License 2.0
How much time does it take to execute? Cause it is taking too much time on my NVIDIA MX130 GPU.
what can i do to solve this?
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
gen nevals
0 20
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
1 6
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
2 8
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
('Accuracy: ', 0.101)
3 10
Getting .101 accuracy, can you help me with this?
link to notebook - https://colab.research.google.com/drive/1Tb-UStNEAfbG4IZyfQM3BrnXX0nn7nok?usp=sharing
Hello,
thank you for your work and for the publication of the code.
I tried your genetic algorithm but I ran into one problem.
I uncommented the line to get accuracy values.
#print('Accuracy: ',score)
While running the process with the states and num_nodes you set:
STAGES = np.array(["s1","s2","s3"]) # S
NUM_NODES = np.array([3,4,5]) # K
I get always an accuracy value of 0.101 without any improvements after generations.
When I do changes to this and set:
STAGES = np.array(["s1"]) # S
NUM_NODES = np.array([3]) # K
it seems to work sometimes more as expected because of different accuracies but still with very bad ones
(e.g. 0.1946, 0.1018 etc. but again also some 0.101 values)
Furthermore one stage seems a little bit small. I also played with the TRAINING_EPOCHS and BATCH_SIZE, but nothing really changed.
I tried it with the latest versions of the libraries, and also with the older versions of the libraries released before the 12th of March 2017 (your last commit), but there are no differences with the accuracy.
pip freeze
for the version with old libraries gives:
deap==1.0.1
numpy==1.16.4
protobuf==3.8.0
py-dag==2.5.0
scipy==0.19.0
six==1.12.0
tensorflow==1.0.1
Is this intended to work like this?
Assuming yes, there would be a bunch of different individuals with same accuracy, so the ranking may not be that meaningful.
Or am I doing something wrong or misunderstood this or are there other configurations I should consider?
Could the size of the filter(kernel) be larger than the size of the feature map?
In case of continue to add layers, it may end up with a larger filter than the size of the feature map.
I can't see the print results at last !
best_individuals = tools.selBest(popl, k = 3)
for bi in best_individuals:
print(bi)
when I run it ,the result is nothing.
I need your help.Thanks.
Hi, aqibsaeed,
I'm doing some research about NAS recently.
I noticed your implementation for GeneticCNN, which is awesome.
But I notice that the parameter setting in your Code is not suitable for MNIST(chanel is too small, and kernel size for pooling is very large), which leads to the result that the performance of it is not ineffective(accuracy stays in a low range).
So I forked your repo, and made some change for MNSIT.
Thank for your contribution.
Best,
ShipXu
def ind_nodes(self, graph=None):
""" Returns a list of all nodes in the graph with no dependencies. """
if graph is None:
graph = self.graph
dependent_nodes = set(tuple(node) for dependents in graph.items() for node in dependents)
return [node for node in graph.keys() if node not in dependent_nodes]
set(tuple(node) for dependents in graph.items() for node in dependents) : wrong code!!
corrected code (python 3 base):
dependent_nodes = set(node for dependents in iter(graph.values() )for node in dependents)
compare : py-dag:ind_nodes method
Hello! I read the paper, you said 'It would be very interesting to incorporate the genetic algorithm to training the network structure and weights simultaneously.' Considering the genetic algorithm is computationally expensive, is it the good method to training with GA compares with BP.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.