Skip to content

Bijectors, LazyMeta, Parameters, etc. #83

Answered by stefanwebb
francois-rozet asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @francois-rozet, thanks for your interest in contributing to FlowTorch! There's a lot to unpack here - I'll do my best :)

flowtorch.lazy.LazyMeta is a metaclass that handles delayed initialization. It solves the problem of being able to create a "plan" for a normalizing flow before you know all of the information, e.g. the shape of the base distribution. When you try to instantiate a Bijector or Parameters object and haven't specified all the arguments, it will return a flowtorch.lazy.Lazy object that records the class type and the arguments/values you've specified so far. Then when you call .__init__ another time and fill in the remaining arguments it will convert into an actual Bijector

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@stefanwebb
Comment options

@francois-rozet
Comment options

@stefanwebb
Comment options

@francois-rozet
Comment options

Answer selected by francois-rozet
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants