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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder