def convoltuion_shape(img_height, img_width, filter_shape, stride, padding):
 height = ((((img_height + (2 * padding[0])) - filter_shape[0]) / float(stride[0])) + 1)
 width = ((((img_width + (2 * padding[1])) - filter_shape[1]) / float(stride[1])) + 1)
 assert ((height % 1) == 0)
 assert ((width % 1) == 0)
 return (int(height), int(width))

def convoltuion_shape ( img_height , img_width , filter_shape , stride , padding ) : height = ( ( ( ( img_height + ( 2 * padding [ 0 ] ) ) - filter_shape [ 0 ] ) / float ( stride [ 0 ] ) ) + 1 ) width = ( ( ( ( img_width + ( 2 * padding [ 1 ] ) ) - filter_shape [ 1 ] ) / float ( stride [ 1 ] ) ) + 1 ) assert ( ( height % 1 ) == 0 ) assert ( ( width % 1 ) == 0 ) return ( int ( height ) , int ( width ) )
calculate output shape for convolution layer .