(self, configs)
| 13 | Informer with Propspare attention in O(LlogL) complexity |
| 14 | """ |
| 15 | def __init__(self, configs): |
| 16 | super(Model, self).__init__() |
| 17 | self.pred_len = configs.pred_len |
| 18 | self.output_attention = configs.output_attention |
| 19 | |
| 20 | # Embedding |
| 21 | if configs.embed_type == 0: |
| 22 | self.enc_embedding = DataEmbedding(configs.enc_in, configs.d_model, configs.embed, configs.freq, |
| 23 | configs.dropout) |
| 24 | self.dec_embedding = DataEmbedding(configs.dec_in, configs.d_model, configs.embed, configs.freq, |
| 25 | configs.dropout) |
| 26 | elif configs.embed_type == 1: |
| 27 | self.enc_embedding = DataEmbedding(configs.enc_in, configs.d_model, configs.embed, configs.freq, |
| 28 | configs.dropout) |
| 29 | self.dec_embedding = DataEmbedding(configs.dec_in, configs.d_model, configs.embed, configs.freq, |
| 30 | configs.dropout) |
| 31 | elif configs.embed_type == 2: |
| 32 | self.enc_embedding = DataEmbedding_wo_pos(configs.enc_in, configs.d_model, configs.embed, configs.freq, |
| 33 | configs.dropout) |
| 34 | self.dec_embedding = DataEmbedding_wo_pos(configs.dec_in, configs.d_model, configs.embed, configs.freq, |
| 35 | configs.dropout) |
| 36 | |
| 37 | elif configs.embed_type == 3: |
| 38 | self.enc_embedding = DataEmbedding_wo_temp(configs.enc_in, configs.d_model, configs.embed, configs.freq, |
| 39 | configs.dropout) |
| 40 | self.dec_embedding = DataEmbedding_wo_temp(configs.dec_in, configs.d_model, configs.embed, configs.freq, |
| 41 | configs.dropout) |
| 42 | elif configs.embed_type == 4: |
| 43 | self.enc_embedding = DataEmbedding_wo_pos_temp(configs.enc_in, configs.d_model, configs.embed, configs.freq, |
| 44 | configs.dropout) |
| 45 | self.dec_embedding = DataEmbedding_wo_pos_temp(configs.dec_in, configs.d_model, configs.embed, configs.freq, |
| 46 | configs.dropout) |
| 47 | # Encoder |
| 48 | self.encoder = Encoder( |
| 49 | [ |
| 50 | EncoderLayer( |
| 51 | AttentionLayer( |
| 52 | ProbAttention(False, configs.factor, attention_dropout=configs.dropout, |
| 53 | output_attention=configs.output_attention), |
| 54 | configs.d_model, configs.n_heads), |
| 55 | configs.d_model, |
| 56 | configs.d_ff, |
| 57 | dropout=configs.dropout, |
| 58 | activation=configs.activation |
| 59 | ) for l in range(configs.e_layers) |
| 60 | ], |
| 61 | [ |
| 62 | ConvLayer( |
| 63 | configs.d_model |
| 64 | ) for l in range(configs.e_layers - 1) |
| 65 | ] if configs.distil else None, |
| 66 | norm_layer=torch.nn.LayerNorm(configs.d_model) |
| 67 | ) |
| 68 | # Decoder |
| 69 | self.decoder = Decoder( |
| 70 | [ |
| 71 | DecoderLayer( |
| 72 | AttentionLayer( |
nothing calls this directly
no test coverage detected