#NEWLINE# def build_model( ) : #NEWLINE# #INDENT# l0 = nn . layers . InputLayer ( ( batch_size , 1 , patch_size [ 0 ] , patch_size [ 1 ] ) ) #NEWLINE# l0c = dihedral . CyclicSliceLayer ( l0 ) #NEWLINE# l1a = Conv2DLayer ( l0c , num_filters = 32 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu ) #NEWLINE# l1b = Conv2DLayer ( l1a , num_filters = 16 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu ) #NEWLINE# l1 = MaxPool2DLayer ( l1b , ds = ( 3 , 3 ) , strides = ( 2 , 2 ) ) #NEWLINE# l1r = dihedral . CyclicConvRollLayer ( l1 ) #NEWLINE# l2a = Conv2DLayer ( l1r , num_filters = 64 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu ) #NEWLINE# l2b = Conv2DLayer ( l2a , num_filters = 32 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu ) #NEWLINE# l2 = MaxPool2DLayer ( l2b , ds = ( 3 , 3 ) , strides = ( 2 , 2 ) ) #NEWLINE# l2r = dihedral . CyclicConvRollLayer ( l2 ) #NEWLINE# l3a = Conv2DLayer ( l2r , num_filters = 128 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu , untie_biases = True ) #NEWLINE# l3b = Conv2DLayer ( l3a , num_filters = 128 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu , untie_biases = True ) #NEWLINE# l3c = Conv2DLayer ( l3b , num_filters = 64 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu , untie_biases = True ) #NEWLINE# l3 = MaxPool2DLayer ( l3c , ds = ( 3 , 3 ) , strides = ( 2 , 2 ) ) #NEWLINE# l3r = dihedral . CyclicConvRollLayer ( l3 ) #NEWLINE# l4a = Conv2DLayer ( l3r , num_filters = 256 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu , untie_biases = True ) #NEWLINE# l4b = Conv2DLayer ( l4a , num_filters = 256 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu , untie_biases = True ) #NEWLINE# l4c = Conv2DLayer ( l4b , num_filters = 128 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu , untie_biases = True ) #NEWLINE# l4 = MaxPool2DLayer ( l4c , ds = ( 3 , 3 ) , strides = ( 2 , 2 ) ) #NEWLINE# l4r = dihedral . CyclicConvRollLayer ( l4 ) #NEWLINE# l5a = Conv2DLayer ( l4r , num_filters = 256 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu , untie_biases = True ) #NEWLINE# l5b = Conv2DLayer ( l5a , num_filters = 256 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu , untie_biases = True ) #NEWLINE# l5c = Conv2DLayer ( l5b , num_filters = 128 , filter_size = ( 3 , 3 ) , border_mode = 'same' , W = nn_plankton . Conv2DOrthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu , untie_biases = True ) #NEWLINE# l5 = MaxPool2DLayer ( l5c , ds = ( 3 , 3 ) , strides = ( 2 , 2 ) ) #NEWLINE# l5r = dihedral . CyclicConvRollLayer ( l5 ) #NEWLINE# l5f = nn . layers . flatten ( l5r ) #NEWLINE# l6 = nn . layers . DenseLayer ( nn . layers . dropout ( l5f , p = 0.5 ) , num_units = 256 , W = nn_plankton . Orthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu ) #NEWLINE# l6r = dihedral . CyclicRollLayer ( l6 ) #NEWLINE# l7 = nn . layers . DenseLayer ( nn . layers . dropout ( l6r , p = 0.5 ) , num_units = 256 , W = nn_plankton . Orthogonal ( 1.0 ) , b = nn . init . Constant ( 0.1 ) , nonlinearity = nn_plankton . leaky_relu ) #NEWLINE# l7m = dihedral . CyclicPoolLayer ( l7 , pool_function = nn_plankton . rms ) #NEWLINE# l8 = nn . layers . DenseLayer ( nn . layers . dropout ( l7m , p = 0.5 ) , num_units = data . num_classes , nonlinearity = T . nnet . softmax , W = nn_plankton . Orthogonal ( 1.0 ) ) #NEWLINE# l_resume = l2 #NEWLINE# l_exclude = l2 #NEWLINE# return ( [ l1a ] , l8 , l_resume , l_exclude )