Skip to content

Commit 0ba1a61

Browse files
authored
Upgrade Ensmallen to 1.11.1 (#6)
* Ensmallen 1.11.1 release... * Update package documentation... * Update news. * Avoid including a CRAN-RELEASE file in package build.
1 parent 4105be0 commit 0ba1a61

File tree

15 files changed

+286
-47
lines changed

15 files changed

+286
-47
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
^CRAN-RELEASE$
12
^.*\.Rproj$
23
^\.Rproj\.user$
34
^\.travis\.yml$

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

NEWS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
# RcppEnsmallen 0.1.11.1.1
2+
3+
- Upgraded to ensmallen release 1.11.1 "Jet Lag" (2018-11-28)
4+
- Minor documentation fixes.
5+
- Add WNGrad optimizer.
6+
- Fix header name in documentation samples.
7+
- Added citation information
8+
19
# RcppEnsmallen 0.1.10.0.1
210

311
## New
412

513
- Support for compiling via _R_ the mathematical optimizers in the _C++_
614
[ensmallen](http://ensmallen.org/docs.html) library.
15+
- Includes ensmallen release 1.10.0 "Corporate Catabolism" (2018-10-19)
716

817
## Special Thanks
918

inst/include/ensmallen.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161

6262
#include "ensmallen_bits/problems/problems.hpp" // TODO: should move to another place
6363

64-
// TODO: remove mlpack bits from each of these files
6564
#include "ensmallen_bits/ada_delta/ada_delta.hpp"
6665
#include "ensmallen_bits/ada_grad/ada_grad.hpp"
6766
#include "ensmallen_bits/adam/adam.hpp"
@@ -74,7 +73,7 @@
7473

7574
#include "ensmallen_bits/fw/frank_wolfe.hpp"
7675
#include "ensmallen_bits/gradient_descent/gradient_descent.hpp"
77-
// #include "ensmallen_bits/grid_search/grid_search.hpp"
76+
#include "ensmallen_bits/grid_search/grid_search.hpp"
7877
#include "ensmallen_bits/iqn/iqn.hpp"
7978
#include "ensmallen_bits/katyusha/katyusha.hpp"
8079
#include "ensmallen_bits/lbfgs/lbfgs.hpp"
@@ -99,5 +98,6 @@
9998
#include "ensmallen_bits/smorms3/smorms3.hpp"
10099
#include "ensmallen_bits/spalera_sgd/spalera_sgd.hpp"
101100
#include "ensmallen_bits/svrg/svrg.hpp"
101+
#include "ensmallen_bits/wn_grad/wn_grad.hpp"
102102

103103
#endif

inst/include/ensmallen_bits/ens_version.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
#define ENS_VERSION_MAJOR 1
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.
18-
#define ENS_VERSION_MINOR 10
19-
#define ENS_VERSION_PATCH 0
18+
#define ENS_VERSION_MINOR 11
19+
#define ENS_VERSION_PATCH 1
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
2323
// contain the capitalized string "RC".
24-
#define ENS_VERSION_NAME "Corporate Catabolism"
24+
#define ENS_VERSION_NAME "Jet Lag"
2525

2626
namespace ens {
2727

inst/include/ensmallen_bits/function/sfinae_utility.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ struct MethodFormDetector<Class, MethodForm, 7>
102102
void operator()(MethodForm<Class, T1, T2, T3, T4, T5, T6, T7>);
103103
};
104104

105-
} // namespace sfinae
106-
} // namespace ens
107-
108105
//! Utility struct for checking signatures.
109106
template<typename U, U> struct SigCheck : std::true_type {};
110107

108+
} // namespace sfinae
109+
} // namespace ens
110+
111111
/*
112112
* Constructs a template supporting the SFINAE pattern.
113113
*

inst/include/ensmallen_bits/grid_search/grid_search_impl.hpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,13 @@ double GridSearch::Optimize(
2424
const std::vector<bool>& categoricalDimensions,
2525
const arma::Row<size_t>& numCategories)
2626
{
27-
if (categoricalDimensions.size() != iterate.n_rows)
28-
{
29-
std::ostringstream oss;
30-
oss << "GridSearch::Optimize(): expected information about "
31-
<< iterate.n_rows << " dimensions in categoricalDimensions, "
32-
<< "but got " << categoricalDimensions.size();
33-
throw std::invalid_argument(oss.str());
34-
}
35-
36-
if (numCategories.n_elem != iterate.n_rows)
37-
{
38-
std::ostringstream oss;
39-
oss << "GridSearch::Optimize(): expected numCategories to have length "
40-
<< "equal to number of dimensions (" << iterate.n_rows << ") but it has"
41-
<< " length " << numCategories.n_elem;
42-
throw std::invalid_argument(oss.str());
43-
}
44-
4527
for (size_t i = 0; i < categoricalDimensions.size(); ++i)
4628
{
47-
if (categoricalDimensions[i])
29+
if (!categoricalDimensions[i])
4830
{
4931
std::ostringstream oss;
5032
oss << "GridSearch::Optimize(): the dimension " << i
51-
<< "is not categorical" << std::endl;
33+
<< " is not categorical" << std::endl;
5234
throw std::invalid_argument(oss.str());
5335
}
5436
}

inst/include/ensmallen_bits/sgd/decay_policies/no_decay.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
* http://www.opensource.org/licenses/BSD-3-Clause for more information.
1313
*/
1414

15-
#ifndef ENSMALLEN_MINIBATCH_SGD_DECAY_POLICIES_NO_DECAY_HPP
16-
#define ENSMALLEN_MINIBATCH_SGD_DECAY_POLICIES_NO_DECAY_HPP
15+
#ifndef ENSMALLEN_SGD_DECAY_POLICIES_NO_DECAY_HPP
16+
#define ENSMALLEN_SGD_DECAY_POLICIES_NO_DECAY_HPP
1717

1818
namespace ens {
1919

@@ -64,4 +64,4 @@ class NoDecay
6464

6565
} // namespace ens
6666

67-
#endif // ENSMALLEN_MINIBATCH_SGD_DECAY_POLICIES_NO_DECAY_HPP
67+
#endif // ENSMALLEN_SGD_DECAY_POLICIES_NO_DECAY_HPP

inst/include/ensmallen_bits/sgd/sgd.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ namespace ens {
7171
* the first point in the dataset (presumably, the dataset is held internally in
7272
* the DecomposableFunctionType).
7373
*
74-
* @tparam UpdatePolicyType update policy used by SGD during the iterative update
75-
* process. By default vanilla update policy (see ens::VanillaUpdate) is
76-
* used.
74+
* @tparam UpdatePolicyType update policy used by SGD during the iterative
75+
* update process. By default vanilla update policy (see ens::VanillaUpdate)
76+
* is used.
7777
* @tparam DecayPolicyType Decay policy used during the iterative update
7878
* process to adjust the step size. By default the step size isn't going to
7979
* be adjusted (i.e. NoDecay is used).
@@ -84,7 +84,7 @@ class SGD
8484
{
8585
public:
8686
/**
87-
* Construct the SGD optimizer with the given function and parameters. The
87+
* Construct the SGD optimizer with the given function and parameters. The
8888
* defaults here are not necessarily good for the given problem, so it is
8989
* suggested that the values used be tailored to the task at hand. The
9090
* maximum number of iterations refers to the maximum number of points that

inst/include/ensmallen_bits/sgd/sgd_impl.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ double SGD<UpdatePolicyType, DecayPolicyType>::Optimize(
8181

8282
if (std::isnan(overallObjective) || std::isinf(overallObjective))
8383
{
84-
// Log::Warn << "SGD: converged to " << overallObjective << "; terminating"
85-
// << " with failure. Try a smaller step size?" << std::endl;
84+
Warn << "SGD: converged to " << overallObjective << "; terminating"
85+
<< " with failure. Try a smaller step size?" << std::endl;
8686
return overallObjective;
8787
}
8888

8989
if (std::abs(lastObjective - overallObjective) < tolerance)
9090
{
91-
// Log::Info << "SGD: minimized within tolerance " << tolerance << "; "
92-
// << "terminating optimization." << std::endl;
91+
Info << "SGD: minimized within tolerance " << tolerance << "; "
92+
<< "terminating optimization." << std::endl;
9393
return overallObjective;
9494
}
9595

@@ -127,8 +127,8 @@ double SGD<UpdatePolicyType, DecayPolicyType>::Optimize(
127127
currentFunction += effectiveBatchSize;
128128
}
129129

130-
// Log::Info << "SGD: maximum iterations (" << maxIterations << ") reached; "
131-
// << "terminating optimization." << std::endl;
130+
Info << "SGD: maximum iterations (" << maxIterations << ") reached; "
131+
<< "terminating optimization." << std::endl;
132132

133133
// Calculate final objective.
134134
overallObjective = 0;

0 commit comments

Comments
 (0)