(shape, scale=1.1)
return sharedX(scale * q[:shape[0], :shape[1]])
benanne lasagne ortho init (faster than qr approach)
benanne lasagne ortho init (faster than qr approach)
benanne lasagne ortho init ( faster than qr approach )
def orthogonal(shape, scale=1.1):
    """ benanne lasagne ortho init (faster than qr approach)"""
    flat_shape = (shape[0], np.prod(shape[1:]))
    a = np.random.normal(0.0, 1.0, flat_shape)
    u, _, v = np.linalg.svd(a, full_matrices=False)
    q = u if u.shape == flat_shape else v # pick the one with the correct shape
    q = q.reshape(shape)
    return sharedX(scale * q[:shape[0], :shape[1]])
def orthogonal ( shape , scale = 1.1 ) : flat_shape = ( shape [ 0 ] , np . prod ( shape [ 1 : ] ) ) a = np . random . normal ( 0.0 , 1.0 , flat_shape ) u , _ , v = np . linalg . svd ( a , full_matrices = False ) q = u if u . shape == flat_shape else v # pick the one with the correct shape q = q . reshape ( shape ) return sharedX ( scale * q [ : shape [ 0 ] , : shape [ 1 ] ] )