dsipts.models.crossformer.cross_decoder module

class dsipts.models.crossformer.cross_decoder.DecoderLayer(seg_len, d_model, n_heads, d_ff=None, dropout=0.1, out_seg_num=10, factor=10)[source]

Bases: Module

The decoder layer of Crossformer, each layer will make a prediction at its scale

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

__init__(seg_len, d_model, n_heads, d_ff=None, dropout=0.1, out_seg_num=10, factor=10)[source]

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

forward(x, cross)[source]

x: the output of last decoder layer cross: the output of the corresponding encoder layer

class dsipts.models.crossformer.cross_decoder.Decoder(seg_len, d_layers, d_model, n_heads, d_ff, dropout, router=False, out_seg_num=10, factor=10)[source]

Bases: Module

The decoder of Crossformer, making the final prediction by adding up predictions at each scale

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

__init__(seg_len, d_layers, d_model, n_heads, d_ff, dropout, router=False, out_seg_num=10, factor=10)[source]

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

forward(x, cross)[source]

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.