Closed MTandHJ closed 4 years ago
Hi there,
You are correct about some of the arguments, this repo is quite messy and was just my first attempt at getting SimCLR working, I will clean it up at some point when I have the time, so my apologies for the messy arguments.
For your second point, I had already addressed this in lines 150-172 in the network.py file to change the stem configuration dependent on the dataset.
if args.dataset == 'cifar10' or args.dataset == 'cifar100' or args.dataset == 'tinyimagenet':
# CIFAR Stem
self.stem = nn.Sequential()
self.stem.add_module('conv0', nn.Conv2d(3, self.inplanes, kernel_size=3, stride=1, padding=1,
bias=False))
self.stem.add_module('BN1', norm_layer(self.inplanes))
self.stem.add_module('ReLU1', nn.ReLU(inplace=True))
# e.g. ImageNet
else:
self.stem = nn.Sequential()
self.stem.add_module('conv0', nn.Conv2d(3, self.inplanes, kernel_size=7, stride=2, padding=3,
bias=False))
self.stem.add_module('BN1', norm_layer(self.inplanes))
self.stem.add_module('ReLU1', nn.ReLU(inplace=True))
self.stem.add_module('MaxPool1', nn.MaxPool2d(kernel_size=3, stride=2, padding=1))
First is clear that some args or kwargs don't match, for instance,
Besides, in this implement, ResNet has a max pooling operation at first; however, I found a sentence in the SimCLR's paper:
Thus, will this detail make difference?