add grid search

This commit is contained in:
thanhvc3 2023-05-17 13:36:59 +07:00
parent 03b38c7e99
commit a7fb599368

View File

@ -659,7 +659,6 @@ if __name__ == "__main__":
grid = GridSearchCV(estimator=estimator, param_grid=paramsGrid, n_jobs=-1, cv=1)
data = np.array(model.triples['train'])
data = data[np.random.choice(np.arange(len(data)), size=int(len(data) * 0.2), replace=False)]
print(data[0])
dataloader = iter(DataLoader(
TrainDataset(data, model.p),
batch_size=len(data),
@ -668,8 +667,6 @@ if __name__ == "__main__":
collate_fn=TrainDataset.collate_fn
))
for step, batch in enumerate(dataloader):
print(batch[0])
print(batch.shape)
sub, rel, obj, label, neg_ent, sub_samp = model.read_batch(
batch, 'train')