Skip to content

Commit d6b9d54

Browse files
committed
fixed model definition
1 parent b92e192 commit d6b9d54

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

googlenet.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ def weight_initialization(self):
2727
self[name].b.data = self.bias_initialization(link, constant=0)
2828

2929
def __call__(self, x, train=False):
30-
a = self.conv1x1(x)
31-
b = self.conv3x3(self.reduce3x3(x))
32-
c = self.conv5x5(self.reduce5x5(x))
33-
d = self.pool_proj(F.max_pooling_2d(x, ksize=(3, 3), stride=(1, 1), pad=(1, 1)))
30+
a = F.relu(self.conv1x1(x))
31+
b = F.relu(self.conv3x3(F.relu(self.reduce3x3(x))))
32+
c = F.relu(self.conv5x5(F.relu(self.reduce5x5(x))))
33+
d = F.relu(self.pool_proj(F.max_pooling_2d(x, ksize=(3, 3), stride=(1, 1), pad=(1, 1))))
3434
return F.concat((a, b, c, d), axis=1)
3535

3636
@staticmethod
@@ -104,10 +104,10 @@ def weight_initialization(self):
104104
self.linear.b.data = self.bias_initialization(self.linear, constant=0)
105105

106106
def __call__(self, x, train=True):
107-
h = self.conv1(x)
107+
h = F.relu(self.conv1(x))
108108
h = F.max_pooling_2d(h, ksize=(3, 3), stride=(2, 2), pad=(1, 1))
109-
h = self.conv2_1x1(h)
110-
h = self.conv2_3x3(h)
109+
h = F.relu(self.conv2_1x1(h))
110+
h = F.relu(self.conv2_3x3(h))
111111
h = F.max_pooling_2d(h, ksize=(3, 3), stride=(2, 2), pad=(1, 1))
112112
h = self.inception3a(h)
113113
h = self.inception3b(h)
@@ -119,7 +119,7 @@ def __call__(self, x, train=True):
119119
h = self.inception4e(h)
120120
h = F.max_pooling_2d(h, ksize=(3, 3), stride=(2, 2), pad=(1, 1))
121121
h = self.inception5a(h)
122-
h = self.inception5b(h)
122+
h = F.relu(self.inception5b(h))
123123
num, categories, y, x = h.data.shape
124124
# global average pooling
125125
h = F.reshape(F.average_pooling_2d(h, (y, x)), (num, categories))

0 commit comments

Comments
 (0)