wilsonmr / anvil

Repository containing code related to flow based generative model
https://wilsonmr.github.io/anvil/
GNU General Public License v3.0
0 stars 2 forks source link

add api to anvil #66

Closed wilsonmr closed 3 years ago

wilsonmr commented 3 years ago

Sorry for not adding this earlier, I suspect it could have helped with experimentation.

wilsonmr commented 3 years ago

btw @marshrossney it might be simpler to use this to write the script/notebook which samples intermediate layers and plots it. because you can load up the model using this and then loop through the layers and do the forward pass manually idk, up to you..

wilsonmr commented 3 years ago

potentially you could use the "hack" to patch each layer output into the plotting action in lieu of the real sample

schematically:

API.<plotting action>(configs=torch.zeros(....))

where you replace the torch tensor with the tensors you just manually created.

jmarshrossney commented 3 years ago

Ok this looks really useful!

That said, though I'm seeing it for the first time, I'm not sure it should replace a reportengine loop over layer_id to sample the intermediate layers, which should work well once #64 has been properly sorted. But it's always nice to have more than one way to do something.

wilsonmr commented 3 years ago

You're right, I think that approch is the best

but generally this should make scripts a bit easier, and then if you write functions which accept inputs from the API then it should be easier to translate a function in a script into a useable action