credit.models.wxformer.crossformer_ensemble#

Attributes#

Classes#

CrossFormerWithNoise

CrossFormer variant with pixel-wise noise injection in both encoder and decoder stages.

Module Contents#

class credit.models.wxformer.crossformer_ensemble.CrossFormerWithNoise(noise_latent_dim=128, encoder_noise_factor=0.05, decoder_noise_factor=0.275, encoder_noise=True, freeze=True, correlated=False, **kwargs)#

Bases: credit.models.crossformer.CrossFormer

CrossFormer variant with pixel-wise noise injection in both encoder and decoder stages.

noise_latent_dim#

Dimensionality of the noise vector.

Type:

int

encoder_noise_factor#

Initial scaling factor for encoder noise injection.

Type:

float

decoder_noise_factor#

Initial scaling factor for decoder noise injection.

Type:

float

encoder_noise#

Whether to apply noise injection in the encoder.

Type:

bool

freeze#

Whether to freeze pre-trained model weights.

Type:

bool

noise_latent_dim = 128#
correlated = False#
encoder_noise = True#
noise_inject1#
noise_inject2#
noise_inject3#
forward(x, noise=None, forecast_step=None)#

Forward pass through the CrossFormer with noise injection.

Parameters:
  • x (Tensor) – Input tensor of shape (batch_size, channels, height, width).

  • noise (Tensor, optional) – External noise tensor. If None, noise is sampled internally. Defaults to None.

Returns:

Output tensor after passing through the model.

Return type:

Tensor

credit.models.wxformer.crossformer_ensemble.logger#