Skip to content

Conversation

@cdhinrichs
Copy link
Contributor

Addresses #292

This PR does the following:

  • PRESERVES all pre-existing behavior, especially with respect to plotting
  • Defines a new set of constants:
    • one for each type of plot that can be generated
    • a list of ALL plots that can be generated
    • lists of plots that are generated together
  • Allows the plot argument to WeightWatcher.analyze() and other entry points to take either a boolean argument, which is replaced with the list of ALL plots if True, else an empty list; or to take a list of valid plot constants from the list above
  • Adds a check to valid_params() to ensure the plot argument only has allowed constants in it
  • Gates the creation of each separate plot on whether its corresponding constant is found in the params[PLOT] list or plot argument, whichever argument is passed to the function where plotting takes place.
  • Adds a set of tests to ensure the above behavior
  • Fixes a bug where MPDENSITY plots were not being saved to safedir.
  • Fixes an error in test_torch_linalg relating to half precision conversion (float16).

The following tests are currently passing, or else have the same failures as in the master branch:

  • Test_ValidParams
  • Test_KerasLayers
  • Test_PyTorchLayers
  • Test_PyStateDictLayers
  • Test_VGG11_noModel
  • Test_Albert
  • Test_Keras
  • Test_ResNet
  • Test_ResNet_Models
  • Test_RMT_Util
  • Test_Vector_Metrics
  • Test_PyTorchSVD
  • Test_PowerLaw
  • Test_Plots
  • Test_Pandas

The following tests have been skipped due to runtime:

  • Test_VGG11_Distances
  • Test_VGG11_Base
  • Test_VGG11_StateDict
  • Test_VGG11_Alpha_w_PowerLawFit

@cdhinrichs
Copy link
Contributor Author

The bug was that there was a clause for overlaying the pdf plot on top of the log-log ESD. When I examined the code, it looked like that code was intended to run unconditionally whenever anything gets plotted, because it was interwoven with the clause for computing min_evals_to_plot, which does need to be done unconditionally whenever anything is plotted. The fix is to move the pdf overlay into the WW_PLOT_LOGLOG_ESD condition block. I plotted all of the singletons and verified that they all look as they should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant