1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-06-06 05:51:17 +08:00

Black(new version) Format

This commit is contained in:
Young
2022-02-06 22:33:16 +08:00
parent 76b7b5f24b
commit 6a946761cf
14 changed files with 35 additions and 35 deletions

View File

@@ -130,7 +130,7 @@ class TRAModel(Model):
if prob is not None:
P = sinkhorn(-L, epsilon=0.01) # sample assignment matrix
lamb = self.lamb * (self.rho ** self.global_step)
lamb = self.lamb * (self.rho**self.global_step)
reg = prob.log().mul(P).sum(dim=-1).mean()
loss = loss - lamb * reg
@@ -547,7 +547,7 @@ def evaluate(pred):
score = pred.score
label = pred.label
diff = score - label
MSE = (diff ** 2).mean()
MSE = (diff**2).mean()
MAE = (diff.abs()).mean()
IC = score.corr(label)
return {"MSE": MSE, "MAE": MAE, "IC": IC}