[opengm] 39/386: renamed opengm::{Paramters -> Weights} in bundle method
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Aug 31 08:35:02 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/master
in repository opengm.
commit 996961b7226d6ef5eafd689fe5ac855629d1ac3f
Author: Jan Funke <funke at ini.ch>
Date: Mon Dec 15 14:38:41 2014 +0100
renamed opengm::{Paramters -> Weights} in bundle method
---
include/opengm/learning/bundle-optimizer.hxx | 24 ++++++++++++------------
include/opengm/learning/solver/BundleCollector.h | 10 +++++-----
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/include/opengm/learning/bundle-optimizer.hxx b/include/opengm/learning/bundle-optimizer.hxx
index 037fc6d..bc2de7d 100644
--- a/include/opengm/learning/bundle-optimizer.hxx
+++ b/include/opengm/learning/bundle-optimizer.hxx
@@ -68,11 +68,11 @@ private:
template <typename Weights>
void setupQp(const Weights& w);
- template <typename ModelParameters>
- void findMinLowerBound(ModelParameters& w, ValueType& value);
+ template <typename ModelWeights>
+ void findMinLowerBound(ModelWeights& w, ValueType& value);
- template <typename ModelParameters>
- ValueType dot(const ModelParameters& a, const ModelParameters& b);
+ template <typename ModelWeights>
+ ValueType dot(const ModelWeights& a, const ModelWeights& b);
Parameter _parameter;
@@ -187,7 +187,7 @@ BundleOptimizer<T>::setupQp(const Weights& w) {
if (!_solver)
_solver = solver::QuadraticSolverFactory::Create();
- _solver->initialize(w.numberOfParameters() + 1, solver::Continuous);
+ _solver->initialize(w.numberOfWeights() + 1, solver::Continuous);
// one variable for each component of w and for ξ
solver::QuadraticObjective obj(w.numberOfWeights() + 1);
@@ -207,9 +207,9 @@ BundleOptimizer<T>::setupQp(const Weights& w) {
}
template <typename T>
-template <typename ModelParameters>
+template <typename ModelWeights>
void
-BundleOptimizer<T>::findMinLowerBound(ModelParameters& w, T& value) {
+BundleOptimizer<T>::findMinLowerBound(ModelWeights& w, T& value) {
_solver->setConstraints(_bundleCollector.getConstraints());
@@ -222,19 +222,19 @@ BundleOptimizer<T>::findMinLowerBound(ModelParameters& w, T& value) {
<< "[BundleOptimizer] QP could not be solved to optimality: "
<< msg << std::endl;
- for (size_t i = 0; i < w.numberOfParameters(); i++)
+ for (size_t i = 0; i < w.numberOfWeights(); i++)
w[i] = x[i];
}
template <typename T>
-template <typename ModelParameters>
+template <typename ModelWeights>
T
-BundleOptimizer<T>::dot(const ModelParameters& a, const ModelParameters& b) {
+BundleOptimizer<T>::dot(const ModelWeights& a, const ModelWeights& b) {
- OPENGM_ASSERT(a.numberOfParameters() == b.numberOfParameters());
+ OPENGM_ASSERT(a.numberOfWeights() == b.numberOfWeights());
T d = 0.0;
- for (size_t i = 0; i < a.numberOfParameters(); i++)
+ for (size_t i = 0; i < a.numberOfWeights(); i++)
d += a[i]+b[i];
return d;
diff --git a/include/opengm/learning/solver/BundleCollector.h b/include/opengm/learning/solver/BundleCollector.h
index 36c60ba..a9bf12c 100644
--- a/include/opengm/learning/solver/BundleCollector.h
+++ b/include/opengm/learning/solver/BundleCollector.h
@@ -11,8 +11,8 @@ class BundleCollector {
public:
- template <typename ModelParameters>
- void addHyperplane(const ModelParameters& a, double b);
+ template <typename ModelWeights>
+ void addHyperplane(const ModelWeights& a, double b);
const LinearConstraints& getConstraints() const { return _constraints; }
@@ -21,16 +21,16 @@ private:
LinearConstraints _constraints;
};
-template <typename ModelParameters>
+template <typename ModelWeights>
void
-BundleCollector::addHyperplane(const ModelParameters& a, double b) {
+BundleCollector::addHyperplane(const ModelWeights& a, double b) {
/*
<w,a> + b ≤ ξ
<=>
<w,a> - ξ ≤ -b
*/
- unsigned int dims = a.numberOfParameters();
+ unsigned int dims = a.numberOfWeights();
LinearConstraint constraint;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opengm.git
More information about the debian-science-commits
mailing list