pluskid / Mocha.jl

Deep Learning framework for Julia
Other
1.29k stars 254 forks source link

Example for plotting learning curves #214

Closed zacsketches closed 7 years ago

zacsketches commented 7 years ago

I'm new to Mocha and want to eventually contribute to its development, but as I'm coming up to speed I need to be able to plot learning curves for training sessions. The MNIST tutorial is outstanding for explaining how to build and train a network, but the snapshots saved in the HDF5 data format lack documentation on how to extract data to plot learning curves.

Can someone recommend a resource for how to interact with the HDF5 snapshots?

Once I get pointed in the right direction I'm happy to write the example and submit a pull request.

greenflash1357 commented 7 years ago

From the documentation:

The logs are stored as simple Julia dictionaries. See plot_statistics.jl in the tools directory for an example of how to retrieve and visualize the saved information.

For details on how HDF5 is structured, see HDF5.jl or HDF5.

I think, the statistics.hdf5 or statistics.jld file contains a statistics dataset in which the the validation accuracy for example is stored under the key "<name-of-the-accuracy-layer>-accuracy".

zacsketches commented 7 years ago

I realized that the MNIST tutorial in the uses an .hdf5 statistics file, but the source code in the examples folder has a .jld filename in the same line. As a glutton for punishment I spent last night on a cross-country flight trying to read in the HDF5.Compound data type of the statistics file as I had copied it out of the tutorial, but reading HDF5.Compound types in Julia is not documented in the HDF5.jl repo or docs. So I eventually threw in the towel and switched my script to a .jld statistics file and read it no problem. I created a pull request for an expanded MNIST tutorial that includes a discussion of plotting the learning curve and what it should look like for a solver that is successfully converging in stochastic gradient descent. Hope this helps the next guy/gal that wants to try their hand at using Julia and Mocha.

zacsketches commented 7 years ago

My pull request #216 added these learning curves.