diff options
author | Patrick Simianer <p@simianer.de> | 2013-11-13 18:12:10 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2013-11-13 18:12:10 +0100 |
commit | d6e6babf2cfe49fed040b651624b7e34d1a9b507 (patch) | |
tree | 2a00ab18f10a7f93e7e172551c01b48cc9f20b8c /training/utils/online_optimizer.h | |
parent | 2d2d5eced93d58bc77894d8c328195cd9950b96d (diff) | |
parent | 8a24bb77bc2e9fd17a6f6529a2942cde96a6af49 (diff) |
merge w/ upstream
Diffstat (limited to 'training/utils/online_optimizer.h')
-rw-r--r-- | training/utils/online_optimizer.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/training/utils/online_optimizer.h b/training/utils/online_optimizer.h index 28d89344..19223e9d 100644 --- a/training/utils/online_optimizer.h +++ b/training/utils/online_optimizer.h @@ -1,10 +1,10 @@ #ifndef _ONL_OPTIMIZE_H_ #define _ONL_OPTIMIZE_H_ -#include <tr1/memory> #include <set> #include <string> #include <cmath> +#include <boost/shared_ptr.hpp> #include "sparse_vector.h" struct LearningRateSchedule { @@ -56,7 +56,7 @@ struct ExponentialDecayLearningRate : public LearningRateSchedule { class OnlineOptimizer { public: virtual ~OnlineOptimizer(); - OnlineOptimizer(const std::tr1::shared_ptr<LearningRateSchedule>& s, + OnlineOptimizer(const boost::shared_ptr<LearningRateSchedule>& s, size_t batch_size, const std::vector<int>& frozen_feats = std::vector<int>()) : N_(batch_size),schedule_(s),k_() { @@ -77,13 +77,13 @@ class OnlineOptimizer { std::set<int> frozen_; // frozen (non-optimizing) features private: - std::tr1::shared_ptr<LearningRateSchedule> schedule_; + boost::shared_ptr<LearningRateSchedule> schedule_; int k_; // iteration count }; class CumulativeL1OnlineOptimizer : public OnlineOptimizer { public: - CumulativeL1OnlineOptimizer(const std::tr1::shared_ptr<LearningRateSchedule>& s, + CumulativeL1OnlineOptimizer(const boost::shared_ptr<LearningRateSchedule>& s, size_t training_instances, double C, const std::vector<int>& frozen) : OnlineOptimizer(s, training_instances, frozen), C_(C), u_() {} |