def __init__(self): super(SNN, self).__init__() self.input = nn.Input() self.fc1 = nn.Linear(in_features=784, out_features=500) self.active1 = nn.LIF() self.fc2 = nn.Linear(in_features=500, out_features=150) self.active2 = nn.LIF() self.fc3 = nn.Linear(in_features=150, out_features=50) self.active3 = nn.LIF() self.fc4 = nn.Linear(in_features=50, out_features=10) self.output = nn.Output(out_features=10)
def __init__(self): super(SNN, self).__init__() self.conv1 = nn.Conv2d(in_channels=1, out_channels=10, kernel_size=5) self.active1 = nn.LIF() self.conv2 = nn.Conv2d(in_channels=10, out_channels=20, kernel_size=5) self.active2 = nn.LIF() self.pool1 = nn.Pooling(size=2, channel=10) self.active3 = nn.LIF() self.pool2 = nn.Pooling(size=2, channel=20) self.active4 = nn.LIF() self.fc1 = nn.Linear(out_features=100, in_features=320) self.active5 = nn.LIF() self.fc2 = nn.Linear(out_features=50, in_features=100) self.active6 = nn.LIF() self.fc3 = nn.Linear(out_features=30, in_features=50) self.active7 = nn.LIF() self.fc4 = nn.Linear(out_features=10, in_features=30) self.output = nn.Output(out_features=10)