Skip to content

Instantly share code, notes, and snippets.

View juancamilog's full-sized avatar

Juan Camilo Gamboa Higuera juancamilog

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import theano
import numpy as np
# inti vars
s = theano.tensor.matrix('s')
y = theano.tensor.vector('y')
r = theano.tensor.slinalg.Solve()(s, y)
# jacobian using scan
dr1 = theano.tensor.jacobian(r.flatten(), s)
@register_stabilize
@local_optimizer([Dot, Dot22])
def inv_as_solve(node):
if not imported_scipy:
return False
if isinstance(node.op, (Dot, Dot22)):
l, r = node.inputs
if l.owner and l.owner.op == matrix_inverse:
if CHECK l.owner.inputs[0] is PSD HERE:
import theano
import theano.tensor as T
from theano.sandbox.linalg import psd,matrix_inverse,det,cholesky
from theano.tensor.slinalg import solve_lower_triangular
import numpy as np
from time import time
def SEard(loghyp,X):
''' Squared exponential kernel with diagonal scaling matrix (one lengthscale per dimension)'''
N,idims = X.shape
import theano
import theano.tensor as T
from theano.sandbox.linalg import psd,matrix_inverse,det,cholesky
import numpy as np
from time import time
def SEard(loghyp,X):
''' Squared exponential kernel with diagonal scaling matrix (one lengthscale per dimension)'''
N,idims = X.shape
import theano
import theano.tensor as T
from theano.sandbox.linalg import psd,matrix_inverse,det,cholesky
import numpy as np
from time import time
def SEard(loghyp,X):
''' Squared exponential kernel with diagonal scaling matrix (one lengthscale per dimension)'''
N,idims = X.shape
import theano
import theano.tensor as T
from theano.sandbox.linalg import psd,matrix_inverse,det,cholesky
import numpy as np
from time import time
def SEard(loghyp,X):
''' Squared exponential kernel with diagonal scaling matrix (one lengthscale per dimension)'''
N,idims = X.shape