nami.components.time#
Classes
|
Return scalar time as a one-dimensional feature. |
|
Map scalar time to sinusoidal features. |
- class nami.components.time.ScalarTimeEmbedding(*args, **kwargs)[source]#
Bases:
ModuleReturn scalar time as a one-dimensional feature.
- forward(t, *, leading_shape, device, dtype)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- out_dim = 1#
- class nami.components.time.SinusoidalTimeEmbedding(dim, *, max_period=10000.0)[source]#
Bases:
ModuleMap scalar time to sinusoidal features.
When
dim=1no sinusoids are produced; the output is simply the raw scalar time (equivalent toScalarTimeEmbedding).- forward(t, *, leading_shape, device, dtype)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.