<s> import chainer <EOL> import chainer . functions as F <EOL> import chainer . links as L <EOL> class Alex ( chainer . Chain ) : <EOL> """<STR_LIT>""" <EOL> insize = <NUM_LIT> <EOL> def __init__ ( self ) : <EOL> super ( Alex , self ) . __init__ ( <EOL> conv1 = L . Convolution2D ( <NUM_LIT:3> , <NUM_LIT> , <NUM_LIT:11> , stride = <NUM_LIT:4> ) , <EOL> conv2 = L . Convolution2D ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:5> , pad = <NUM_LIT:2> ) , <EOL> conv3 = L . Convolution2D ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:3> , pad = <NUM_LIT:1> ) , <EOL> conv4 = L . Convolution2D ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:3> , pad = <NUM_LIT:1> ) , <EOL> conv5 = L . Convolution2D ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT:3> , pad = <NUM_LIT:1> ) , <EOL> fc6 = L . Linear ( <NUM_LIT> , <NUM_LIT> ) , <EOL> fc7 = L . Linear ( <NUM_LIT> , <NUM_LIT> ) , <EOL> fc8 = L . Linear ( <NUM_LIT> , <NUM_LIT:1000> ) , <EOL> ) <EOL> self . train = True <EOL> def clear ( self ) : <EOL> self . loss = None <EOL> self . accuracy = None <EOL> def __call__ ( self , x , t ) : <EOL> self . clear ( ) <EOL> h = F . max_pooling_2d ( F . relu ( <EOL> F . local_response_normalization ( self . conv1 ( x ) ) ) , <NUM_LIT:3> , stride = <NUM_LIT:2> ) <EOL> h = F . max_pooling_2d ( F . relu ( <EOL> F . local_response_normalization ( self . conv2 ( h ) ) ) , <NUM_LIT:3> , stride = <NUM_LIT:2> ) <EOL> h = F . relu ( self . conv3 ( h ) ) <EOL> h = F . relu ( self . conv4 ( h ) ) <EOL> h = F . max_pooling_2d ( F . relu ( self . conv5 ( h ) ) , <NUM_LIT:3> , stride = <NUM_LIT:2> ) <EOL> h = F . dropout ( F . relu ( self . fc6 ( h ) ) , train = self . train ) <EOL> h = F . dropout ( F . relu ( self . fc7 ( h ) ) , train = self . train ) <EOL> h = self . fc8 ( h ) <EOL> self . loss = F . softmax_cross_entropy ( h , t ) <EOL> self . accuracy = F . accuracy ( h , t ) <EOL> return self . loss </s>
