Skip to content

Instantly share code, notes, and snippets.

@miki998
Created April 13, 2020 09:49
Show Gist options
  • Save miki998/3e73a421edbc8d1770ceaea82663f406 to your computer and use it in GitHub Desktop.
Save miki998/3e73a421edbc8d1770ceaea82663f406 to your computer and use it in GitHub Desktop.
#Formatting on training set
train_x = X_train.reshape(33600, 1, 28, 28)
train_x = torch.from_numpy(train_x).float()
# converting the target into torch format
y_train = torch.from_numpy(np.array(y_train))
# shape of training data
train_x.shape, y_train.shape
#Formatting on testing set
X_cv = X_cv.reshape(8400, 1, 28, 28)
X_cv = torch.from_numpy(np.array(X_cv)).float()
# converting the target into torch format
y_cv = torch.from_numpy(np.array(y_cv))
X_cv.shape, y_cv.shape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment