(self, configs)
| 116 | |
| 117 | class PastDecomposableMixing(nn.Module): |
| 118 | def __init__(self, configs): |
| 119 | super(PastDecomposableMixing, self).__init__() |
| 120 | self.seq_len = configs.seq_len |
| 121 | self.pred_len = configs.pred_len |
| 122 | self.down_sampling_window = configs.down_sampling_window |
| 123 | |
| 124 | self.layer_norm = nn.LayerNorm(configs.d_model) |
| 125 | self.dropout = nn.Dropout(configs.dropout) |
| 126 | self.channel_independence = configs.channel_independence |
| 127 | |
| 128 | if configs.decomp_method == 'moving_avg': |
| 129 | self.decompsition = series_decomp(configs.moving_avg) |
| 130 | elif configs.decomp_method == "dft_decomp": |
| 131 | self.decompsition = DFT_series_decomp(configs.top_k) |
| 132 | else: |
| 133 | raise ValueError('decompsition is error') |
| 134 | |
| 135 | if configs.channel_independence == 0: |
| 136 | self.cross_layer = nn.Sequential( |
| 137 | nn.Linear(in_features=configs.d_model, out_features=configs.d_ff), |
| 138 | nn.GELU(), |
| 139 | nn.Linear(in_features=configs.d_ff, out_features=configs.d_model), |
| 140 | ) |
| 141 | |
| 142 | # Mixing season |
| 143 | self.mixing_multi_scale_season = MultiScaleSeasonMixing(configs) |
| 144 | |
| 145 | # Mxing trend |
| 146 | self.mixing_multi_scale_trend = MultiScaleTrendMixing(configs) |
| 147 | |
| 148 | self.out_cross_layer = nn.Sequential( |
| 149 | nn.Linear(in_features=configs.d_model, out_features=configs.d_ff), |
| 150 | nn.GELU(), |
| 151 | nn.Linear(in_features=configs.d_ff, out_features=configs.d_model), |
| 152 | ) |
| 153 | |
| 154 | def forward(self, x_list): |
| 155 | length_list = [] |
nothing calls this directly
no test coverage detected