Skip to content

Commit

Permalink
Remove simopt optimizers.
Browse files Browse the repository at this point in the history
  • Loading branch information
janosg committed Jul 10, 2024
1 parent 8e493f6 commit 2191fd4
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 512 deletions.
1 change: 0 additions & 1 deletion .envs/testenv-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies:
- Py-BOBYQA # dev, tests
- fides==0.7.4 # dev, tests
- kaleido # dev, tests
- simoptlib==1.0.1 # dev, tests
- pandas-stubs # dev, tests
- types-cffi # dev, tests
- types-openpyxl # dev, tests
Expand Down
1 change: 0 additions & 1 deletion .envs/testenv-others.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ dependencies:
- Py-BOBYQA # dev, tests
- fides==0.7.4 # dev, tests
- kaleido # dev, tests
- simoptlib==1.0.1 # dev, tests
- pandas-stubs # dev, tests
- types-cffi # dev, tests
- types-openpyxl # dev, tests
Expand Down
1 change: 0 additions & 1 deletion .envs/testenv-pandas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ dependencies:
- Py-BOBYQA # dev, tests
- fides==0.7.4 # dev, tests
- kaleido # dev, tests
- simoptlib==1.0.1 # dev, tests
- types-cffi # dev, tests
- types-openpyxl # dev, tests
- -e ../
18 changes: 17 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,23 @@ chronological order. We follow [semantic versioning](https://semver.org/) and al
releases are available on [Anaconda.org](https://anaconda.org/OpenSourceEconomics/estimagic).

Following the [scientific python guidelines](https://scientific-python.org/specs/spec-0000/)
we drop the official support for Python 3.8.
we drop the official support for Python 3.9.


## 0.5.0

This is a major release with several breaking changes and deprecations. On a high level,
the major changes are:

- Implement EP-02: Static typing
- Implement EP-03: Alignment with SciPy
- Rename the package from `estimagic` to `optimagic` (while keeping the `estimagic`
namespace for the estimation capabilities).

### Breaking changes

- {gh}`500` removes the dashboard, the support for simopt optimizers and the
`derivative_plot` ({ghuser}`janosg`)


## 0.4.6
Expand Down
128 changes: 0 additions & 128 deletions docs/source/algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -3894,134 +3894,6 @@ addition to estimagic when using an NLOPT algorithm. To install nlopt run
10 * (number of parameters + 1).
```

## The SimOpt Optimizers (simopt)

estimagic supports the following [SimOpt](https://github.com/simopt-admin/simopt)
algorithms. Please add the
[appropriate citations](https://github.com/simopt-admin/simopt) in addition to estimagic
when using a SimOpt algorithm. To install simopt run `pip install simoptlib==1.0.1`.

```{eval-rst}
.. dropdown:: simopt_adam
.. code-block::
"simopt_adam"
Minimize a scalar function using the ADAM algorithm from SimOpt.
- **stopping_max_iterations** (int): If the maximum number of iterations is reached,
the optimization stops, but we do not count this as convergence.
- **crn_across_solns** (bool): Use CRN across solutions? Default True.
- **r** (int): Number of replications taken at each solution. Default 1.
- **beta_1** (float): Exponential decay of the rate for the first moment estimates.
Default 0.9.
- **beta_2** (float): Exponential decay rate for the second-moment estimates.
Default 0.999.
- **alpha** (float): Step size. Default 1.0.
- **epsilon** (float): A small value to prevent zero-division. Default 10e-8.
- **sensitivity** (float): Shrinking scale for variable bounds. Default 10e-7.
```

```{eval-rst}
.. dropdown:: simopt_astrodf
.. code-block::
"simopt_astrodf"
Minimize a scalar function using the ASTRODF algorithm from SimOpt.
- **stopping_max_iterations** (int): If the maximum number of iterations is reached,
the optimization stops, but we do not count this as convergence.
- **bounds_padding** (float): Subtract (add) this value of the bounds which will be
used by ASTRODF internally. Default 1e-8.
- **crn_across_solns** (bool): Use CRN across solutions? Default True.
- **delta_max** (float): Maximum value of the trust-region radius. Default 50.0
- **eta_1** (float): Threshhold for a successful iteration. Default 0.1.
- **eta_2** (float): Threshhold for a very successful iteration. Default 0.5.
- **gamma_1** (float): Very successful step trust-region radius increase. Default
2.0.
- **gamma_2** (float): Unsuccessful step trust-region radius decrease. Default 0.5.
- **w** (float): Trust-region radius rate of shrinkage in contracation loop. Default
0.85.
- **mu** (int): Trust-region radius ratio upper bound in contraction loop. Default
1000.
- **beta** (int): Trust-region radius ratio lower bound in contraction loop. Default
10.
- **lambda_min** (int): Minimum sample size value. Default 8.
- **simple_solve** (bool): Solve subproblem with Cauchy point (rough approximate)?
Default False.
- **criticality_select** (bool): Skip contraction loop if not near critical
region? Default True.
- **criticality_threshold** (float): Threshold on gradient norm indicating
near-critical region. Default 0.1.
.. note::
To get more accurate results in the case of bounds we revert the subtraction of
a large value from the bounds that is done internally in simopt.
Since the algorithm is numerically instable in the case of binding bounds
without this substraction, we subtract a (small) value defined by
``bounds_padding``. See the ASTRODF `source code
<https://tinyurl.com/5fxcvw2k>`_ for details.
```

```{eval-rst}
.. dropdown:: simopt_spsa
.. code-block::
"simopt_spsa"
Minimize a scalar function using the SPSA algorithm from SimOpt.
- **stopping_max_iterations** (int): If the maximum number of iterations is reached,
the optimization stops, but we do not count this as convergence.
- **crn_across_solns** (bool): Use CRN across solutions? Default True.
- **alpha** (float): Non-negative coefficient in the SPSA gain sequecence ak.
Default 0.602.
- **gamma** (float): Non-negative coefficient in the SPSA gain sequence ck. Default
0.101.
- **step** (float): Initial desired magnitude of change in the theta elements.
Default 0.5.
- **gavg** (int): Averaged SP gradients used per iteration. Default 1.
- **n_reps** (int): Number of replications takes at each solution. Default 2.
- **n_loss** (int): Number of loss function evaluations used in this gain
calculation. Default 2.
- **eval_pct** (float): Percentage of the expected number of loss evaluations per
run. Default 2/3.
- **iter_pct** (float): Percentage of the maximum expected number of iterations.
Default 0.1.
```

```{eval-rst}
.. dropdown:: simopt_strong
.. code-block::
"simopt_strong"
Minimize a scalar function using the STRONG algorithm from SimOpt.
- **stopping_max_iterations** (int): If the maximum number of iterations is reached,
the optimization stops, but we do not count this as convergence.
- **crn_across_solns** (bool): Use CRN across solutions? Default True.
- **n0** (int): Initial sample size Default 10.
- **n_r** (int): Number of replications taken at each solution. Default 1.
- **sensitivity** (float): Shrinking scale for VarBds. Default 10e-7.
- **delta_threshold** (float): Maximum value of the radius. Default 1.2.
- **delta_T** (float): Initial size of trust region. Default 2.0.
- **eta_0** (float): Constant for accepting. Default 0.01.
- **eta_1** (float): Constant for more confident accepting. Default 0.3.
- **gamma_1** (float): Constant for shrinking the trust region. Default 0.9.
- **gamma_2** (float): Constant for expanding the trust region. Default 1.11.
- **lambda** (int): Magnifying factor for n_r inside the finite difference function.
Default 2.
- **lambda_2** (float): Magnifying factor for n_r in stage I and stage II. Default
1.01.
```

## References

```{eval-rst}
Expand Down
1 change: 0 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ dependencies:
- gif[matplotlib] # dev
- kaleido # dev, tests
- pre-commit # dev
- simoptlib==1.0.1 # dev, tests
- -e . # dev
# type stubs
- pandas-stubs # dev, tests
Expand Down
4 changes: 0 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ module = [
"estimagic.optimization.process_results",
"estimagic.optimization.pygmo_optimizers",
"estimagic.optimization.scipy_optimizers",
"estimagic.optimization.simopt_optimizers",
"estimagic.optimization.tao_optimizers",
"estimagic.optimization.tiktak",
"estimagic.optimization.tranquilo",
Expand Down Expand Up @@ -280,9 +279,6 @@ module = [
"bokeh.command",
"bokeh.command.util",
"fides",
"simopt",
"simopt.base",
"simopt.experiment_base",
"petsc4py",
"tranquilo",
"tranquilo.tranquilo",
Expand Down
2 changes: 0 additions & 2 deletions src/estimagic/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
pounders,
pygmo_optimizers,
scipy_optimizers,
simopt_optimizers,
tao_optimizers,
tranquilo,
)
Expand All @@ -22,7 +21,6 @@
nlopt_optimizers,
pygmo_optimizers,
scipy_optimizers,
simopt_optimizers,
tao_optimizers,
bhhh,
neldermead,
Expand Down
7 changes: 0 additions & 7 deletions src/estimagic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,6 @@
else:
IS_JAX_INSTALLED = True

try:
import simopt # noqa: F401
except ImportError:
IS_SIMOPT_INSTALLED = False
else:
IS_SIMOPT_INSTALLED = True


try:
import tranquilo # noqa: F401
Expand Down
Loading

0 comments on commit 2191fd4

Please sign in to comment.