You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test_preds = []
for x, y in tqdm.tqdm(test_dl):
preds = model(x)
# if you're data is on the GPU, you need to move the data back to the cpu
# preds = preds.data.cpu().numpy()
preds = preds.data.numpy()
# the actual outputs of the model are logits, so we need to pass these values to the sigmoid function
preds = 1 / (1 + np.exp(-preds))
test_preds.append(preds)
test_preds = np.hstack(test_preds)
In my experiment, the correct one should be np.vstack .
The elements of list test_preds are type ndarrays with shape (batches, features=6) and the batches of the last element might be different from others if total number of samples can not be divided by batch_size
The text was updated successfully, but these errors were encountered:
torchtext.__version__
'0.3.1'In my experiment, the correct one should be
np.vstack
.The elements of list
test_preds
are type ndarrays with shape(batches, features=6)
and thebatches
of the last element might be different from others if total number of samples can not be divided bybatch_size
The text was updated successfully, but these errors were encountered: