Skip to content

Commit f8c2404

Browse files
Upgrade ensmallen to 2.16.2 (#43)
* Upgrade ensmallen to 2.16.2 * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: coatless <[email protected]>
1 parent c1777cf commit f8c2404

34 files changed

+501
-325
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2021-03-26 James Balamuta <[email protected]>
2+
3+
* DESCRIPTION (Version): Release 2.16.2
4+
* NEWS.md: Update for Ensmallen release 2.16.2
5+
* inst/include/ensmallen_bits: Upgraded to Ensmallen 2.16.2
6+
* inst/include/ensmallen.hpp: ditto
7+
18
2021-03-05 James Balamuta <[email protected]>
29

310
* DESCRIPTION (Version): Release 2.16.1

DESCRIPTION

Lines changed: 1 addition & 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.16.1.1
3+
Version: 0.2.16.2.1
44
Authors@R: c(
55
person("James Joseph", "Balamuta", email = "[email protected]",
66
role = c("aut", "cre", "cph"),

NEWS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# RcppEnsmallen 0.2.16.2.1 (GitHub-only Release)
2+
3+
- Upgraded to ensmallen 2.16.2: "Severely Dented Can Of Polyurethane" (2021-03-25)
4+
- Fix CNE test trials
5+
([#267](https://github.com/mlpack/ensmallen/pull/267)).
6+
- Update Catch2 to 2.13.4
7+
([#268](https://github.com/mlpack/ensmallen/pull/268)).
8+
- Fix typos in documentation
9+
([#270](https://github.com/mlpack/ensmallen/pull/270),
10+
[#271](https://github.com/mlpack/ensmallen/pull/271)).
11+
- Add clarifying comments in problems/ implementations
12+
([#276](https://github.com/mlpack/ensmallen/pull/276)).
13+
- Remove `AdamSchafferFunctionN2Test` test from Adam test suite to prevent
14+
spurious issue on some aarch64 ([#265](https://github.com/mlpack/ensmallen/pull/259)).
115
# RcppEnsmallen 0.2.16.1.1
216

317
- Upgraded to ensmallen 2.16.1: "Severely Dented Can Of Polyurethane" (2021-03-04)

inst/include/ensmallen_bits/ens_version.hpp

Lines changed: 2 additions & 2 deletions
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 16
19-
#define ENS_VERSION_PATCH 1
19+
#define ENS_VERSION_PATCH 2
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
@@ -25,7 +25,7 @@
2525
// Incorporate the date the version was released.
2626
#define ENS_VERSION_YEAR "2021"
2727
#define ENS_VERSION_MONTH "03"
28-
#define ENS_VERSION_DAY "02"
28+
#define ENS_VERSION_DAY "24"
2929

3030
namespace ens {
3131

inst/include/ensmallen_bits/nsga2/nsga2_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ typename MatType::elem_type NSGA2::Optimize(
7575
if (lowerBound.n_rows == 1)
7676
lowerBound = lowerBound(0, 0) * arma::ones(iterate.n_rows, iterate.n_cols);
7777

78-
// Check if lower bound is a vector of a single dimension.
78+
// Check if upper bound is a vector of a single dimension.
7979
if (upperBound.n_rows == 1)
8080
upperBound = upperBound(0, 0) * arma::ones(iterate.n_rows, iterate.n_cols);
8181

inst/include/ensmallen_bits/problems/ackley_function.hpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,6 @@ class AckleyFunction
5959
//! Return 1 (the number of functions).
6060
size_t NumFunctions() const { return 1; }
6161

62-
//! Get the starting point.
63-
template<typename MatType = arma::mat>
64-
MatType GetInitialPoint() const { return MatType("0.02; 0.02"); }
65-
66-
//! Get the final point.
67-
template<typename MatType = arma::mat>
68-
MatType GetFinalPoint() const { return MatType("0.0; 0.0"); }
69-
70-
//! Get the final objective.
71-
double GetFinalObjective() const { return 0.0; }
72-
7362
/**
7463
* Evaluate a function for a particular batch-size.
7564
*
@@ -123,6 +112,22 @@ class AckleyFunction
123112
//! Modify the value used for numerical stability.
124113
double& Epsilon() { return epsilon; }
125114

115+
// Note: GetInitialPoint(), GetFinalPoint(), and GetFinalObjective() are not
116+
// required for using ensmallen to optimize this function! They are
117+
// specifically used as a convenience just for ensmallen's testing
118+
// infrastructure.
119+
120+
//! Get the starting point.
121+
template<typename MatType = arma::mat>
122+
MatType GetInitialPoint() const { return MatType("0.02; 0.02"); }
123+
124+
//! Get the final point.
125+
template<typename MatType = arma::mat>
126+
MatType GetFinalPoint() const { return MatType("0.0; 0.0"); }
127+
128+
//! Get the final objective.
129+
double GetFinalObjective() const { return 0.0; }
130+
126131
private:
127132
//! The value of the multiplicative constant.
128133
double c;

inst/include/ensmallen_bits/problems/beale_function.hpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,6 @@ class BealeFunction
5252
//! Return 1 (the number of functions).
5353
size_t NumFunctions() const { return 1; }
5454

55-
//! Get the starting point.
56-
template<typename MatType = arma::mat>
57-
MatType GetInitialPoint() const { return MatType("2.8; 0.35"); }
58-
59-
//! Get the final point.
60-
template<typename MatType = arma::mat>
61-
MatType GetFinalPoint() const { return MatType("3.0; 0.5"); }
62-
63-
//! Get the final objective.
64-
double GetFinalObjective() const { return 0.0; }
65-
6655
/**
6756
* Evaluate a function for a particular batch-size.
6857
*
@@ -105,6 +94,22 @@ class BealeFunction
10594
*/
10695
template<typename MatType, typename GradType>
10796
void Gradient(const MatType& coordinates, GradType& gradient);
97+
98+
// Note: GetInitialPoint(), GetFinalPoint(), and GetFinalObjective() are not
99+
// required for using ensmallen to optimize this function! They are
100+
// specifically used as a convenience just for ensmallen's testing
101+
// infrastructure.
102+
103+
//! Get the starting point.
104+
template<typename MatType = arma::mat>
105+
MatType GetInitialPoint() const { return MatType("2.8; 0.35"); }
106+
107+
//! Get the final point.
108+
template<typename MatType = arma::mat>
109+
MatType GetFinalPoint() const { return MatType("3.0; 0.5"); }
110+
111+
//! Get the final objective.
112+
double GetFinalObjective() const { return 0.0; }
108113
};
109114

110115
} // namespace test

inst/include/ensmallen_bits/problems/booth_function.hpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,6 @@ class BoothFunction
5252
//! Return 1 (the number of functions).
5353
size_t NumFunctions() const { return 1; }
5454

55-
//! Get the starting point.
56-
template<typename MatType = arma::mat>
57-
MatType GetInitialPoint() const { return MatType("-9; -9"); }
58-
59-
//! Get the final point.
60-
template<typename MatType = arma::mat>
61-
MatType GetFinalPoint() const { return MatType("1.0; 3.0"); }
62-
63-
//! Get the final objective.
64-
double GetFinalObjective() const { return 0.0; }
65-
6655
/**
6756
* Evaluate a function for a particular batch-size.
6857
*
@@ -105,6 +94,22 @@ class BoothFunction
10594
*/
10695
template<typename MatType, typename GradType>
10796
void Gradient(const MatType& coordinates, GradType& gradient);
97+
98+
// Note: GetInitialPoint(), GetFinalPoint(), and GetFinalObjective() are not
99+
// required for using ensmallen to optimize this function! They are
100+
// specifically used as a convenience just for ensmallen's testing
101+
// infrastructure.
102+
103+
//! Get the starting point.
104+
template<typename MatType = arma::mat>
105+
MatType GetInitialPoint() const { return MatType("-9; -9"); }
106+
107+
//! Get the final point.
108+
template<typename MatType = arma::mat>
109+
MatType GetFinalPoint() const { return MatType("1.0; 3.0"); }
110+
111+
//! Get the final objective.
112+
double GetFinalObjective() const { return 0.0; }
108113
};
109114

110115
} // namespace test

inst/include/ensmallen_bits/problems/bukin_function.hpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@ class BukinFunction
5757
//! Return 1 (the number of functions).
5858
size_t NumFunctions() const { return 1; }
5959

60-
//! Get the starting point.
61-
template<typename MatType = arma::mat>
62-
MatType GetInitialPoint() const { return MatType("-10; -2.0"); }
63-
64-
//! Get the final point.
65-
template<typename MatType = arma::mat>
66-
MatType GetFinalPoint() const { return MatType("-10.0; 1.0"); }
67-
68-
//! Get the final objective.
69-
double GetFinalObjective() const { return 0.0; }
70-
7160
/**
7261
* Evaluate a function for a particular batch-size.
7362
*
@@ -116,6 +105,22 @@ class BukinFunction
116105
//! Modify the value used for numerical stability.
117106
double& Epsilon() { return epsilon; }
118107

108+
// Note: GetInitialPoint(), GetFinalPoint(), and GetFinalObjective() are not
109+
// required for using ensmallen to optimize this function! They are
110+
// specifically used as a convenience just for ensmallen's testing
111+
// infrastructure.
112+
113+
//! Get the starting point.
114+
template<typename MatType = arma::mat>
115+
MatType GetInitialPoint() const { return MatType("-10; -2.0"); }
116+
117+
//! Get the final point.
118+
template<typename MatType = arma::mat>
119+
MatType GetFinalPoint() const { return MatType("-10.0; 1.0"); }
120+
121+
//! Get the final objective.
122+
double GetFinalObjective() const { return 0.0; }
123+
119124
private:
120125
//! The value used for numerical stability.
121126
double epsilon;

inst/include/ensmallen_bits/problems/colville_function.hpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,6 @@ class ColvilleFunction
5353
//! Return 1 (the number of functions).
5454
size_t NumFunctions() const { return 1; }
5555

56-
//! Get the starting point.
57-
template<typename MatType = arma::mat>
58-
MatType GetInitialPoint() const { return MatType("-5; 3; 1; -9"); }
59-
60-
//! Get the final point.
61-
template<typename MatType = arma::mat>
62-
MatType GetFinalPoint() const { return MatType("1; 1; 1; 1"); }
63-
64-
//! Get the final objective.
65-
double GetFinalObjective() const { return 0.0; }
66-
6756
/**
6857
* Evaluate a function for a particular batch-size.
6958
*
@@ -106,6 +95,22 @@ class ColvilleFunction
10695
*/
10796
template<typename MatType, typename GradType>
10897
void Gradient(const MatType& coordinates, GradType& gradient) const;
98+
99+
// Note: GetInitialPoint(), GetFinalPoint(), and GetFinalObjective() are not
100+
// required for using ensmallen to optimize this function! They are
101+
// specifically used as a convenience just for ensmallen's testing
102+
// infrastructure.
103+
104+
//! Get the starting point.
105+
template<typename MatType = arma::mat>
106+
MatType GetInitialPoint() const { return MatType("-5; 3; 1; -9"); }
107+
108+
//! Get the final point.
109+
template<typename MatType = arma::mat>
110+
MatType GetFinalPoint() const { return MatType("1; 1; 1; 1"); }
111+
112+
//! Get the final objective.
113+
double GetFinalObjective() const { return 0.0; }
109114
};
110115

111116
} // namespace test

0 commit comments

Comments
 (0)