#NEWLINE# def f_conv( self , x , spec , in_dim , weight_name ) : #NEWLINE# #INDENT# ( layer_type , dims ) = spec #NEWLINE# num_filters = dims [ 0 ] #NEWLINE# filter_size = ( dims [ 1 ] , dims [ 1 ] ) #NEWLINE# stride = ( dims [ 2 ] , dims [ 2 ] ) #NEWLINE# bm = ( 'full' if ( 'convf' in layer_type ) else 'valid' ) #NEWLINE# num_channels = in_dim [ 0 ] #NEWLINE# W = self . weight ( self . rand_init_conv ( ( ( num_filters , num_channels ) + filter_size ) ) , weight_name ) #NEWLINE# if ( stride != ( 1 , 1 ) ) : #NEWLINE# #INDENT# f = GpuCorrMM ( subsample = stride , border_mode = bm , pad = ( 0 , 0 ) ) #NEWLINE# y = f ( gpu_contiguous ( x ) , gpu_contiguous ( W ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( self . p . batch_size == self . p . valid_batch_size ) #NEWLINE# y = conv2d ( x , W , image_shape = ( ( ( 2 * self . p . batch_size ) , ) + in_dim ) , filter_shape = ( ( num_filters , stride ) + filter_size ) , border_mode = bm ) #NEWLINE# #UNINDENT# output_size = ( ( num_filters , ) + ConvOp . getOutputShape ( in_dim [ 1 : ] , filter_size , stride , bm ) ) #NEWLINE# return ( y , output_size )