Skip to content

Commit

Permalink
Release argmin v0.7.0 and argmin-math v0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-k committed Aug 28, 2022
1 parent ee64ebc commit d938278
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 4 deletions.
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## argmin-math [Unreleased]

## [argmin v0.7.0] and [argmin-math v0.2.0] 2022-08-28

### Added
- L1 regularization added to L-BFGS (also known as OWL-QN). L-BFGS now has more trait bounds, please consult the documentation if this causes problems. (#244, #248, #250, Thanks to @vbkaisetsu)

### Changed
- The `ArgminL1Norm` trait was added by @vbkaisetsu for the L1 regularization in L-BFGS. In order to make the L2 norm more consistent, the corresponding trait was renamed from `ArgminNorm` to `ArgminL2Norm` and the `norm` method was renamed to `l2_norm`. (#253, @stefan-k)

### Fixed
- Version 0.6 accidentially removed the possibility to deactivate the `ndarray-linalg` dependency in `argmin-math`. This leads to problems in downstream crates which do not need the functionality of `ndarray-linalg` and want to avoid linking angainst a BLAS. In this version, this functionality was added again. Please consult the documentation of `argmin-math` for details on the available backends and their configuration. (#243, #249, @stefan-k)
- Fixed type alias names in examples (#245, Thanks to @vbkaisetsu)
- Fixed a bug in dogleg method (#246, #247, @stefan-k, Thanks to @renato145 for reporting!)

## [argmin v0.6.0] and [argmin-math v0.1.0] 2022-08-09

This is a rather large release with many (breaking) changes.
Expand Down Expand Up @@ -167,6 +180,8 @@ This is a rather large release with many (breaking) changes.

For older versions please see the Git history.

[Unreleased]: https://github.com/argmin-rs/argmin/compare/v0.5.1...HEAD
[Unreleased]: https://github.com/argmin-rs/argmin/compare/v0.6.0...HEAD
[argmin v0.6.0]: https://github.com/argmin-rs/argmin/compare/v0.5.1...argmin_v0.6.0
[argmin-math v0.1.0]: https://github.com/argmin-rs/argmin/compare/v0.5.1...argmin_v0.6.0
[argmin v0.6.0]: https://github.com/argmin-rs/argmin/compare/v0.6.0...argmin_v0.7.0
[argmin-math v0.1.0]: https://github.com/argmin-rs/argmin/compare/v0.6.0...argmin_v0.7.0
2 changes: 1 addition & 1 deletion argmin-math/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "argmin-math"
version = "0.1.0"
version = "0.2.0"
authors = ["Stefan Kroboth <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions argmin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "argmin"
version = "0.6.0"
version = "0.7.0"
authors = ["Stefan Kroboth <[email protected]>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -22,7 +22,7 @@ num-traits = { version = "0.2" }
rand = { version = "0.8.5" }
rand_xoshiro = { version = "0.6.0" }
thiserror = "1.0"
argmin-math = { path = "../argmin-math", version = "0.1.0", default-features = false, features = ["primitives"] }
argmin-math = { path = "../argmin-math", version = "0.2", default-features = false, features = ["primitives"] }
# optional
bincode = { version = "1.3.3", optional = true }
ctrlc = { version = "3.1.2", optional = true }
Expand Down
62 changes: 62 additions & 0 deletions media/website/content/blog/version-v0.7.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
+++
title = "argmin 0.7.0 and argmin-math 0.2.0 released"
description = ""
date = 2022-08-28T00:00:00+00:00
updated = 2022-08-28T00:00:00+00:00
draft = true
template = "blog/page.html"

[taxonomies]
authors = ["Stefan Kroboth"]

[extra]
+++

> <b>argmin</b> offers a range of numerical optimization methods in Rust.
In the previous release I unfortunately accidentially removed the possibility to turn off building without the `ndarray-linalg` dependency when using the `ndarray` backend in argmin-math.
`ndarray-linalg` is essentially only needed for the matrix inverse, which only a few solvers require.
However, it links against a BLAS which can cause problems that are particularly frustrating when it is not even needed.

In this release, this possibility is added again.
Each `ndarray`-related feature now also comes with a `*-nolinalg*` version which turns off building `ndarray-linalg`.
Note that this will not implement `ArgminInv` for the `ndarray` backend and therefore certain solvers (for instance the Newton method) will not work with `ndarray` types.
More details can be found in the [argmin-math docs](https://docs.rs/argmin-math/).

I was unsure if this fix was a breaking change because of the way argmin depends on argmin-math, therefore I decided to go ahead and release version 0.7 of argmin and version 0.2 of argmin-math just to be safe.

This also gave me the chance to release other (some of them definitely breaking) changes which were made recently.

The change with the most impact was made by [@vbkaisetsu](https://github.com/vbkaisetsu) (Thanks!) who added [L1 regularization](L1-regularization) to L-BFGS (also known as OWL-QN).
This method can be enabled with the `with_l1_regularization` method of `LBFGS` which takes the non-negative L1 coefficient as input.

```rust
let solver = LBFGS::new(linesearch, 7).with_l1_regularization(1.0)?;
```

[@vbkaisetsu](https://github.com/vbkaisetsu) also provided an [example](https://github.com/argmin-rs/argmin/blob/main/argmin/examples/owl_qn.rs).

A minor downside of this addition is that the number of trait bounds on the types used in L-BFGS increased.
If you are using one of the default backends, this is unlikely to affect you though.

The OWL-QN implementation required changes and additions to `argmin-math`, for instance the traits `ArgminSignum` and `ArgminL1Norm`.

To make the already existing `ArgminNorm` trait (which computes the L2 norm) more consistent with `ArgminL1Norm`, I renamed it to `ArgminL2Norm`.

And while they were at it, [@vbkaisetsu](https://github.com/vbkaisetsu) also fixed wrong type alias names in some of the examples.

Shortly after releasing the previous version [@renato145](https://github.com/renato145) reported [a bug](https://github.com/argmin-rs/argmin/issues/246) in the `Dogleg` method which I fixed.
Thanks again for reporting!


Overall, updating argmin from 0.6 to 0.7 should be fairly straight forward in most cases.


<br>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<p align="center">
<a class="github-button" href="https://github.com/argmin-rs/argmin" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star argmin-rs/argmin on GitHub">Star</a>
<a class="github-button" href="https://github.com/argmin-rs/argmin/subscription" data-icon="octicon-eye" data-size="large" data-show-count="true" aria-label="Watch argmin-rs/argmin on GitHub">Watch</a>
<a class="github-button" href="https://github.com/argmin-rs/argmin/fork" data-icon="octicon-repo-forked" data-size="large" data-show-count="true" aria-label="Fork argmin-rs/argmin on GitHub">Fork</a>
<a class="github-button" href="https://github.com/sponsors/stefan-k" data-icon="octicon-heart" data-size="large" aria-label="Sponsor @stefan-k on GitHub">Sponsor</a>
</p>

0 comments on commit d938278

Please sign in to comment.