apply_data.py 457 Bytes
Newer Older
1 2 3 4
from __future__ import absolute_import, division, print_function
from ..compat import *


5
def ApplyData(data, var, model_data):
Philipp Arras's avatar
Comment  
Philipp Arras committed
6
    # TODO This is rather confusing. Delete that eventually.
Martin Reinecke's avatar
Martin Reinecke committed
7 8 9
    from ..operators.diagonal_operator import DiagonalOperator
    from ..models.constant import Constant
    from ..sugar import sqrt
10 11
    sqrt_n = DiagonalOperator(sqrt(var))
    data = Constant(model_data.position, data)
Martin Reinecke's avatar
fixes  
Martin Reinecke committed
12
    return sqrt_n.inverse(model_data - data)