(ndim)
return u.astype('float32')
Random orthogonal weights

    Used by norm_weights(below), in which case, we
    are ensuring that the rows are orthogonal
    (i.e W = U \Sigma V, U has the same
    # of rows, V has the same # of cols)
Random orthogonal weights
Random orthogonal weights
def ortho_weight(ndim):
    """
    Random orthogonal weights

    Used by norm_weights(below), in which case, we
    are ensuring that the rows are orthogonal
    (i.e W = U \Sigma V, U has the same
    # of rows, V has the same # of cols)
    """
    W = numpy.random.randn(ndim, ndim)
    u, _, _ = numpy.linalg.svd(W)
    return u.astype('float32')
def ortho_weight ( ndim ) : W = numpy . random . randn ( ndim , ndim ) u , _ , _ = numpy . linalg . svd ( W ) return u . astype ( 'float32' )