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

[Do not merge] Extend post-processing and plotting to act on intermediate layers of model #64

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jmarshrossney
Copy link
Collaborator

Phase 1:

  • Action that yields model parameters (weights and biases) layer-by-layer
  • Action that yields batches of configurations layer-by-layer (including base and Metropolis output)
  • Implement basic plotting
  • Subplots to separate weights from different networks, if interesting

Phase 2:

  • Add runcard parameter layer_id to allow looping the entire analysis (including correlation functions, bootstrapping etc) over each layer in the model
  • Tables + save to .csv as well as the usual plots
  • Write script that reads in data from saved .csv and plots all of the layer on a single figure

Ambitions:

  • Instead of just numbers, it would be nice if layer_id could refer to an attribute of the layers in the model. E.g., if I wanted to plot the spline layer and the MCMC output I could write layer_ids: [spline, metropolis].
  • Better labelling of layers in the report.

@wilsonmr
Copy link
Owner

Just the final commit that is

This reverts commit f215adb.

Reverting update to fix broken test, since made in other PR
@jmarshrossney
Copy link
Collaborator Author

Ok done. Didn't realise that was the breaking you were referring to.

@wilsonmr
Copy link
Owner

My fault for not being specific enough! If we get that merged soon then we can rebase this

@jmarshrossney jmarshrossney mentioned this pull request Apr 26, 2021
Comment on lines +197 to +204
for block in loaded_model:
v, _ = block(v, 0, negative_mag)
# only want coupling layers
if len([tensor for tensor in block.state_dict().values()]) > 1:
if i == layer_id:
return v
else:
i += 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will need to adjust this after #68 is merged, since the model is no longer necessarily a flat Sequential of coupling blocks.

@jmarshrossney jmarshrossney changed the title Extend post-processing and plotting to act on intermediate layers of model [Do not merge] Extend post-processing and plotting to act on intermediate layers of model May 24, 2021
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.

2 participants