Skip to content

Commit

Permalink
typo + norm
Browse files Browse the repository at this point in the history
  • Loading branch information
FFroehlich committed Mar 10, 2021
1 parent a44c3ad commit 64c8f9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion fides/hessian_approximation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from typing import Optional
import numpy as np
from numpy.linalg import norm


class HessianApproximation:
Expand Down Expand Up @@ -76,7 +77,7 @@ def update(self, s, y):
d = z.T.dot(s)

# [NocedalWright2006] (6.26) reject if update degenerate
if np.abs(d) >= 1e-8 * np.norm(s) * np.norm():
if np.abs(d) >= 1e-8 * norm(s) * norm():
self._hess += np.outer(z, z.T)/d


Expand Down
3 changes: 2 additions & 1 deletion fides/minimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,8 @@ def check_continue(self) -> bool:
if self.delta < np.spacing(1):
self.exitflag = ExitFlag.DELTA_TOO_SMALL
self.logger.warning(
f'Stopping as trust region radius ({self.delta})is smaller '
f'Stopping as trust region radius {self.delta:.2E} is '
f'smaller '
'than machine precision.'
)
return False
Expand Down

0 comments on commit 64c8f9e

Please sign in to comment.