ccloud0525 commited on
Commit
d3b2f33
·
1 Parent(s): e05efc0

feat: 'README'

Browse files
Files changed (1) hide show
  1. modeling_flame.py +2 -4
modeling_flame.py CHANGED
@@ -732,11 +732,9 @@ class FLAMEModel(nn.Module):
732
  # decoding
733
  x_dec = self.decoder(x_enc, x_rec)
734
 
735
- proj = nn.Linear(self.d_model, inference_patch_len, bias=False)
736
- proj.weight.data = resample(old=self.proj.weight.data.T,
737
- new_patch_len=inference_patch_len).T
738
 
739
- dec_out = proj(x_dec)
740
  point_forecasts = rearrange(dec_out, 'b n p -> b (n p)')
741
  return point_forecasts[:, :pred_len]
742
 
 
732
  # decoding
733
  x_dec = self.decoder(x_enc, x_rec)
734
 
735
+ resampled_weight = resample(old=self.proj.weight.data.T, new_patch_len=inference_patch_len).T
736
+ dec_out = F.linear(x_dec, resampled_weight)
 
737
 
 
738
  point_forecasts = rearrange(dec_out, 'b n p -> b (n p)')
739
  return point_forecasts[:, :pred_len]
740