def param_init_gru(options, params, prefix='gru', nin=None, dim=None):
 if (nin == None):
  nin = options['dim_proj']
 if (dim == None):
  dim = options['dim_proj']
 W = numpy.concatenate([norm_weight(nin, dim), norm_weight(nin, dim)], axis=1)
 params[_p(prefix, 'W')] = W
 params[_p(prefix, 'b')] = numpy.zeros(((2 * dim),)).astype('float32')
 U = numpy.concatenate([ortho_weight(dim), ortho_weight(dim)], axis=1)
 params[_p(prefix, 'U')] = U
 Wx = norm_weight(nin, dim)
 params[_p(prefix, 'Wx')] = Wx
 Ux = ortho_weight(dim)
 params[_p(prefix, 'Ux')] = Ux
 params[_p(prefix, 'bx')] = numpy.zeros((dim,)).astype('float32')
 return params

def param_init_gru ( options , params , prefix = 'gru' , nin = None , dim = None ) : if ( nin == None ) : nin = options [ 'dim_proj' ] if ( dim == None ) : dim = options [ 'dim_proj' ] W = numpy . concatenate ( [ norm_weight ( nin , dim ) , norm_weight ( nin , dim ) ] , axis = 1 ) params [ _p ( prefix , 'W' ) ] = W params [ _p ( prefix , 'b' ) ] = numpy . zeros ( ( ( 2 * dim ) , ) ) . astype ( 'float32' ) U = numpy . concatenate ( [ ortho_weight ( dim ) , ortho_weight ( dim ) ] , axis = 1 ) params [ _p ( prefix , 'U' ) ] = U Wx = norm_weight ( nin , dim ) params [ _p ( prefix , 'Wx' ) ] = Wx Ux = ortho_weight ( dim ) params [ _p ( prefix , 'Ux' ) ] = Ux params [ _p ( prefix , 'bx' ) ] = numpy . zeros ( ( dim , ) ) . astype ( 'float32' ) return params
parameter init for gru .