-
-
Notifications
You must be signed in to change notification settings - Fork 333
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
Simpler MLP #397
Simpler MLP #397
Conversation
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.
One benefit of all the extra comments in the original was that it could be rendered as a Literate notebook. I wonder if we should make that official with either a README note or top-level comment with brief instructions.
|
||
## Training | ||
|
||
You can copy and paste the example into the Julia REPL to see what each part does. | ||
Or you can run it all at once from the terminal, like this: |
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.
Running all at once from the terminal won't show any output. Could we use print
on the predictions and display the image even if users aren't running from the REPL?
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 me it does print:
mlp_mnist % /Applications/Julia-1.9.app/Contents/Resources/julia/bin/julia --project mlp_mnist.jl
┌ Info: After epoch = 1
│ loss = 1.8101638024672866
│ train_acc = 75.81
└ test_acc = 76.75
┌ Info: After epoch = 3
│ loss = 0.8674804433248937
│ train_acc = 85.65
└ test_acc = 86.22
It does not show the images, but perhaps that's more intended as a start towards interactive exploration.
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.
If not the images, perhaps we could print out the predictions/ground truth labels in lines 110+115 for comparison.
Co-authored-by: Brian Chen <[email protected]>
I think quite a few of these files were rendered this way for the old website. But they got stale... and IDK how valuable rendering & commentary is anyway. This PR and its friend want to go the other direction. Having relatively few, concise, clear examples means you're more likely to find the right one, and it's more likely to be up to date. A separate README for links & more text seems OK, and easier to maintain, less tightly coupled. |
Co-authored-by: Kyle Daruwalla <[email protected]>
Same idea as #394, to remove all this baroque junk of making structs you use once, and functions you call once, to just focus on the essentials. But even simpler than #394, no GPU, no NamedTuples, no saving.
Before: https://github.com/FluxML/model-zoo/blob/8cdc06752598e88c9e4c94e4a594a9bc58a3c128/vision/mlp_mnist/mlp_mnist.jl
After: https://github.com/FluxML/model-zoo/blob/31e147faef61e7f26dc2d6124afbac0cfe518b6a/vision/mlp_mnist/mlp_mnist.jl
Maybe some of the text in the old one should move to the readme.[Edit: fixed links to work after merge.]