MCPcopy Index your code
hub / github.com/OpenRL-Lab/Wandb_Tutorial / load

Function load

artifact/load_data.py:26–45  ·  view source on GitHub ↗

# Load the data

(train_size=1)

Source from the content-addressed store, hash-verified

24 if not mirror.startswith("http://yann.lecun.com")]
25
26def load(train_size=1):
27 """
28 # Load the data
29 """
30
31 # the data, split between train and test sets
32 train = torchvision.datasets.MNIST("./", train=True, download=True)
33
34 (x_train, y_train) = (train.data, train.targets)
35
36 # split off a validation set for hyperparameter tuning
37 x_train = x_train[:train_size].clone()
38
39 y_train = y_train[:train_size].clone()
40
41 training_set = TensorDataset(x_train, y_train)
42
43 datasets = [training_set]
44
45 return datasets
46
47
48def preprocess(dataset, normalize=True, expand_dims=True):

Callers 2

test_upload_artifactFunction · 0.90
load_data.pyFile · 0.85

Calls

no outgoing calls

Tested by 1

test_upload_artifactFunction · 0.72