The goal of this PR is to add a model.get_activations() function which can get activations for large n-dimensional families of lazily generated images. In the course of accomplishing this, I had to do a few other things:
(1) Add a number of utilities for using iterable workflows in n-dimensions. See lucid.misc.iter_nd_utils.
(2) Fix an annoying cludge with model.import_graph(). Lucid's convention for accessing the internals of an imported model is to use the T() accessor (inspired by $ in jquery). But for weird historical reasons, only render.import_model returned T, not model.import_graph. To avoid needing to depend on render, I added this support to import_graph (where it really always should have been).
(3) Finally, add a lazy iteration based get_activations and get_activations_iter (more flexible, but not exposed by default). get_activations() is added as a method to model to make it easily accessible.
The goal of this PR is to add a
model.get_activations()
function which can get activations for large n-dimensional families of lazily generated images. In the course of accomplishing this, I had to do a few other things:(1) Add a number of utilities for using iterable workflows in n-dimensions. See
lucid.misc.iter_nd_utils
.(2) Fix an annoying cludge with
model.import_graph()
. Lucid's convention for accessing the internals of an imported model is to use theT()
accessor (inspired by$
in jquery). But for weird historical reasons, onlyrender.import_model
returnedT
, notmodel.import_graph
. To avoid needing to depend onrender
, I added this support toimport_graph
(where it really always should have been).(3) Finally, add a lazy iteration based
get_activations
andget_activations_iter
(more flexible, but not exposed by default).get_activations()
is added as a method to model to make it easily accessible.