def __init__(self, vgg_name, T, bias=False): super(CatVGG, self).__init__() self.snn = catSNN.spikeLayer(T) self.T = T self.bias = bias self.features = self._make_layers(cfg[vgg_name]) self.classifier = self.snn.dense((1, 1, 512), 10)
def __init__(self, vgg_name, T, is_noise=False, bias=True): super(CatVGG_o, self).__init__() self.snn = catSNN.spikeLayer(T) self.T = T self.is_noise = is_noise self.bias = bias self.features = self._make_layers(cfg[vgg_name], is_noise) self.classifier = self.snn.dense((1, 1, 1024), 10, bias=True)
def __init__(self, vgg_name, T, bias=False): super(CatVGG, self).__init__() self.snn = catSNN.spikeLayer(T) self.T = T self.bias=bias self.features = self._make_layers(cfg[vgg_name]) #self.classifier = nn.Linear(512, 10, bias=False) #((1,1,512),10) self.classifier1 = self.snn.dense((7,7,512),4096, bias=self.bias) self.classifier2 = self.snn.dense(4096,4096, bias=self.bias) self.classifier3 = self.snn.dense(4096,1000, bias=self.bias)
def __init__(self, T): super(CatNet, self).__init__() self.T = T snn = spikeLayer(T) self.snn = snn self.conv1 = snn.conv(1, 16, (3, 1), 1, (1, 0), bias=True) self.conv2 = snn.conv(16, 24, (3, 1), 1, (1, 0), bias=True) self.pool1 = snn.pool((2, 1)) self.pool2 = snn.pool((2, 1)) self.fc1 = snn.dense((1, 45, 24), 2, bias=True)
def __init__(self, T): super(CatNet, self).__init__() self.T = T snn = spikeLayer(T) self.snn = snn self.conv1 = snn.conv(1, 64, 5, 1, 0, bias=True) self.conv2 = snn.conv(64, 64, 5, 1, 0, bias=True) self.conv3 = snn.conv(64, 128, 5, 1, 0, bias=True) self.pool1 = snn.pool(2) self.pool2 = snn.pool(2) self.fc1 = snn.dense((4, 4, 128), 128, bias=True) self.fc2 = snn.dense(128, 2, bias=True)
def __init__(self, T): super(CatNet, self).__init__() self.T = T snn = spikeLayer(T) self.snn = snn self.conv1 = snn.conv(1, 32, 3, 1, 1, bias=True) self.conv2 = snn.conv(32, 32, 3, 1, 1, bias=True) self.conv3 = snn.conv(32, 32, 3, 1, 1, bias=True) self.pool1 = snn.pool(2) self.conv4 = snn.conv(32, 16, 1, 1, 0, bias=True) self.conv5 = snn.conv(16, 16, 3, 1, 1, bias=True) self.conv6 = snn.conv(16, 32, 1, 1, 0, bias=True) self.fc1 = snn.dense((14, 14, 32), 128, bias=True) self.fc2 = snn.dense(128, 10, bias=True)
def __init__(self, T): super(CatNet, self).__init__() self.T = T snn = spikeLayer(T) self.snn = snn self.conv1 = snn.conv(1, 32, 3, 1, 0, bias=True) self.conv2 = snn.conv(32, 32, 3, 1, 0, bias=True) self.conv3 = snn.conv(32, 32, 4, 2, 1, bias=True) self.conv4 = snn.conv(32, 64, 3, 1, 0, bias=True) self.conv5 = snn.conv(64, 64, 3, 1, 0, bias=True) self.conv6 = snn.conv(64, 64, 4, 2, 1, bias=True) self.conv7 = snn.conv(64, 128, 3, 1, 0, bias=True) self.fc1 = snn.dense((2, 2, 128), 10, bias=True)
def __init__(self, T): super(CatNet, self).__init__() self.snn = catSNN.spikeLayer(T) self.T = T self.model = self._make_layers() self.fc = self.snn.dense(512, 10, bias=True)