Skip to content

Commit

Permalink
Fides 0.6.1 (#39)
Browse files Browse the repository at this point in the history
* fix nan values in hessian

* version bump

* add reference, fixes #36

* fix flake

* update for 3.10

* fix 3.10

* update readme

* wait with 3.10 until scipy gets it shit together

* don't bump requirement just yet
  • Loading branch information
FFroehlich authored Oct 8, 2021
1 parent 9b84343 commit acae89a
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9']

steps:

Expand Down
28 changes: 28 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Froehlich"
given-names: "Fabian"
orcid: "https://orcid.org/0000-0003-2387-9495"
- family-names: "Weindl"
given-names: "Daniel"
orcid: "https://orcid.org/0000-0001-9963-6057"
title: "Fides"
version: 0.6.0
doi: 10.5281/zenodo.5554996
date-released: 2021-10-07
url: "https://github.com/fides/fides"
preferred-citation:
type: article
authors:
- family-names: "Froehlich"
given-names: "Fabian"
orcid: "https://orcid.org/0000-0003-2387-9495"
- family-names: "Sorger"
given-names: "Peter K."
orcid: "https://orcid.org/0000-0002-3364-1838"
doi: "10.1101/2021.05.20.4450650"
journal: "bioRxiv"
month: 5
title: "Fides: Reliable Trust-Region Optimization for Parameter Estimation of Ordinary Differential Equation Models"
year: 2021
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ Fides can be installed via `pip install fides`. Further documentation is
## Features


* Boundary constrained interior trust-region optimization
* Boundary constrained and unconstrained interior trust-region optimization
* Reflective, truncated and optimization based boundary heuristics
* Exact, 2D and CG subproblem solvers
* BFGS, DFP, SR1 and Hybrid Hessian Approximations
* BFGS, DFP, SR1, PSB, Broyden (good and bad) and Broyden class iterative
Hessian Approximation schemes
* SSM, TSSM, FX, GNSBFGS and custom hybrid Hessian Approximations schemes

2 changes: 1 addition & 1 deletion fides/hessian_approximation.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def broyden_class_update(y, s, mat, phi=None, v=None):
return np.outer(y, y.T) / b - np.outer(u, u.T) / c

if v is None:
rho = np.sqrt(b / c)
rho = np.sqrt(b / c) if c > 0 else 0 # c == 0 iff u == 0
v = y + (1-phi) * rho * u

z = y - mat.dot(s)
Expand Down
9 changes: 7 additions & 2 deletions fides/minimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ def minimize(self, x0: np.ndarray):
theta = max(self.get_option(Options.THETA_MAX),
1 - norm(v * self.grad, np.inf))

self.check_finite()

step = \
trust_region(
self.x, self.grad, self.hess, scaling,
Expand Down Expand Up @@ -667,7 +669,7 @@ def log_header(self):
f'| step | refl | trun | accept'
)

def check_finite(self, funout: Funout):
def check_finite(self, funout: Optional[Funout] = None):
"""
Checks whether objective function value, gradient and Hessian (
approximation) have finite values and optimization can continue.
Expand All @@ -684,7 +686,10 @@ def check_finite(self, funout: Funout):
else:
pointstr = f'at iteration {self.iteration}.'

fval, grad, hess = funout.fval, funout.grad, funout.hess
if funout is not None:
fval, grad, hess = funout.fval, funout.grad, funout.hess
else:
fval, grad, hess = self.fval, self.grad, self.hess

if not np.isfinite(fval):
self.exitflag = ExitFlag.NOT_FINITE
Expand Down
8 changes: 4 additions & 4 deletions fides/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ def __init__(self, x, sg, hess, scaling, g_dscaling, delta, theta,

class CGStep(Step):
"""
This class provides the machinery to compute an approximate solution of
the trust region subproblem using the Steihaug Method
"""
This class provides the machinery to compute an approximate solution of
the trust region subproblem using the conjugate gradients methods
"""

type = 'cg'

Expand All @@ -310,7 +310,7 @@ def conj_grad(self, eps):
class TRStepSteihaug(CGStep):
"""
This class provides the machinery to compute an approximate solution of
the trust region subproblem using the Steihaug Method
the trust region subproblem using Steihaug's Method
"""

type = 'cgs'
Expand Down
2 changes: 1 addition & 1 deletion fides/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.6.0"
__version__ = "0.6.1"

0 comments on commit acae89a

Please sign in to comment.