Skip to content

Commit

Permalink
Fides 0.7.0 (#42)
Browse files Browse the repository at this point in the history
* add hdf5 history writing

* bump version, remove history init

* simplify history

* allow restriction of iterative update schemes

* apply restriction to structured updates

* expand steps

* simplify & fix hdf5 export

* allow disabling curvature condition

* fix flake

* fixes update restriction

* Update test_hessian_approximation.py

* Update requirements.txt

* remove hess approx restriction

* implement hybridfraction method

* fixup

* fix neg eigenvalue handling

* fixup

* remove scaled gradient step, fix handling negative EV

* fixup

* fixup

* fix doc?

* Update hessian_approximation.py

* fix doc?

* fixup

* use eigenvalues from lstsq

* fix: lstsq only returns absolute ev values

* add more errors, less verbose default logging

* fix eigvals

* fix flake

* refactor refine to only be performed in subspace

* fix flake

* fix test

* fix flake

* fix refine step

* reduce logging output

* allow user to set start_id
  • Loading branch information
FFroehlich authored Nov 11, 2021
1 parent f481387 commit 31aba66
Show file tree
Hide file tree
Showing 11 changed files with 523 additions and 276 deletions.
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
sphinx>=1.4
numpy>=1.19.2
scipy>=1.5.2
h5py>=3.5.0
numpydoc>=0.6
nbsphinx>=0.5.1
recommonmark>=0.6.0
Expand Down
3 changes: 2 additions & 1 deletion fides/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# flake8: noqa
from .minimize import Optimizer
from .hessian_approximation import (
SR1, BFGS, DFP, FX, HybridFixed, GNSBFGS, BB, BG, Broyden, SSM, TSSM
SR1, BFGS, DFP, FX, HybridFixed, HybridFraction, GNSBFGS, BB, BG, Broyden,
SSM, TSSM
)
from .logging import create_logger
from .version import __version__
Expand Down
18 changes: 8 additions & 10 deletions fides/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ class Options(str, enum.Enum):
STEPBACK_STRAT = 'stepback_strategy' #: method to use for stepback
THETA_MAX = 'theta_max' #: maximal fraction of step that would hit bounds
DELTA_INIT = 'delta_init' #: initial trust region radius
MU = 'mu' # acceptance threshold for trust region ratio
ETA = 'eta' # trust region increase threshold for trust region ratio
GAMMA1 = 'gamma1' # factor by which trust region radius will be decreased
GAMMA2 = 'gamma2' # factor by which trust region radius will be increased
REFINE_STEPBACK = 'refine_stepback' # whether stepbacks are refined via
# optimization
SCALED_GRADIENT = 'scaled_gradient' # whether scaled gradient should be
# added to the set of possible stepback proposals
MU = 'mu' #: acceptance threshold for trust region ratio
ETA = 'eta' #: trust region increase threshold for trust region ratio
GAMMA1 = 'gamma1' #: factor by which trust region radius will be decreased
GAMMA2 = 'gamma2' #: factor by which trust region radius will be increased
HISTORY_FILE = 'history_file' #: when set, statistics for each start will
# be saved to the specified file


class SubSpaceDim(str, enum.Enum):
Expand All @@ -55,6 +53,7 @@ class StepBackStrategy(str, enum.Enum):
TRUNCATE = 'truncate' #: truncate step at boundary and re-solve
# restricted subproblem
MIXED = 'mixed' #: mix reflections and truncations
REFINE = 'refine' #: perform optimization to refine step


DEFAULT_OPTIONS = {
Expand All @@ -73,8 +72,7 @@ class StepBackStrategy(str, enum.Enum):
Options.ETA: 0.75, # [NodedalWright2006]
Options.GAMMA1: 1/4, # [NodedalWright2006]
Options.GAMMA2: 2, # [NodedalWright2006]
Options.REFINE_STEPBACK: False,
Options.SCALED_GRADIENT: False,
Options.HISTORY_FILE: None,
}


Expand Down
Loading

0 comments on commit 31aba66

Please sign in to comment.