-
-
Save szagoruyko/ad2977e4b8dceb64c68ea07f6abf397b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local np = require 'npy4th' | |
local iterm = require 'iterm' | |
local train = np.loadnpy'./train.npy' | |
local test = np.loadnpy'./test.npy' | |
local cifar10 = torch.load'/home/zagoruys/raid/datasets/tiny-datasets/cifar10_whitened.t7' | |
print(cifar10) | |
local train_labels = np.loadnpy'../cifar-100-python/train_labels.npy' | |
local test_labels = np.loadnpy'../cifar-100-python/test_labels.npy' | |
assert(train:size(1) == train_labels:size(1)) | |
assert(test:size(1) == test_labels:size(1)) | |
print(train_labels:min(), train_labels:max()) | |
local dataset = { | |
trainData = { | |
data = train:view(-1,3,32,32), | |
labels = train_labels:squeeze():double() + 1, | |
size = function() return train_labels:size(1) end, | |
}, | |
testData = { | |
data = test:view(-1,3,32,32), | |
labels = test_labels:squeeze():double() + 1, | |
size = function() return test_labels:size(1) end, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment