modelzoo.vision.pytorch.dit.layers.TimestepEmbeddingLayer.TimestepEmbeddingLayer#

class modelzoo.vision.pytorch.dit.layers.TimestepEmbeddingLayer.TimestepEmbeddingLayer[source]#

Bases: torch.nn.Module

Embeds scalar timesteps into vector representations.

Methods

create_timestep_embedding

Create sinusoidal timestep embeddings.

forward

reset_parameters

__call__(*args: Any, **kwargs: Any) Any#

Call self as a function.

__init__(num_diffusion_steps, hidden_size, frequency_embedding_size=256, nonlinearity='silu', kernel_initializer: str = 'xavier_uniform', bias_initializer: str = 'zeros')[source]#
static __new__(cls, *args: Any, **kwargs: Any) Any#
static create_timestep_embedding(seq_len, dim, max_period=10000)[source]#

Create sinusoidal timestep embeddings. Slightly different than EmbeddingLayer.create_fix_pos_embedding.