This commit is contained in:
wassname
2022-07-18 09:37:21 +08:00
parent bfa75a41ae
commit 1d65e2f78a
2 changed files with 1158 additions and 1 deletions
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -51,6 +51,7 @@ class EWMAMean(Mean):
elif torch.equal(x.squeeze(), self.train_x.squeeze()):
return ewma[..., :-1].type(torch.FloatTensor).to(self.train_x.device)
else:
return ewma[..., -1:].repeat(len(x)).type(torch.FloatTensor).to(self.train_x.device)
return ewma.type(torch.FloatTensor).to(self.train_x.device)
@@ -132,4 +133,4 @@ class MeanRevertingEMAMean(Mean):
elif torch.equal(x.squeeze(), self.train_x.squeeze()):
return ema[..., :-1].type(torch.FloatTensor).to(self.train_x.device)
else:
return ema.type(torch.FloatTensor).to(self.train_x.device)
return ema.type(torch.FloatTensor).to(self.train_x.device)