d278768807dff0c1920795073a219577571959d7,gpytorch/lazy/kronecker_product_added_diag_lazy_tensor.py,KroneckerProductAddedDiagLazyTensor,inv_quad,#KroneckerProductAddedDiagLazyTensor#Any#Any#,115

Before Change


        inv_mat = DiagLazyTensor(v_matrix.diag() + noise)

        res = q_matrix.t().matmul(tensor)
        res = inv_mat.inverse().matmul(res)
        res = q_matrix.matmul(res)

        return tensor.t().matmul(res).squeeze()

After Change


    def inv_quad(self, tensor, reduce_inv_quad=True):
        // TODO: check stability of numerics here
        svd_list = self._kron_svd
        v_matrix = KroneckerProductLazyTensor(*[DiagLazyTensor(svd_decomp.S) for svd_decomp in svd_list])
        q_matrix = KroneckerProductLazyTensor(*[lazify(svd_decomp.U) for svd_decomp in svd_list])

        // TODO: this could be a memory hog.
        inv_mat = DiagLazyTensor(1.0 / (v_matrix.diag() + self._diag_tensor.diag()))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: d278768807dff0c1920795073a219577571959d7
Time: 2020-06-26
Author: wjm363@nyu.edu
File Name: gpytorch/lazy/kronecker_product_added_diag_lazy_tensor.py
Class Name: KroneckerProductAddedDiagLazyTensor
Method Name: inv_quad


Project Name: cornellius-gp/gpytorch
Commit Name: 91b0d220c8e816766fd4565e1d2f5115d3afbefe
Time: 2018-10-12
Author: gpleiss@gmail.com
File Name: test/functions/test_inv_quad_log_det.py
Class Name: TestInvQuadLogDetBatch
Method Name: test_inv_quad_log_det_many_vectors


Project Name: silvandeleemput/memcnn
Commit Name: 375f42176d438788acac405e5982914ce04aa43f
Time: 2020-03-01
Author: silvandeleemput@gmail.com
File Name: memcnn/models/revop.py
Class Name: InvertibleModuleWrapper
Method Name: inverse