src/core/layer.py
def orthonorm_op(x, epsilon=1e-7):
    '''
    Computes a matrix that orthogonalizes the input matrix x

    x:      an n x d input matrix
    eps:    epsilon to prevent nonzero values in the diagonal entries of x

    returns:    a d x d matrix, ortho_weights, which orthogonalizes x by
                right multiplication
    '''
    x_2 = K.dot(K.transpose(x), x)
    x_2 += K.eye(K.int_shape(x)[1])*epsilon
    L = tf.cholesky(x_2)
    ortho_weights = tf.transpose(tf.matrix_inverse(L)) * tf.sqrt(tf.cast(tf.shape(x)[0], dtype=K.floatx()))
    return ortho_weights

    Computes a matrix that orthogonalizes the input matrix x

    x:      an n x d input matrix
    eps:    epsilon to prevent nonzero values in the diagonal entries of x

    returns:    a d x d matrix, ortho_weights, which orthogonalizes x by
                right multiplication
    
Computes a matrix that orthogonalizes the input matrix x
x:      an n x d input matrix
eps:    epsilon to prevent nonzero values in the diagonal entries of x

a d x d matrix, ortho_weights, which orthogonalizes x by
right multiplication
Computes a matrix that orthogonalizes the input matrix x x : an n x d input matrix eps : epsilon to prevent nonzero values in the diagonal entries of x a d x d matrix ortho_weights which orthogonalizes x by right multiplication
def orthonorm_op(x, epsilon=1e-7):
    x_2 = K.dot(K.transpose(x), x)
    x_2 += K.eye(K.int_shape(x)[1])*epsilon
    L = tf.cholesky(x_2)
    ortho_weights = tf.transpose(tf.matrix_inverse(L)) * tf.sqrt(tf.cast(tf.shape(x)[0], dtype=K.floatx()))
    return ortho_weights
def orthonorm_op ( x , epsilon = 1e-7 ) : x_2 = K . dot ( K . transpose ( x ) , x ) x_2 += K . eye ( K . int_shape ( x ) [ 1 ] ) * epsilon L = tf . cholesky ( x_2 ) ortho_weights = tf . transpose ( tf . matrix_inverse ( L ) ) * tf . sqrt ( tf . cast ( tf . shape ( x ) [ 0 ] , dtype = K . floatx ( ) ) ) return ortho_weights
Computes a matrix that orthogonalizes the input matrix x
x:      an n x d input matrix
eps:    epsilon to prevent nonzero values in the diagonal entries of x
Computes a matrix that orthogonalizes the input matrix x x : an n x d input matrix eps : epsilon to prevent nonzero values in the diagonal entries of x
'''
    Computes a matrix that orthogonalizes the input matrix x

    x:      an n x d input matrix
    eps:    epsilon to prevent nonzero values in the diagonal entries of x

    returns:    a d x d matrix, ortho_weights, which orthogonalizes x by
                right multiplication
    '''
x
epsilon