[opengm] 83/386: Fix call operator of sum of experts which did not use the mapping of local to global weight indices yet.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Aug 31 08:35:09 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 59c90c92a2bbf2c5b5194d773a8799aa9544da14
Author: Carsten Haubold <carstenhaubold at googlemail.com>
Date:   Wed Dec 17 13:19:08 2014 +0100

    Fix call operator of sum of experts which did not use the mapping of local to global weight indices yet.
---
 include/opengm/functions/learnable/sum_of_experts.hxx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/opengm/functions/learnable/sum_of_experts.hxx b/include/opengm/functions/learnable/sum_of_experts.hxx
index cfca910..5c7d778 100644
--- a/include/opengm/functions/learnable/sum_of_experts.hxx
+++ b/include/opengm/functions/learnable/sum_of_experts.hxx
@@ -70,9 +70,9 @@ inline
 SumOfExperts<T, I, L>::SumOfExperts
 ( 
    const std::vector<L>&                           shape,
-   const opengm::learning::Weights<T>&                          weights,
+   const opengm::learning::Weights<T>&             weights,
    const std::vector<size_t>&                      weightIDs,
-   const std::vector<marray::Marray<T> >&  feat
+   const std::vector<marray::Marray<T> >&          feat
    )
    :   shape_(shape), weights_(&weights), weightIDs_(weightIDs),feat_(feat)
 {
@@ -110,7 +110,7 @@ SumOfExperts<T, I, L>::operator()
 ) const {
    T val = 0;
    for(size_t i=0;i<numberOfWeights();++i){
-      val += weights_->getWeight(i) * weightGradient(i,begin);
+      val += weights_->getWeight(weightIDs_[i]) * weightGradient(i,begin);
    }
    return val;
 }

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