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
# 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)))) |
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
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): |