Skip to content

Instantly share code, notes, and snippets.

# Let's map between the fine and coarse categories.
cifar100Dir = '/data/cifar-100-python/' # modify this to your own directory...
import cPickle as pickle
import os
meta = pickle.load(open(os.path.join(cifar100Dir,'meta')))
test = pickle.load(open(os.path.join(cifar100Dir,'test')))
test_fine_labels = test['fine_labels']
test_coarse_labels = test['coarse_labels']
fine_to_coarse = dict(set((zip(test_fine_labels,test_coarse_labels))))
@rosenfeldamir
rosenfeldamir / multi_resolution.py
Last active September 26, 2017 20:22
create multiple convolutions to work on a single input in parallel.
def makeSomeLayers(in_channels,out_channels,resolutions):
layers = []
for r in resolutions:
layers.append(nn.Conv2d(in_channels=in_channels,out_channels=out_channels,kernel_size=r))
return layers
class Net(nn.Module):
def __init__(self):