nami.components.time#

Classes

ScalarTimeEmbedding(*args, **kwargs)

Return scalar time as a one-dimensional feature.

SinusoidalTimeEmbedding(dim, *[, max_period])

Map scalar time to sinusoidal features.

class nami.components.time.ScalarTimeEmbedding(*args, **kwargs)[source]#

Bases: Module

Return scalar time as a one-dimensional feature.

Parameters:
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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:
out_dim = 1#
class nami.components.time.SinusoidalTimeEmbedding(dim, *, max_period=10000.0)[source]#

Bases: Module

Map scalar time to sinusoidal features.

When dim=1 no sinusoids are produced; the output is simply the raw scalar time (equivalent to ScalarTimeEmbedding).

Parameters:
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 Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Return type:

Tensor

Parameters:
property out_dim: int#