Skip to content
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

Adding float mnist_simple example #215

Merged
merged 7 commits into from
Nov 13, 2023
Merged

Adding float mnist_simple example #215

merged 7 commits into from
Nov 13, 2023

Conversation

shrit
Copy link
Member

@shrit shrit commented Sep 20, 2023

No description provided.

Signed-off-by: Omar Shrit <omar@avontech.fr>
@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch shrit/examples/mnist_float

@shrit shrit marked this pull request as draft September 20, 2023 15:20
Signed-off-by: Omar Shrit <omar@avontech.fr>
Signed-off-by: Omar Shrit <omar@avontech.fr>
@shrit shrit marked this pull request as ready for review September 21, 2023 10:44
@conradsnicta
Copy link

@shrit Apologies - I don't have the bandwidth for this at the moment. Suggest you try @zoq in addition to @rcurtin for the review.

Copy link
Member

@rcurtin rcurtin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I never saw this because I still did not have mailman3 working right for the mlpack-git list. Sorry about that... I would have reviewed this earlier otherwise. This is definitely a nice thing to include, but I wonder if calling the example mnist_cnn_fp32 might be more clear for people scrolling through. Alternately, I wonder if just making another file mnist_cnn_fp32.cpp in the mnist_cnn directory would suffice. I don't think I have an opinion either way.

Fingers crossed that mailman3 successfully delivers this message to the mlpack-git list... 😄

mnist_cnn_float/mnist_cnn.cpp Outdated Show resolved Hide resolved
mnist_cnn_float/mnist_cnn.cpp Outdated Show resolved Hide resolved

data::Save("model.bin", "model", model, false);

cout << "Predicting on test set..." << endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through the test output and it seems like something fails here after this output:
https://dev.azure.com/mlpack/84320e87-76e3-4b6e-8b6e-3adaf6b36eed/_apis/build/builds/9352/logs/15

2023-09-21T12:51:20.9728229Z Predicting on test set...
2023-09-21T12:51:20.9728383Z Example failed: mnist_cnn_float

But, unfortunately, the CI output isn't more than that. Does the whole example run for you successfully locally?

@@ -0,0 +1,229 @@
/**
* An example of using Convolutional Neural Network (CNN) for
* solving Digit Recognizer problem from Kaggle website.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth adding a comment pointing out that this is similar to the other example, but in this one we use fp32 precision. (Same for the mnist_simple example.)

mnist_cnn_float/Makefile Outdated Show resolved Hide resolved
shrit and others added 3 commits November 5, 2023 17:33
Co-authored-by: Ryan Curtin <ryan@ratml.org>
Co-authored-by: Ryan Curtin <ryan@ratml.org>
Signed-off-by: Omar Shrit <omar@avontech.fr>
@shrit
Copy link
Member Author

shrit commented Nov 5, 2023

@rcurtin both of the examples has start training as usual, no problem while loading and training the data.
I will post more more if there is any issue related to prediction, but for me it seems that everything is running alright

Signed-off-by: Omar Shrit <omar@avontech.fr>
@shrit
Copy link
Member Author

shrit commented Nov 5, 2023

okay I am getting a segmentation fault during the prediction of the mnist_simple, the reason for this is that I forgot to register the layers for float so the model matrix was empty and therefore armadillo throw the error.
I fixed this it should be fine now

@shrit shrit requested a review from rcurtin November 6, 2023 17:20
Copy link
Member

@rcurtin rcurtin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, nice to add this. I think we should probably reorganize all the examples at some point (like #191 or similar), but that doesn't change that we definitely should merge this. Thanks for working out all the issues 👍

Copy link

@mlpack-bot mlpack-bot bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second approval provided automatically after 24 hours. 👍

@shrit shrit merged commit 08cf9b9 into mlpack:master Nov 13, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants