Skip to content

Instantly share code, notes, and snippets.

@szagoruyko
Created May 6, 2016 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szagoruyko/ad2977e4b8dceb64c68ea07f6abf397b to your computer and use it in GitHub Desktop.
Save szagoruyko/ad2977e4b8dceb64c68ea07f6abf397b to your computer and use it in GitHub Desktop.
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