affinity_search/makemodel.py
def add_conv_args(n,defaultwidth):
    '''add arguments for layer n, in the form conv<n>_<arg>
    A conv unit consists of a pool layer, a convolutional layer, 
    a normalization layer, and a non-linear layer
    The pool layer is defined by kernel size
    The conv layer is defined by kernel size, stride, initialization, and output width
    Note that a width of zero indicates the lack of the entire unit
    '''
    
    parser.add_argument('--pool%d_size'%n,type=int,help="Pooling size for layer %d"%n,default=2 if defaultwidth > 0 else 0,choices=(0,2,4,8))
    parser.add_argument('--pool%d_type'%n,type=str,help="Pooling type for layer %d"%n,default='MAX',choices=('MAX','AVE'))
    parser.add_argument('--conv%d_func'%n,type=str,help="Activation function in layer %d"%n,default='ReLU',choices=('ReLU','leaky','ELU','Sigmoid','TanH'))
    parser.add_argument('--conv%d_norm'%n,type=str,help="Normalization for layer %d"%n,default='none',choices=('BatchNorm','LRN','none'))
    parser.add_argument('--conv%d_size'%n,type=int,help="Convolutional kernel size for layer %d"%n,default=3,choices=(1,3,5,7))
    parser.add_argument('--conv%d_stride'%n,type=int,help="Convolutional stride for layer %d"%n,default=1,choices=(1,2,3,4))
    parser.add_argument('--conv%d_width'%n,type=int,help="Convolutional output width for layer %d"%n,default=defaultwidth,choices=(0,1,2,4,8,16,32,64,128,256,512,1024))
    parser.add_argument('--conv%d_init'%n,type=str,help="Weight initialization for layer %d"%n,default='xavier',choices=('gaussian','positive_unitball','uniform','xavier','msra','radial','radial.5'))
add arguments for layer n, in the form conv<n>_<arg>
    A conv unit consists of a pool layer, a convolutional layer, 
    a normalization layer, and a non-linear layer
    The pool layer is defined by kernel size
    The conv layer is defined by kernel size, stride, initialization, and output width
    Note that a width of zero indicates the lack of the entire unit
    
add arguments for layer n, in the form conv_
A conv unit consists of a pool layer, a convolutional layer,
a normalization layer, and a non-linear layer
The pool layer is defined by kernel size
The conv layer is defined by kernel size, stride, initialization, and output width
Note that a width of zero indicates the lack of the entire unit
add arguments for layer n in the form conv_ A conv unit consists of a pool layer a convolutional layer a normalization layer and a non - linear layer The pool layer is defined by kernel size The conv layer is defined by kernel size stride initialization and output width Note that a width of zero indicates the lack of the entire unit
def add_conv_args(n,defaultwidth):
    parser.add_argument('--pool%d_size'%n,type=int,help="Pooling size for layer %d"%n,default=2 if defaultwidth > 0 else 0,choices=(0,2,4,8))
    parser.add_argument('--pool%d_type'%n,type=str,help="Pooling type for layer %d"%n,default='MAX',choices=('MAX','AVE'))
    parser.add_argument('--conv%d_func'%n,type=str,help="Activation function in layer %d"%n,default='ReLU',choices=('ReLU','leaky','ELU','Sigmoid','TanH'))
    parser.add_argument('--conv%d_norm'%n,type=str,help="Normalization for layer %d"%n,default='none',choices=('BatchNorm','LRN','none'))
    parser.add_argument('--conv%d_size'%n,type=int,help="Convolutional kernel size for layer %d"%n,default=3,choices=(1,3,5,7))
    parser.add_argument('--conv%d_stride'%n,type=int,help="Convolutional stride for layer %d"%n,default=1,choices=(1,2,3,4))
    parser.add_argument('--conv%d_width'%n,type=int,help="Convolutional output width for layer %d"%n,default=defaultwidth,choices=(0,1,2,4,8,16,32,64,128,256,512,1024))
    parser.add_argument('--conv%d_init'%n,type=str,help="Weight initialization for layer %d"%n,default='xavier',choices=('gaussian','positive_unitball','uniform','xavier','msra','radial','radial.5'))
def add_conv_args ( n , defaultwidth ) : parser . add_argument ( '--pool%d_size' % n , type = int , help = "Pooling size for layer %d" % n , default = 2 if defaultwidth > 0 else 0 , choices = ( 0 , 2 , 4 , 8 ) ) parser . add_argument ( '--pool%d_type' % n , type = str , help = "Pooling type for layer %d" % n , default = 'MAX' , choices = ( 'MAX' , 'AVE' ) ) parser . add_argument ( '--conv%d_func' % n , type = str , help = "Activation function in layer %d" % n , default = 'ReLU' , choices = ( 'ReLU' , 'leaky' , 'ELU' , 'Sigmoid' , 'TanH' ) ) parser . add_argument ( '--conv%d_norm' % n , type = str , help = "Normalization for layer %d" % n , default = 'none' , choices = ( 'BatchNorm' , 'LRN' , 'none' ) ) parser . add_argument ( '--conv%d_size' % n , type = int , help = "Convolutional kernel size for layer %d" % n , default = 3 , choices = ( 1 , 3 , 5 , 7 ) ) parser . add_argument ( '--conv%d_stride' % n , type = int , help = "Convolutional stride for layer %d" % n , default = 1 , choices = ( 1 , 2 , 3 , 4 ) ) parser . add_argument ( '--conv%d_width' % n , type = int , help = "Convolutional output width for layer %d" % n , default = defaultwidth , choices = ( 0 , 1 , 2 , 4 , 8 , 16 , 32 , 64 , 128 , 256 , 512 , 1024 ) ) parser . add_argument ( '--conv%d_init' % n , type = str , help = "Weight initialization for layer %d" % n , default = 'xavier' , choices = ( 'gaussian' , 'positive_unitball' , 'uniform' , 'xavier' , 'msra' , 'radial' , 'radial.5' ) )
add arguments for layer n, in the form conv<n>_<arg>
A conv unit consists of a pool layer, a convolutional layer,
a normalization layer, and a non-linear layer
The pool layer is defined by kernel size
The conv layer is defined by kernel size, stride, initialization, and output width
Note that a width of zero indicates the lack of the entire unit
add arguments for layer n in the form conv<n > _<arg > A conv unit consists of a pool layer a convolutional layer a normalization layer and a non - linear layer The pool layer is defined by kernel size The conv layer is defined by kernel size stride initialization and output width Note that a width of zero indicates the lack of the entire unit
'''add arguments for layer n, in the form conv<n>_<arg>
    A conv unit consists of a pool layer, a convolutional layer, 
    a normalization layer, and a non-linear layer
    The pool layer is defined by kernel size
    The conv layer is defined by kernel size, stride, initialization, and output width
    Note that a width of zero indicates the lack of the entire unit
    '''
n
defaultwidth