d000bae3a03681b11818e98c29a64a145e0ff1ec,torchsample/modules/example.py,,,#,10
Before Change
import torch.optim as optim
from keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train = x_train / 255.
x_test = x_test / 255.
x_train = np.expand_dims(x_train,1).astype("float32")
After Change
import os
from torchvision import datasets
ROOT = "./data"
dataset = datasets.MNIST(ROOT, train=True, download=True)
x_train, y_train = torch.load(os.path.join(dataset.root, "processed/training.pt"))
x_test, y_test = torch.load(os.path.join(dataset.root, "processed/test.pt"))
x_train = x_train.float()
y_train = y_train.long()
x_test = x_test.float()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: ncullen93/torchsample
Commit Name: d000bae3a03681b11818e98c29a64a145e0ff1ec
Time: 2017-04-20
Author: ncullen@modv-vlan533.0018.apn.wlan.med.upenn.edu
File Name: torchsample/modules/example.py
Class Name:
Method Name:
Project Name: ray-project/ray
Commit Name: b71c912da70e307ff1a9f07c7ca277a727306126
Time: 2020-07-05
Author: rliaw@berkeley.edu
File Name: python/ray/tune/tests/tutorial.py
Class Name:
Method Name: train_mnist
Project Name: pytorch/examples
Commit Name: 49ec0bd72b85be55579ae8ceb278c66145f593e1
Time: 2020-07-01
Author: matti.picus@gmail.com
File Name: mnist/main.py
Class Name:
Method Name: main