mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-17 09:24:34 +08:00
add_pre-commit_and_flake8_to_CI
This commit is contained in:
committed by
you-n-g
parent
243e516cf1
commit
30e457119c
@@ -249,7 +249,7 @@ class DEnsembleModel(Model, FeatureInt):
|
||||
return pred
|
||||
|
||||
def predict_sub(self, submodel, df_data, features):
|
||||
x_data, y_data = df_data["feature"].loc[:, features], df_data["label"]
|
||||
x_data = df_data["feature"].loc[:, features]
|
||||
pred_sub = pd.Series(submodel.predict(x_data.values), index=x_data.index)
|
||||
return pred_sub
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ class SFM_Model(nn.Module):
|
||||
if len(self.states) == 0: # hasn't initialized yet
|
||||
self.init_states(x)
|
||||
self.get_constants(x)
|
||||
p_tm1 = self.states[0]
|
||||
p_tm1 = self.states[0] # noqa: F841
|
||||
h_tm1 = self.states[1]
|
||||
S_re_tm1 = self.states[2]
|
||||
S_im_tm1 = self.states[3]
|
||||
|
||||
@@ -477,10 +477,10 @@ class TabNet(nn.Module):
|
||||
sparse_loss = []
|
||||
out = torch.zeros(x.size(0), self.n_d).to(x.device)
|
||||
for step in self.steps:
|
||||
x_te, l = step(x, x_a, priors)
|
||||
x_te, loss = step(x, x_a, priors)
|
||||
out += F.relu(x_te[:, : self.n_d]) # split the feature from feat_transformer
|
||||
x_a = x_te[:, self.n_d :]
|
||||
sparse_loss.append(l)
|
||||
sparse_loss.append(loss)
|
||||
return self.fc(out), sum(sparse_loss)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user