2 import chainer.functions
as F
3 import chainer.links
as L
10 conv1=L.Convolution2D(3, 96, 11, stride=4),
11 conv2=L.Convolution2D(96, 256, 5, pad=2),
12 conv3=L.Convolution2D(256, 384, 3, pad=1),
13 conv4=L.Convolution2D(384, 384, 3, pad=1),
14 conv5=L.Convolution2D(384, 256, 3, pad=1),
15 fc6=L.Linear(9216, 4096),
16 fc7=L.Linear(4096, 4096),
17 fc8=L.Linear(4096, n_class))
20 h = F.local_response_normalization(self.conv1(x))
21 h = F.max_pooling_2d(F.relu(h), 3, stride=2)
22 h = F.local_response_normalization(self.conv2(h))
23 h = F.max_pooling_2d(F.relu(h), 3, stride=2)
24 h = F.relu(self.conv3(h))
25 h = F.relu(self.conv4(h))
26 h = F.max_pooling_2d(F.relu(self.conv5(h)), 3, stride=2)
27 h = F.dropout(F.relu(self.fc6(h)))
28 h = F.dropout(F.relu(self.fc7(h)))
33 assert not chainer.config.train
36 self.
loss = F.softmax_cross_entropy(h, t)
def __call__(self, x, t=None)
def __init__(self, n_class=1000)