(self, configs)
| 35 | Multi-scale version of Autoformer |
| 36 | """ |
| 37 | def __init__(self, configs): |
| 38 | super(Model, self).__init__() |
| 39 | self.seq_len = configs.seq_len |
| 40 | self.label_len = configs.label_len |
| 41 | self.pred_len = configs.pred_len |
| 42 | self.output_attention = configs.output_attention |
| 43 | |
| 44 | # Decomp |
| 45 | self.decomp = series_decomp(configs.moving_avg) |
| 46 | |
| 47 | # Embedding |
| 48 | # We use our new DataEmbedding which incldues the scale information |
| 49 | self.enc_embedding = DataEmbedding_mine(configs.enc_in, configs.d_model, configs.embed, configs.freq, configs.dropout) |
| 50 | self.dec_embedding = DataEmbedding_mine(configs.dec_in, configs.d_model, configs.embed, configs.freq, configs.dropout, is_decoder=True) |
| 51 | |
| 52 | # Encoder |
| 53 | self.encoder = Encoder( |
| 54 | [ |
| 55 | EncoderLayer( |
| 56 | AutoCorrelationLayer( |
| 57 | AutoCorrelation(False, configs.factor, attention_dropout=configs.dropout, output_attention=configs.output_attention), configs.d_model, configs.n_heads), |
| 58 | configs.d_model, |
| 59 | configs.d_ff, |
| 60 | moving_avg = configs.moving_avg, |
| 61 | dropout=configs.dropout, |
| 62 | activation=configs.activation |
| 63 | ) for l in range(configs.e_layers) |
| 64 | ], |
| 65 | norm_layer=my_Layernorm(configs.d_model) |
| 66 | ) |
| 67 | # Decoder |
| 68 | self.decoder = Decoder( |
| 69 | [ |
| 70 | DecoderLayer( |
| 71 | AutoCorrelationLayer( |
| 72 | AutoCorrelation(True, configs.factor, attention_dropout=configs.dropout, output_attention=False), configs.d_model, configs.n_heads), |
| 73 | AutoCorrelationLayer( |
| 74 | AutoCorrelation(False, configs.factor, attention_dropout=configs.dropout, output_attention=False), configs.d_model, configs.n_heads), |
| 75 | configs.d_model, |
| 76 | configs.c_out, |
| 77 | configs.d_ff, |
| 78 | moving_avg = configs.moving_avg, |
| 79 | dropout=configs.dropout, |
| 80 | activation=configs.activation, |
| 81 | ) |
| 82 | for l in range(configs.d_layers) |
| 83 | ], |
| 84 | norm_layer=my_Layernorm(configs.d_model), |
| 85 | projection=nn.Linear(configs.d_model, configs.c_out, bias=True) |
| 86 | ) |
| 87 | """ |
| 88 | following functions will be used to manage scales |
| 89 | """ |
| 90 | self.scale_factor = configs.scale_factor |
| 91 | self.scales = configs.scales |
| 92 | self.mv = moving_avg() |
| 93 | self.upsample = nn.Upsample(scale_factor=self.scale_factor, mode='linear') |
| 94 | self.input_decomposition_type = 1 |
no test coverage detected