Skip to content

Commit 96052f0

Browse files
committedFeb 20, 2020
Update models
1 parent 190245c commit 96052f0

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed
 

‎models/BayesianModels/Bayesian3Conv3FC.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,23 @@ def __init__(self, outputs, inputs):
1515

1616
self.num_classes = outputs
1717

18-
self.conv1 = BBBConv2d(inputs, 32, 5, alpha_shape=(1,1), padding=2, bias=False)
18+
self.conv1 = BBBConv2d(inputs, 32, 5, alpha_shape=(1,1), padding=2, bias=False, name='conv1')
1919
self.soft1 = nn.Softplus()
2020
self.pool1 = nn.MaxPool2d(kernel_size=3, stride=2)
2121

22-
self.conv2 = BBBConv2d(32, 64, 5, alpha_shape=(1,1), padding=2, bias=False)
22+
self.conv2 = BBBConv2d(32, 64, 5, alpha_shape=(1,1), padding=2, bias=False, name='conv2')
2323
self.soft2 = nn.Softplus()
2424
self.pool2 = nn.MaxPool2d(kernel_size=3, stride=2)
2525

26-
self.conv3 = BBBConv2d(64, 128, 5, alpha_shape=(1,1), padding=1, bias=False)
26+
self.conv3 = BBBConv2d(64, 128, 5, alpha_shape=(1,1), padding=1, bias=False, name='conv3')
2727
self.soft3 = nn.Softplus()
2828
self.pool3 = nn.MaxPool2d(kernel_size=3, stride=2)
2929

3030
self.flatten = FlattenLayer(2 * 2 * 128)
31-
self.fc1 = BBBLinear(2 * 2 * 128, 1000, alpha_shape=(1,1), bias=False)
31+
self.fc1 = BBBLinear(2 * 2 * 128, 1000, alpha_shape=(1,1), bias=False, name='fc1')
3232
self.soft5 = nn.Softplus()
3333

34-
self.fc2 = BBBLinear(1000, 1000, alpha_shape=(1,1), bias=False)
34+
self.fc2 = BBBLinear(1000, 1000, alpha_shape=(1,1), bias=False, name='fc2')
3535
self.soft6 = nn.Softplus()
3636

37-
self.fc3 = BBBLinear(1000, outputs, alpha_shape=(1,1), bias=False)
37+
self.fc3 = BBBLinear(1000, outputs, alpha_shape=(1,1), bias=False, name='fc3')

‎models/BayesianModels/BayesianAlexNet.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ def __init__(self, outputs, inputs):
1313

1414
self.num_classes = outputs
1515

16-
self.conv1 = BBBConv2d(inputs, 64, 11, alpha_shape=(1,1), stride=4, padding=5, bias=False)
16+
self.conv1 = BBBConv2d(inputs, 64, 11, alpha_shape=(1,1), stride=4, padding=5, bias=False, name='conv1')
1717
self.soft1 = nn.Softplus()
1818
self.pool1 = nn.MaxPool2d(kernel_size=2, stride=2)
1919

20-
self.conv2 = BBBConv2d(64, 192, 5, alpha_shape=(1,1), padding=2, bias=False)
20+
self.conv2 = BBBConv2d(64, 192, 5, alpha_shape=(1,1), padding=2, bias=False, name='conv2')
2121
self.soft2 = nn.Softplus()
2222
self.pool2 = nn.MaxPool2d(kernel_size=2, stride=2)
2323

24-
self.conv3 = BBBConv2d(192, 384, 3, alpha_shape=(1,1), padding=1, bias=False)
24+
self.conv3 = BBBConv2d(192, 384, 3, alpha_shape=(1,1), padding=1, bias=False, name='conv3')
2525
self.soft3 = nn.Softplus()
2626

27-
self.conv4 = BBBConv2d(384, 256, 3, alpha_shape=(1,1), padding=1, bias=False)
27+
self.conv4 = BBBConv2d(384, 256, 3, alpha_shape=(1,1), padding=1, bias=False, name='conv4')
2828
self.soft4 = nn.Softplus()
2929

30-
self.conv5 = BBBConv2d(256, 128, 3, alpha_shape=(1,1), padding=1, bias=False)
30+
self.conv5 = BBBConv2d(256, 128, 3, alpha_shape=(1,1), padding=1, bias=False, name='conv5')
3131
self.soft5 = nn.Softplus()
3232
self.pool3 = nn.MaxPool2d(kernel_size=2, stride=2)
3333

3434
self.flatten = FlattenLayer(1 * 1 * 128)
35-
self.classifier = BBBLinear(1 * 1 * 128, outputs, alpha_shape=(1,1), bias=False)
35+
self.classifier = BBBLinear(1 * 1 * 128, outputs, alpha_shape=(1,1), bias=False, name='classifier')

0 commit comments

Comments
 (0)
Please sign in to comment.