#NEWLINE# def build_layer( self , dataset , layer_name ) : #NEWLINE# #INDENT# output_noise = ( None if ( layer_name . layer_noise . type is None ) else getattr ( layer_noise , layer_name . layer_noise . type ) ( ) ) #NEWLINE# if ( layer_name . layer_noise . type in [ 'BlackOut' , 'MaskOut' , 'BatchOut' ] ) : #NEWLINE# #INDENT# output_noise . ratio = layer_name . layer_noise . ratio #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( layer_name . layer_noise . type is 'Gaussian' ) : #NEWLINE# #INDENT# output_noise . std = layer_name . layer_noise . std #NEWLINE# output_noise . mean = layer_name . layer_noise . mean #NEWLINE# #UNINDENT# #UNINDENT# output = getattr ( layer , layer_name . type ) ( dim = layer_name . dim , name = layer_name . name , dropout_below = layer_name . dropout_below , noise = output_noise ) #NEWLINE# return output