dsipts.models.autoformer package

Submodules

dsipts.models.autoformer.layers module

class dsipts.models.autoformer.layers.AutoCorrelation(mask_flag=True, factor=1, scale=None, attention_dropout=0.1, output_attention=False)

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(queries, keys, values, attn_mask)

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.

time_delay_agg_full(values, corr)

Standard version of Autocorrelation

time_delay_agg_inference(values, corr)

SpeedUp version of Autocorrelation (a batch-normalization style design) This is for the inference phase.

time_delay_agg_training(values, corr)

SpeedUp version of Autocorrelation (a batch-normalization style design) This is for the training phase.

class dsipts.models.autoformer.layers.AutoCorrelationLayer(correlation, d_model, n_heads, d_keys=None, d_values=None)

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(queries, keys, values, attn_mask)

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.

class dsipts.models.autoformer.layers.Decoder(layers, norm_layer=None, projection=None)

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x, cross, x_mask=None, cross_mask=None, trend=None)

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.

class dsipts.models.autoformer.layers.DecoderLayer(self_attention, cross_attention, d_model, c_out, d_ff=None, moving_avg=25, dropout=0.1, activation='relu')

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x, cross, x_mask=None, cross_mask=None)

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.

class dsipts.models.autoformer.layers.Encoder(attn_layers, conv_layers=None, norm_layer=None)

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x, attn_mask=None)

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.

class dsipts.models.autoformer.layers.EncoderLayer(attention, d_model, d_ff=None, moving_avg=25, dropout=0.1, activation='relu')

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x, attn_mask=None)

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.

class dsipts.models.autoformer.layers.PositionalEmbedding(d_model, max_len=5000)

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)

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.

class dsipts.models.autoformer.layers.moving_avg(kernel_size, stride)

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)

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.

class dsipts.models.autoformer.layers.my_Layernorm(channels)

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)

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.

class dsipts.models.autoformer.layers.series_decomp(kernel_size)

Bases: Module

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(x)

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.

Module contents