Shared Layers#
Building-block layers used across multiple models.
- class chronocratic.models.layers.general.BandedFourierLayer(in_channels: int, out_channels: int, band: int, num_bands: int, length: int = 201)#
Bases:
ModuleBanded Fourier Layer for applying banded Fourier transform to the input tensor.
- Parameters:
in_channels (int) – Number of input channels.
out_channels (int) – Number of output channels.
band (int) – Index of the band to process.
num_bands (int) – Total number of bands.
length (int) – Length of the input sequence. Default is 201.
- forward(input_tensor: Tensor) → Tensor#
Forward pass for the Banded Fourier Layer.
- Parameters:
input_tensor – Input tensor of shape (batch_size, time_steps, in_channels).
- Returns:
Output tensor after applying the banded Fourier transform.
- reset_parameters() → None#
Initialize the layer parameters.
- class chronocratic.models.layers.general.LevelModel(latent_dim: int, input_dims: int, sequence_length: int)#
Bases:
Module- forward(z: Tensor) → Tensor#
Return the level component for each latent vector.
- class chronocratic.models.layers.general.ResidualConnection(sequence_length: int, input_dims: int, hidden_layer_sizes: Sequence[int], latent_dim: int, encoder_last_dense_dim: int)#
Bases:
Module- forward(z: Tensor) → Tensor#
Return the residual decoder branch for each latent vector.
- class chronocratic.models.layers.general.SeasonalLayer(sequence_length: int, input_dims: int, latent_dim: int, custom_seasonality: tuple[tuple[int, int], ...])#
Bases:
Module- forward(z: Tensor) → Tensor#
Return additive seasonal values for each latent vector.
- compute_output_shape(input_shape: tuple[int, ...]) → tuple[int, int, int]#
Return the output shape for Keras-compatible callers.