train = pd.read_csv("../datasets/sign-language-mnist/sign_mnist_train/sign_mnist_train.csv")
test = pd.read_csv("../datasets/sign-language-mnist/sign_mnist_test/sign_mnist_test.csv")
train_labels = train.pop('label').values
test_labels = test.pop('label').values
train_data = train.values
test_data = train.values
train_data, test_data = np.array(train_data, dtype=np.float32), np.array(test_data, dtype=np.float32)
train_labels, test_labels = np.array(train_labels, dtype=np.float32), np.array(test_labels, dtype=np.float32)
train_data, test_data = train_data.reshape((-1,1,28,28)), test_data.reshape((-1,1,28,28))
train_data = torch.from_numpy(train_data)
train_labels = torch.from_numpy(train_labels)
test_data = torch.from_numpy(test_data)
test_labels = torch.from_numpy(test_labels)
train_data = train_data.to(torch.float)
test_data = test_data.to(torch.float)
train_data, train_labels = torch.utils.data.TensorDataset(train_data), torch.utils.data.TensorDataset(train_labels)
test_data, test_labels = torch.utils.data.TensorDataset(test_data), torch.utils.data.TensorDataset(test_labels)
train_loader = torch.utils.data.ConcatDataset([train_data, train_labels])
test_loader = torch.utils.data.ConcatDataset([test_data, test_labels])
train_loader = torch.utils.data.DataLoader(train_loader,
shuffle=True, batch_size=32)
test_loader = torch.utils.data.DataLoader(test_loader,
shuffle=True, batch_size=32)