#NEWLINE# def _get_architecture( large_network = False , weights_and_biases = None , detailed = False ) : #NEWLINE# #INDENT# if ( weights_and_biases is None ) : #NEWLINE# #INDENT# weights_and_biases = fetch_overfeat_weights_and_biases ( large_network ) #NEWLINE# #UNINDENT# ( weights , biases ) = weights_and_biases #NEWLINE# ws = [ w [ : , : , : : ( - 1 ) , : : ( - 1 ) ] for w in weights ] #NEWLINE# bs = biases #NEWLINE# if ( large_network and ( not detailed ) ) : #NEWLINE# #INDENT# architecture = [ Standardize ( 118.380948 , 61.896913 ) , Convolution ( ws [ 0 ] , bs [ 0 ] , subsample = ( 2 , 2 ) , activation = 'relu' ) , MaxPool ( ( 3 , 3 ) ) , Convolution ( ws [ 1 ] , bs [ 1 ] , activation = 'relu' ) , MaxPool ( ( 2 , 2 ) ) , Convolution ( ws [ 2 ] , bs [ 2 ] , activation = 'relu' , cropping = [ ( 1 , ( - 1 ) ) , ( 1 , ( - 1 ) ) ] , border_mode = 'full' ) , Convolution ( ws [ 3 ] , bs [ 3 ] , activation = 'relu' , cropping = [ ( 1 , ( - 1 ) ) , ( 1 , ( - 1 ) ) ] , border_mode = 'full' ) , Convolution ( ws [ 4 ] , bs [ 4 ] , activation = 'relu' , cropping = [ ( 1 , ( - 1 ) ) , ( 1 , ( - 1 ) ) ] , border_mode = 'full' ) , Convolution ( ws [ 5 ] , bs [ 5 ] , activation = 'relu' , cropping = [ ( 1 , ( - 1 ) ) , ( 1 , ( - 1 ) ) ] , border_mode = 'full' ) , MaxPool ( ( 3 , 3 ) ) , Convolution ( ws [ 6 ] , bs [ 6 ] , activation = 'relu' ) , Convolution ( ws [ 7 ] , bs [ 7 ] , activation = 'relu' ) , Convolution ( ws [ 8 ] , bs [ 8 ] , activation = 'identity' ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not large_network ) and ( not detailed ) ) : #NEWLINE# #INDENT# architecture = [ Standardize ( 118.380948 , 61.896913 ) , Convolution ( ws [ 0 ] , bs [ 0 ] , subsample = ( 4 , 4 ) , activation = 'relu' ) , MaxPool ( ( 2 , 2 ) ) , Convolution ( ws [ 1 ] , bs [ 1 ] , activation = 'relu' ) , MaxPool ( ( 2 , 2 ) ) , Convolution ( ws [ 2 ] , bs [ 2 ] , activation = 'relu' , cropping = [ ( 1 , ( - 1 ) ) , ( 1 , ( - 1 ) ) ] , border_mode = 'full' ) , Convolution ( ws [ 3 ] , bs [ 3 ] , activation = 'relu' , cropping = [ ( 1 , ( - 1 ) ) , ( 1 , ( - 1 ) ) ] , border_mode = 'full' ) , Convolution ( ws [ 4 ] , bs [ 4 ] , activation = 'relu' , cropping = [ ( 1 , ( - 1 ) ) , ( 1 , ( - 1 ) ) ] , border_mode = 'full' ) , MaxPool ( ( 2 , 2 ) ) , Convolution ( ws [ 5 ] , bs [ 5 ] , activation = 'relu' ) , Convolution ( ws [ 6 ] , bs [ 6 ] , activation = 'relu' ) , Convolution ( ws [ 7 ] , bs [ 7 ] , activation = 'identity' ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( large_network and detailed ) : #NEWLINE# #INDENT# architecture = [ Standardize ( 118.380948 , 61.896913 ) , Convolution ( ws [ 0 ] , bs [ 0 ] , subsample = ( 2 , 2 ) , activation = None ) , Relu ( ) , MaxPool ( ( 3 , 3 ) ) , Convolution ( ws [ 1 ] , bs [ 1 ] , activation = None ) , Relu ( ) , MaxPool ( ( 2 , 2 ) ) , ZeroPad ( 1 ) , Convolution ( ws [ 2 ] , bs [ 2 ] , activation = None ) , Relu ( ) , ZeroPad ( 1 ) , Convolution ( ws [ 3 ] , bs [ 3 ] , activation = None ) , Relu ( ) , ZeroPad ( 1 ) , Convolution ( ws [ 4 ] , bs [ 4 ] , activation = None ) , Relu ( ) , ZeroPad ( 1 ) , Convolution ( ws [ 5 ] , bs [ 5 ] , activation = None ) , Relu ( ) , MaxPool ( ( 3 , 3 ) ) , Convolution ( ws [ 6 ] , bs [ 6 ] , activation = None ) , Relu ( ) , Convolution ( ws [ 7 ] , bs [ 7 ] , activation = None ) , Relu ( ) , Convolution ( ws [ 8 ] , bs [ 8 ] , activation = None ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not large_network ) and detailed ) : #NEWLINE# #INDENT# architecture = [ Standardize ( 118.380948 , 61.896913 ) , Convolution ( ws [ 0 ] , bs [ 0 ] , subsample = ( 4 , 4 ) , activation = None ) , Relu ( ) , MaxPool ( ( 2 , 2 ) ) , Convolution ( ws [ 1 ] , bs [ 1 ] , activation = None ) , Relu ( ) , MaxPool ( ( 2 , 2 ) ) , ZeroPad ( 1 ) , Convolution ( ws [ 2 ] , bs [ 2 ] , activation = None ) , Relu ( ) , ZeroPad ( 1 ) , Convolution ( ws [ 3 ] , bs [ 3 ] , activation = None ) , Relu ( ) , ZeroPad ( 1 ) , Convolution ( ws [ 4 ] , bs [ 4 ] , activation = None ) , Relu ( ) , MaxPool ( ( 2 , 2 ) ) , Convolution ( ws [ 5 ] , bs [ 5 ] , activation = None ) , Relu ( ) , Convolution ( ws [ 6 ] , bs [ 6 ] , activation = None ) , Relu ( ) , Convolution ( ws [ 7 ] , bs [ 7 ] , activation = None ) ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return architecture