Skip to content

Commit

Permalink
lints and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
KGrewal1 committed Jan 7, 2024
1 parent c6f22cf commit 054735f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.3.2 (2024-01-02)

* move directional evaluation into stronge wolfe
* fix strong wolfe condition when used with weight decay

## v0.3.1 (2023-12-20)

* Improved Documentation
Expand Down
8 changes: 4 additions & 4 deletions src/lbfgs/strong_wolfe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,11 @@ impl<M: Model> Lbfgs<M> {
.vars
.iter()
.map(|v| -> CResult<f64> {
Ok(v.as_tensor()
v.as_tensor()
.sqr()?
.sum_all()?
.to_dtype(candle_core::DType::F64)?
.to_scalar::<f64>()?)
.to_scalar::<f64>()
})
.sum::<CResult<f64>>()?
} else {
Expand All @@ -429,11 +429,11 @@ impl<M: Model> Lbfgs<M> {
.vars
.iter()
.map(|v| -> CResult<f64> {
Ok(v.as_tensor()
v.as_tensor()
.sqr()?
.sum_all()?
.to_dtype(candle_core::DType::F64)?
.to_scalar::<f64>()?)
.to_scalar::<f64>()
})
.sum::<CResult<f64>>()?)
} else {
Expand Down

0 comments on commit 054735f

Please sign in to comment.