Unified, centralized and simplified code; added CPU option
Here are some things I added/ changed:
- dedicated
filtervisualizer.pyfile - dedicated
plot_reconstructions.pyfile - easier accessible due to streamlined functions. Easier to use other neural nets, without changing too much code.
- added CPU option
- removed unused imports, codes, parameters
- don't overwrite built in
filterfunction - pep8 guidelines
- f strings where applicable
- removed imgur code (I am not sure if it is really necessary for the task)
Things I have not changed yet, but will do in the future:
- vgg16 and resnet34 part 2 notebooks
Thus, it should be much easier to change things in the future/ migrate to new fastai version.
Check out this pull request on ![]()
You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.
@fg91 sorry for the mess. I know it is hard to review, because it combines quite a lot of changes in one PR. Should I make several pull requests out of it?
Hey, sorry it took me so long to react. First of all, thank you for taking the time to improve this tutorial!
Would you be willing to change the following?
- The
experimentsfolder contains additional notebooks provided by a reader of the blog post, so I would like to keep theFilterVisualizerseparated from it. Could you please move thefiltervisualizer.pyout of theexperimentsfolder? Theplot_reconstructions.pycan stay in the experiments folder as it is only used for the additional experiments... - Would you be willing to simplify the
Calculate_mean_activation_per_filter_in_specific_layer_given_an_image.ipynbusing themost_activatedmethod fromFiterVisualizer?
Thanks!
Fabio
I finally addressed your proposed changes :tada: :
filtervisualizer.pyis now in root. See 12ebf75Calculate_mean_activation_per_filter_in_specific_layer_given_an_image.ipynbnow usesfiltervisualizer.py. See 9b4b794train_tfmsandval_tfmsare now instance attributes. See 84ea7cbFilterVisualizer.most_activated()method does not print anymean_actat all (I do not think it is necessary?). Especially noactivations.features[0, 5]:grin: . See 9b4b794
@fg91 If there is anything else you want me to change, just let me know.