MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / __init__

Method __init__

models/ReformerMS.py:42–71  ·  view source on GitHub ↗
(self, configs)

Source from the content-addressed store, hash-verified

40 """
41
42 def __init__(self, configs):
43 super(Model, self).__init__()
44 self.pred_len = configs.pred_len
45 self.pred_len = configs.pred_len
46 self.output_attention = configs.output_attention
47
48 # Embedding
49 self.enc_embedding = DataEmbedding_mine(configs.enc_in, configs.d_model, configs.embed, configs.freq, configs.dropout, is_decoder=True)
50 # Encoder
51 self.encoder = Encoder(
52 [
53 EncoderLayer(
54 ReformerLayer(None, configs.d_model, configs.n_heads, bucket_size=configs.bucket_size,
55 n_hashes=configs.n_hashes),
56 configs.d_model,
57 configs.d_ff,
58 dropout=configs.dropout,
59 activation=configs.activation
60 ) for l in range(configs.e_layers)
61 ],
62 norm_layer=torch.nn.LayerNorm(configs.d_model)
63 )
64 self.projection = nn.Linear(configs.d_model, configs.c_out, bias=True)
65 """
66 following functions will be used to manage scales
67 """
68 self.scale_factor = configs.scale_factor
69 self.scales = configs.scales
70 self.mv = moving_avg()
71 self.upsample = nn.Upsample(scale_factor=self.scale_factor, mode='linear')
72
73 def forward(self, x_enc, x_mark_enc, x_dec, x_mark_dec,
74 enc_self_mask=None, dec_self_mask=None, dec_enc_mask=None):

Callers 1

__init__Method · 0.45

Calls 5

DataEmbedding_mineClass · 0.90
EncoderClass · 0.90
EncoderLayerClass · 0.90
ReformerLayerClass · 0.90
moving_avgClass · 0.70

Tested by

no test coverage detected