-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GANs mnist #172
base: master
Are you sure you want to change the base?
GANs mnist #172
Conversation
mnist_gan/mnist_gan.cpp
Outdated
for( int i = 0; i < cycles; i++) | ||
{ | ||
// Training the neural network. For first iteration, weights are random, | ||
// thus using current values as starting point. | ||
gan.Train(trainDataset, | ||
optimizer, | ||
ens::PrintLoss(), | ||
ens::ProgressBar(), | ||
ens::Report()); | ||
|
||
optimizer.ResetPolicy() = false; | ||
std::cout << " Model Performance " << | ||
gan.Evaluate(gan.Parameters(), // Parameters of the network. | ||
i, // Index of current input. | ||
batchSize); // Batch size. | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to use loops anymore, You can refer to mnist_cnn.
@zoq @kartikdutt18 I forgot to mention that the split function is not working for me. Like it doesn't do anything, and the entire dataset is loaded. Can you check if it is the same for you? |
mnist_gan/mnist_gan.cpp
Outdated
optimizer.ResetPolicy() = false; | ||
std::cout << " Model Performance " << | ||
gan.Evaluate(gan.Parameters(), // Parameters of the network. | ||
i, // Index of current input. | ||
batchSize); // Batch size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For saving periodically, you can use https://github.com/mlpack/models/blob/master/ensmallen_utils/periodic_save.hpp
You can download the file and use it temporarily for testing / forming the notebook.
@swaingotnochill @Davidportlouis I just realized that we have a notebook that shows how you can load images into an armadillo matrix with the format mlpack expects - https://github.com/mlpack/examples/blob/master/cifar10_transformation_with_pca/cifar-10-pca-cpp.ipynb. Let me know if you have any questions about the notebook. |
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
The generate_image.py file is incomplete[I have yet to implement what kartik proposed]. Also the code needs a bit of cleaning. Please let me know if there is any logic error. |
@zoq @kartikdutt18 I am preparing the final notebook, but it seems that it crashes very often. Will it be alright if we can have the model definition, and the explanation part on the notebook. |
@zoq @kartikdutt18 Can you review the code? See if this can merge. Later, after the model is trained, we can just push the updated output. As for the notebook, I have just added the output code. The model architecture is written in comments in the mnist_gan.cpp file. Just let me know if we want to write the same model architecture in notebook too. Also, if there is anything to add, feel free to tell. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍 |
@swaingotnochill Is there anything else required for this PR? This addition is very nice. |
The saved model is only trained for 2 epochs...We can merge this, just that we have to train the model for this which might take some days. But, the architecture seems fine for now, so shouldn't be an issue if we add this.. |
@zoq do we merge this? |
I will try to port the C++ example manually to the examples repo. |
@geekypathak21 feel free when you have the time to port this one as well, many thanks |
@shrit Sure will do 👍 |
@kartikdutt18 @zoq I have created this new pull request coz in the earlier branch a lot of stuff has been messed up.
To do:
Please check the correctness of script, especially the Evaluate Function and model save method.
@zoq If this training file is correct, can you please train the model?
Right now, the model will on 657 cycles with 1 epoch per cycle. May be we can improve on this? Your thoughts.
P.S: Ignore the file path, and make file configurations, I will fix them later on.