-
Notifications
You must be signed in to change notification settings - Fork 54
Lesson 1: hstack vs. vstack #9
Copy link
Copy link
Open
Description
torchtext.__version__ '0.3.1'
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels