peal.generators.tabular_ddpm.PositionalEncoding

class peal.generators.tabular_ddpm.PositionalEncoding[source]

Bases: Module

Fixed sinusoidal timestep embeddings looked up by integer timestep.

Parameters:
  • embed_dim (int) – Embedding width (even sizes fill sin/cos pairs exactly).

  • max_len (int) – Number of timesteps; the table has max_len rows for steps 0 .. max_len - 1 (row 0 of the internal table is dropped so that timestep 0 does not map to the all-zero/one row).

Methods

forward

Return the embeddings of timesteps t (int or LongTensor).

__init__(embed_dim, max_len=500)[source]

Precompute the [max_len, embed_dim] table as buffer P.

forward(t)[source]

Return the embeddings of timesteps t (int or LongTensor).