Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/inversion_ideas/data_misfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def gradient(self, model: Model) -> npt.NDArray[np.float64]:
"""
jac = self.simulation.jacobian(model)
weights_matrix = self.weights_matrix
return -2 * jac.T @ (weights_matrix.T @ weights_matrix @ self.residual(model))
return 2 * jac.T @ (weights_matrix.T @ weights_matrix @ self.residual(model))

def hessian(
self, model: Model
Expand Down Expand Up @@ -171,12 +171,12 @@ def residual(self, model: Model):

.. math::

\mathbf{r} = \mathbf{d} - \mathcal{F}(\mathbf{m})
\mathbf{r} = \mathcal{F}(\mathbf{m}) - \mathbf{d}

where :math:`\mathbf{d}` is the vector with observed data, :math:`\mathcal{F}`
is the forward model, and :math:`\mathbf{m}` is the model vector.
"""
return self.data - self.simulation(model)
return self.simulation(model) - self.data

@property
def weights(self) -> npt.NDArray[np.float64]:
Expand Down