Skip to content

Commit 1fa380a

Browse files
authored
Upgrade ensmallen to 2 10 3 (#16)
* Update ensmallen to 2.10.2 * Update news entry * Bump version * Upgrade to ensmallen 2.10.3 * Bump version and add vignette setup * Update news with new entries. * Block doc * Add a vignette * Add a ChangeLog entry * Suppress building vignettes on TravisCI * Remove empty space * Better prose * Add a vignette trick * Remove -I * Add ChangeLog
1 parent 8c9dd4b commit 1fa380a

File tree

14 files changed

+271
-11
lines changed

14 files changed

+271
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
src/*.o
77
src/*.so
88
src/*.dll
9+
inst/doc

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ cache: packages
1313
env:
1414
global:
1515
- MAKEFLAGS="-j 2"
16+
- R_BUILD_ARGS="--no-build-vignettes"
17+
- R_CHECK_ARGS="--no-build-vignettes"
1618
- _R_CHECK_FORCE_SUGGESTS=0
1719

1820
# Enable a build matrix that individually tests the package against the

ChangeLog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
2019-09-30 James Balamuta <[email protected]>
2+
3+
* vignettes/using-rcppensmallen.Rmd: Improved wording.
4+
5+
* .travis.yml: Disabled vignette building on TravisCI
6+
7+
2019-09-27 James Balamuta <[email protected]>
8+
9+
* DESCRIPTION (Version, Date): Release 2.10.3
10+
11+
* NEWS.md: Update for Ensmallen release 2.10.3
12+
13+
* inst/include/ensmallen_bits: Upgraded to Ensmallen 2.10.3
14+
* inst/include/ensmallen.hpp: ditto
15+
16+
* vignettes/using-rcppensmallen.Rmd: Added a vignette describing use.
17+
118
2019-09-07 James Balamuta <[email protected]>
219

320
* DESCRIPTION (Version, Date): Release 2.10.0 and armadillo dependency

DESCRIPTION

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: RcppEnsmallen
22
Title: Header-Only C++ Mathematical Optimization Library for 'Armadillo'
3-
Version: 0.2.10.0.2
3+
Version: 0.2.10.3.1
44
Authors@R: c(
55
person("James Joseph", "Balamuta", email = "[email protected]",
66
role = c("aut", "cre", "cph"),
@@ -34,3 +34,7 @@ Imports: Rcpp
3434
RoxygenNote: 6.1.1
3535
Roxygen: list(markdown = TRUE)
3636
SystemRequirements: C++11
37+
Suggests:
38+
knitr,
39+
rmarkdown
40+
VignetteBuilder: knitr

NEWS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# RcppEnsmallen 0.2.10.3.1
2+
3+
- Upgraded to ensmallen 2.10.3: "Fried Chicken" (2019-09-26)
4+
- Add release script to rel/ for maintainers
5+
([#128](https://github.com/mlpack/ensmallen/pull/128)).
6+
- Fix Armadillo version check
7+
([#133](https://github.com/mlpack/ensmallen/pull/133)).
8+
- Documentation fix for callbacks
9+
([#129](https://github.com/mlpack/ensmallen/pull/129).
10+
- Compatibility fixes for ensmallen 1.x
11+
([#131](https://github.com/mlpack/ensmallen/pull/131)).
12+
- Fix ParallelSGD runtime bug.
13+
([#135](https://github.com/mlpack/ensmallen/pull/135)).
14+
- Add additional L-BFGS convergence check
15+
([#136](https://github.com/mlpack/ensmallen/pull/136)).
16+
- Added vignette with worked example for linear regression and for package
17+
inclusion.
18+
119
# RcppEnsmallen 0.2.10.0.1
220

321
- Upgraded to ensmallen 2.10.0: "Fried Chicken" (2019-09-07)

inst/include/ensmallen.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
#error "please enable C++11/C++14 mode in your compiler"
3030
#endif
3131

32-
#if ((ARMA_VERSION_MAJOR < 6) || ((ARMA_VERSION_MAJOR == 6) && (ARMA_VERSION_MINOR < 500)))
33-
#error "need Armadillo version 6.500 or later"
32+
#if ((ARMA_VERSION_MAJOR < 8) || ((ARMA_VERSION_MAJOR == 8) && (ARMA_VERSION_MINOR < 400)))
33+
#error "need Armadillo version 8.400 or later"
3434
#endif
3535

3636
#include <cmath>

inst/include/ensmallen_bits/config.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@
4747
#define ENS_PRAGMA_OMP_PARALLEL _Pragma("omp parallel")
4848
#define ENS_PRAGMA_OMP_ATOMIC _Pragma("omp atomic")
4949
#define ENS_PRAGMA_OMP_CRITICAL _Pragma("omp critical")
50+
#define ENS_PRAGMA_OMP_CRITICAL_NAMED _Pragma("omp critical(section)")
5051
#else
5152
#define ENS_PRAGMA_OMP_PARALLEL
5253
#define ENS_PRAGMA_OMP_ATOMIC
5354
#define ENS_PRAGMA_OMP_CRITICAL
55+
#define ENS_PRAGMA_OMP_CRITICAL_NAMED
5456
#endif
5557

5658

inst/include/ensmallen_bits/ens_version.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// The minor version is two digits so regular numerical comparisons of versions
1717
// work right. The first minor version of a release is always 10.
1818
#define ENS_VERSION_MINOR 10
19-
#define ENS_VERSION_PATCH 0
19+
#define ENS_VERSION_PATCH 3
2020
// If this is a release candidate, it will be reflected in the version name
2121
// (i.e. the version name will be "RC1", "RC2", etc.). Otherwise the version
2222
// name will typically be a seemingly arbitrary set of words that does not

inst/include/ensmallen_bits/function/arma_traits.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct MatTypeTraits<arma::Col<eT>>
3030
template<typename eT>
3131
struct MatTypeTraits<arma::Row<eT>>
3232
{
33-
typedef arma::Row<eT> BaseMatType;
33+
typedef arma::Mat<eT> BaseMatType;
3434
};
3535

3636
template<typename eT>

inst/include/ensmallen_bits/lbfgs/lbfgs_impl.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,12 @@ L_BFGS::Optimize(FunctionType& function,
409409

410410
// Choose the scaling factor.
411411
double scalingFactor = ChooseScalingFactor(itNum, gradient, s, y);
412+
if (scalingFactor == 0.0)
413+
{
414+
Info << "L-BFGS scaling factor computed as 0 (terminating successfully)."
415+
<< std::endl;
416+
break;
417+
}
412418

413419
// Build an approximation to the Hessian and choose the search
414420
// direction for the current iteration.

0 commit comments

Comments
 (0)