(options, params, prefix='lstm', nin=None, dim=None)
return params
Stack the weight matricies for all the gates
     for much cleaner code and slightly faster dot-prods
Stack the weight matricies for all the gates
     for much cleaner code and slightly faster dot-prods
Stack the weight matricies for all the gates for much cleaner code and slightly faster dot - prods
def param_init_lstm(options, params, prefix='lstm', nin=None, dim=None):
    if nin is None:
        nin = options['dim_proj']
    if dim is None:
        dim = options['dim_proj']
    """
     Stack the weight matricies for all the gates
     for much cleaner code and slightly faster dot-prods
    """
    # input weights
    W = numpy.concatenate([norm_weight(nin,dim),
                           norm_weight(nin,dim),
                           norm_weight(nin,dim),
                           norm_weight(nin,dim)], axis=1)
    params[_p(prefix,'W')] = W
    # for the previous hidden activation
    U = numpy.concatenate([ortho_weight(dim),
                           ortho_weight(dim),
                           ortho_weight(dim),
                           ortho_weight(dim)], axis=1)
    params[_p(prefix,'U')] = U
    params[_p(prefix,'b')] = numpy.zeros((4 * dim,)).astype('float32')

    return params
def param_init_lstm ( options , params , prefix = 'lstm' , nin = None , dim = None ) : if nin is None : nin = options [ 'dim_proj' ] if dim is None : dim = options [ 'dim_proj' ] # input weights W = numpy . concatenate ( [ norm_weight ( nin , dim ) , norm_weight ( nin , dim ) , norm_weight ( nin , dim ) , norm_weight ( nin , dim ) ] , axis = 1 ) params [ _p ( prefix , 'W' ) ] = W # for the previous hidden activation U = numpy . concatenate ( [ ortho_weight ( dim ) , ortho_weight ( dim ) , ortho_weight ( dim ) , ortho_weight ( dim ) ] , axis = 1 ) params [ _p ( prefix , 'U' ) ] = U params [ _p ( prefix , 'b' ) ] = numpy . zeros ( ( 4 * dim , ) ) . astype ( 'float32' ) return params