Bijectors, LazyMeta, Parameters, etc. #83
-
Hi 👋 I am interested in contributing to FlowTorch, but I find the structure of the package hard to grasp. It seems like every class is a subclass of |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @francois-rozet, thanks for your interest in contributing to FlowTorch! There's a lot to unpack here - I'll do my best :)
The difference between
|
Beta Was this translation helpful? Give feedback.
-
I need to write some docs on how these classes work and a tutorial on creating a new |
Beta Was this translation helpful? Give feedback.
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 aBijector
orParameters
object and haven't specified all the arguments, it will return aflowtorch.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 actualBijector