#NEWLINE# def __init__( self , in_size , out_size , pool_size , wscale = 1 , initialW = None , initial_bias = 0 ) : #NEWLINE# #INDENT# linear_out_size = ( out_size * pool_size ) #NEWLINE# if ( initialW is not None ) : #NEWLINE# #INDENT# initialW = initialW . reshape ( linear_out_size , in_size ) #NEWLINE# #UNINDENT# if ( initial_bias is not None ) : #NEWLINE# #INDENT# if numpy . isscalar ( initial_bias ) : #NEWLINE# #INDENT# initial_bias = numpy . full ( ( linear_out_size , ) , initial_bias , dtype = numpy . float32 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( initial_bias , ( numpy . ndarray , cuda . ndarray ) ) : #NEWLINE# #INDENT# initial_bias = initial_bias . reshape ( wscale ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'initial bias must be float, ndarray, or None' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# super ( Maxout , self ) . __init__ ( linear = linear . Linear ( in_size , linear_out_size , wscale , nobias = ( initial_bias is None ) , initialW = initialW , initial_bias = initial_bias ) ) #NEWLINE# self . out_size = out_size #NEWLINE# self . pool_size = pool_size