[opengm] 61/386: change sign of loss in lossargumented model

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Aug 31 08:35:05 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 805adf70c78c5eca28169f038dc66199d108332b
Author: Joerg Kappes <jkappes at goedel.(none)>
Date:   Tue Dec 16 13:08:05 2014 +0100

    change sign of loss in lossargumented model
---
 include/opengm/learning/loss/generalized-hammingloss.hxx | 2 +-
 include/opengm/learning/loss/hammingloss.hxx             | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/opengm/learning/loss/generalized-hammingloss.hxx b/include/opengm/learning/loss/generalized-hammingloss.hxx
index 311bff0..dc7621c 100644
--- a/include/opengm/learning/loss/generalized-hammingloss.hxx
+++ b/include/opengm/learning/loss/generalized-hammingloss.hxx
@@ -64,7 +64,7 @@ void GeneralizedHammingLoss::addLoss(GM& gm, IT gt) const
         opengm::ExplicitFunction<typename GM::ValueType,typename GM::IndexType, typename GM::LabelType> f(&numL, &(numL)+1, 0);
 
         for(typename GM::LabelType l = 0; l < numL; ++l){
-            f(l) = nodeLossMultiplier_[i] * labelLossMultiplier_[l];
+            f(l) = - nodeLossMultiplier_[i] * labelLossMultiplier_[l];
         }
 
         f(*gt) = 0;
diff --git a/include/opengm/learning/loss/hammingloss.hxx b/include/opengm/learning/loss/hammingloss.hxx
index 8088526..aad65a2 100644
--- a/include/opengm/learning/loss/hammingloss.hxx
+++ b/include/opengm/learning/loss/hammingloss.hxx
@@ -34,7 +34,7 @@ namespace opengm {
 
          for(typename GM::IndexType i=0; i<gm.numberOfVariables(); ++i){
             typename GM::LabelType numL = gm.numberOfLabels(i);
-            opengm::ExplicitFunction<typename GM::ValueType,typename GM::IndexType, typename GM::LabelType> f(&numL, &(numL)+1,1);
+            opengm::ExplicitFunction<typename GM::ValueType,typename GM::IndexType, typename GM::LabelType> f(&numL, &(numL)+1,-1);
             f(*gt) = 0;
             ++gt;
             gm.addFactor(gm.addFunction(f), &i, &(i)+1);

-- 
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