<s> import theano as _th <EOL> import numpy as _np <EOL> def create_param ( shape , init , fan = None , name = None , type = _th . config . floatX ) : <EOL> return _th . shared ( init ( shape , fan ) . astype ( type ) , name = name ) <EOL> def create_param_and_grad ( shape , init , fan = None , name = None , type = _th . config . floatX ) : <EOL> val = init ( shape , fan ) . astype ( type ) <EOL> param = _th . shared ( val , name = name ) <EOL> grad_name = '<STR_LIT>' + name if name is not None else None <EOL> grad_param = _th . shared ( _np . zeros_like ( val ) , name = grad_name ) <EOL> return param , grad_param <EOL> def create_param_state_as ( other , initial_value = <NUM_LIT:0> ) : <EOL> return _th . shared ( other . get_value ( ) * <NUM_LIT:0> + initial_value , <EOL> broadcastable = other . broadcastable , <EOL> name = '<STR_LIT>' + str ( other . name ) <EOL> ) </s>
