add grid search
This commit is contained in:
parent
ff855256e0
commit
bb6d06a903
2
main.py
2
main.py
@ -656,7 +656,7 @@ if __name__ == "__main__":
|
|||||||
'module__embed_dim': [300, 400, 500],
|
'module__embed_dim': [300, 400, 500],
|
||||||
}
|
}
|
||||||
|
|
||||||
grid = GridSearchCV(estimator=estimator, param_grid=paramsGrid, n_jobs=-1, cv=1)
|
grid = GridSearchCV(estimator=estimator, param_grid=paramsGrid, n_jobs=-1, cv=1, scoring=torch.nn.BCELoss)
|
||||||
data = np.array(model.triples['train'])
|
data = np.array(model.triples['train'])
|
||||||
data = data[np.random.choice(np.arange(len(data)), size=int(len(data) * 0.2), replace=False)]
|
data = data[np.random.choice(np.arange(len(data)), size=int(len(data) * 0.2), replace=False)]
|
||||||
dataloader = iter(DataLoader(
|
dataloader = iter(DataLoader(
|
||||||
|
@ -537,12 +537,6 @@ class FouriER(torch.nn.Module):
|
|||||||
loss = self.bceloss(pred, true_label)
|
loss = self.bceloss(pred, true_label)
|
||||||
return loss
|
return loss
|
||||||
|
|
||||||
def score(self, pred, true_label=None, sub_samp=None):
|
|
||||||
label_pos = true_label[0]
|
|
||||||
label_neg = true_label[1:]
|
|
||||||
loss = self.bceloss(pred, true_label)
|
|
||||||
return loss
|
|
||||||
|
|
||||||
def forward_embeddings(self, x):
|
def forward_embeddings(self, x):
|
||||||
x = self.patch_embed(x)
|
x = self.patch_embed(x)
|
||||||
return x
|
return x
|
||||||
|
Loading…
Reference in New Issue
Block a user