[opengm] 149/386: renamed sum_of_experts to lsum_of_experts for consistency

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Wed Aug 31 08:36:43 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 87c14d06b1192f830e1d358b203a88105a8481b6
Author: mschiegg <martin.schiegg at iwr.uni-heidelberg.de>
Date:   Fri Dec 19 10:27:18 2014 +0100

    renamed sum_of_experts to lsum_of_experts for consistency
---
 .../{sum_of_experts.hxx => lsum_of_experts.hxx}    | 58 +++++++++++-----------
 include/opengm/learning/dataset/testdatasets.hxx   |  6 +--
 .../python/opengm/opengmcore/pyFunctionTypes.cxx   |  8 +--
 src/unittest/learning/test_dataset.cxx             |  4 +-
 src/unittest/learning/test_dataset_io.cxx          |  4 +-
 src/unittest/learning/test_gridsearch_learner.cxx  |  4 +-
 src/unittest/learning/test_learning.cxx            |  4 +-
 7 files changed, 44 insertions(+), 44 deletions(-)

diff --git a/include/opengm/functions/learnable/sum_of_experts.hxx b/include/opengm/functions/learnable/lsum_of_experts.hxx
similarity index 77%
rename from include/opengm/functions/learnable/sum_of_experts.hxx
rename to include/opengm/functions/learnable/lsum_of_experts.hxx
index 02d06c6..6b0072b 100644
--- a/include/opengm/functions/learnable/sum_of_experts.hxx
+++ b/include/opengm/functions/learnable/lsum_of_experts.hxx
@@ -1,6 +1,6 @@
 #pragma once
-#ifndef OPENGM_LEARNABLE_SUM_OF_EXPERTS_FUNCTION_HXX
-#define OPENGM_LEARNABLE_SUM_OF_EXPERTS_FUNCTION_HXX
+#ifndef OPENGM_LEARNABLE_LSUM_OF_EXPERTS_FUNCTION_HXX
+#define OPENGM_LEARNABLE_LSUM_OF_EXPERTS_FUNCTION_HXX
 
 #include <algorithm>
 #include <vector>
@@ -25,16 +25,16 @@ namespace learnable {
 ///  
 /// \ingroup functions
 template<class T, class I = size_t, class L = size_t>
-class SumOfExperts
-   : public opengm::FunctionBase<opengm::functions::learnable::SumOfExperts<T, I, L>, T, I, L>
+class LSumOfExperts
+   : public opengm::FunctionBase<opengm::functions::learnable::LSumOfExperts<T, I, L>, T, I, L>
 {
 public:
    typedef T ValueType;
    typedef L LabelType;
    typedef I IndexType;
  
-   SumOfExperts();
-   SumOfExperts(const std::vector<L>& shape,
+   LSumOfExperts();
+   LSumOfExperts(const std::vector<L>& shape,
       const opengm::learning::Weights<T>& weights,
       const std::vector<size_t>& weightIDs,
       const std::vector<marray::Marray<T> >& feat
@@ -61,13 +61,13 @@ protected:
    std::vector<size_t>                     weightIDs_;
    std::vector<marray::Marray<T> >         feat_;
 
-   friend class opengm::FunctionSerialization<opengm::functions::learnable::SumOfExperts<T, I, L> >;
+   friend class opengm::FunctionSerialization<opengm::functions::learnable::LSumOfExperts<T, I, L> >;
 };
 
 
 template <class T, class I, class L>
 inline
-SumOfExperts<T, I, L>::SumOfExperts
+LSumOfExperts<T, I, L>::LSumOfExperts
 ( 
    const std::vector<L>&                           shape,
    const opengm::learning::Weights<T>&             weights,
@@ -82,7 +82,7 @@ SumOfExperts<T, I, L>::SumOfExperts
 
 template <class T, class I, class L>
 inline
-SumOfExperts<T, I, L>::SumOfExperts()
+LSumOfExperts<T, I, L>::LSumOfExperts()
    : shape_(std::vector<L>(0)), weightIDs_(std::vector<size_t>(0)), feat_(std::vector<marray::Marray<T> >(0))
 {
    ;
@@ -92,7 +92,7 @@ SumOfExperts<T, I, L>::SumOfExperts()
 template <class T, class I, class L>
 template <class ITERATOR>
 inline T
-SumOfExperts<T, I, L>::weightGradient 
+LSumOfExperts<T, I, L>::weightGradient
 (
    size_t weightNumber,
    ITERATOR begin
@@ -104,7 +104,7 @@ SumOfExperts<T, I, L>::weightGradient
 template <class T, class I, class L>
 template <class ITERATOR>
 inline T
-SumOfExperts<T, I, L>::operator()
+LSumOfExperts<T, I, L>::operator()
 (
    ITERATOR begin
 ) const {
@@ -118,7 +118,7 @@ SumOfExperts<T, I, L>::operator()
 
 template <class T, class I, class L>
 inline L
-SumOfExperts<T, I, L>::shape
+LSumOfExperts<T, I, L>::shape
 (
    const size_t i
 ) const {
@@ -127,13 +127,13 @@ SumOfExperts<T, I, L>::shape
 
 template <class T, class I, class L>
 inline size_t
-SumOfExperts<T, I, L>::dimension() const {
+LSumOfExperts<T, I, L>::dimension() const {
    return shape_.size();
 }
 
 template <class T, class I, class L>
 inline size_t
-SumOfExperts<T, I, L>::size() const {
+LSumOfExperts<T, I, L>::size() const {
    size_t s = 1;
    for(size_t i=0; i<dimension(); ++i)
       s *=shape_[i];
@@ -146,20 +146,20 @@ SumOfExperts<T, I, L>::size() const {
 
 /// FunctionSerialization
 template<class T, class I, class L>
-class FunctionSerialization<opengm::functions::learnable::SumOfExperts<T, I, L> > {
+class FunctionSerialization<opengm::functions::learnable::LSumOfExperts<T, I, L> > {
 public:
-   typedef typename opengm::functions::learnable::SumOfExperts<T, I, L>::ValueType ValueType;
+   typedef typename opengm::functions::learnable::LSumOfExperts<T, I, L>::ValueType ValueType;
 
-   static size_t indexSequenceSize(const opengm::functions::learnable::SumOfExperts<T, I, L>&);
-   static size_t valueSequenceSize(const opengm::functions::learnable::SumOfExperts<T, I, L>&);
+   static size_t indexSequenceSize(const opengm::functions::learnable::LSumOfExperts<T, I, L>&);
+   static size_t valueSequenceSize(const opengm::functions::learnable::LSumOfExperts<T, I, L>&);
    template<class INDEX_OUTPUT_ITERATOR, class VALUE_OUTPUT_ITERATOR>
-      static void serialize(const opengm::functions::learnable::SumOfExperts<T, I, L>&, INDEX_OUTPUT_ITERATOR, VALUE_OUTPUT_ITERATOR);
+      static void serialize(const opengm::functions::learnable::LSumOfExperts<T, I, L>&, INDEX_OUTPUT_ITERATOR, VALUE_OUTPUT_ITERATOR);
    template<class INDEX_INPUT_ITERATOR, class VALUE_INPUT_ITERATOR>
-      static void deserialize( INDEX_INPUT_ITERATOR, VALUE_INPUT_ITERATOR, opengm::functions::learnable::SumOfExperts<T, I, L>&);
+      static void deserialize( INDEX_INPUT_ITERATOR, VALUE_INPUT_ITERATOR, opengm::functions::learnable::LSumOfExperts<T, I, L>&);
 };
 
 template<class T, class I, class L>
-struct FunctionRegistration<opengm::functions::learnable::SumOfExperts<T, I, L> > {
+struct FunctionRegistration<opengm::functions::learnable::LSumOfExperts<T, I, L> > {
    enum ID {
       Id = opengm::FUNCTION_TYPE_ID_OFFSET + 100 + 67
    };
@@ -167,18 +167,18 @@ struct FunctionRegistration<opengm::functions::learnable::SumOfExperts<T, I, L>
 
 template<class T, class I, class L>
 inline size_t
-FunctionSerialization<opengm::functions::learnable::SumOfExperts<T, I, L> >::indexSequenceSize
+FunctionSerialization<opengm::functions::learnable::LSumOfExperts<T, I, L> >::indexSequenceSize
 (
-   const opengm::functions::learnable::SumOfExperts<T, I, L> & src
+   const opengm::functions::learnable::LSumOfExperts<T, I, L> & src
 ) {
    return 1+src.shape_.size()+1+src.weightIDs_.size();
 }
 
 template<class T, class I, class L>
 inline size_t
-FunctionSerialization<opengm::functions::learnable::SumOfExperts<T, I, L> >::valueSequenceSize
+FunctionSerialization<opengm::functions::learnable::LSumOfExperts<T, I, L> >::valueSequenceSize
 (
-   const opengm::functions::learnable::SumOfExperts<T, I, L> & src
+   const opengm::functions::learnable::LSumOfExperts<T, I, L> & src
 ) {
    return src.feat_.size()*src.size();
 }
@@ -186,9 +186,9 @@ FunctionSerialization<opengm::functions::learnable::SumOfExperts<T, I, L> >::val
 template<class T, class I, class L>
 template<class INDEX_OUTPUT_ITERATOR, class VALUE_OUTPUT_ITERATOR >
 inline void
-FunctionSerialization<opengm::functions::learnable::SumOfExperts<T, I, L> >::serialize
+FunctionSerialization<opengm::functions::learnable::LSumOfExperts<T, I, L> >::serialize
 (
-   const opengm::functions::learnable::SumOfExperts<T, I, L> & src,
+   const opengm::functions::learnable::LSumOfExperts<T, I, L> & src,
    INDEX_OUTPUT_ITERATOR indexOutIterator,
    VALUE_OUTPUT_ITERATOR valueOutIterator
 ) {
@@ -221,11 +221,11 @@ FunctionSerialization<opengm::functions::learnable::SumOfExperts<T, I, L> >::ser
 template<class T, class I, class L>
 template<class INDEX_INPUT_ITERATOR, class VALUE_INPUT_ITERATOR >
 inline void
-FunctionSerialization<opengm::functions::learnable::SumOfExperts<T, I, L> >::deserialize
+FunctionSerialization<opengm::functions::learnable::LSumOfExperts<T, I, L> >::deserialize
 (
    INDEX_INPUT_ITERATOR indexInIterator,
    VALUE_INPUT_ITERATOR valueInIterator,
-   opengm::functions::learnable::SumOfExperts<T, I, L> & dst
+   opengm::functions::learnable::LSumOfExperts<T, I, L> & dst
 ) { 
    //read shape
    size_t dim  = *indexInIterator;
diff --git a/include/opengm/learning/dataset/testdatasets.hxx b/include/opengm/learning/dataset/testdatasets.hxx
index 2753695..7208fda 100644
--- a/include/opengm/learning/dataset/testdatasets.hxx
+++ b/include/opengm/learning/dataset/testdatasets.hxx
@@ -7,7 +7,7 @@
 
 #include <opengm/learning/dataset/dataset.hxx>
 #include <opengm/functions/learnable/lpotts.hxx>
-#include <opengm/functions/learnable/sum_of_experts.hxx>
+#include <opengm/functions/learnable/lsum_of_experts.hxx>
 
 namespace opengm {
    namespace datasets{
@@ -215,7 +215,7 @@ namespace opengm {
                   feat[1](1) = std::fabs(val1-1);
                   std::vector<size_t> wID(2);
                   wID[0]=1;  wID[1]=2;
-                  opengm::functions::learnable::SumOfExperts<ValueType,IndexType,LabelType> f(shape,this->weights_, wID, feat);
+                  opengm::functions::learnable::LSumOfExperts<ValueType,IndexType,LabelType> f(shape,this->weights_, wID, feat);
                   typename GM::FunctionIdentifier fid =  this->gms_[m].addFunction(f);
 
                   // factor
@@ -277,7 +277,7 @@ namespace opengm {
             feat[1](1) = val1-1;
             std::vector<size_t> wID(2);
             wID[0]=0;  wID[1]=1;
-            opengm::functions::learnable::SumOfExperts<ValueType,IndexType,LabelType> f(shape,this->weights_, wID, feat);
+            opengm::functions::learnable::LSumOfExperts<ValueType,IndexType,LabelType> f(shape,this->weights_, wID, feat);
             typename GM::FunctionIdentifier fid =  this->gms_[m].addFunction(f);
 
 			// factor
diff --git a/src/interfaces/python/opengm/opengmcore/pyFunctionTypes.cxx b/src/interfaces/python/opengm/opengmcore/pyFunctionTypes.cxx
index 3615564..70827a0 100644
--- a/src/interfaces/python/opengm/opengmcore/pyFunctionTypes.cxx
+++ b/src/interfaces/python/opengm/opengmcore/pyFunctionTypes.cxx
@@ -28,7 +28,7 @@
 
 #include "opengm/functions/learnable/lpotts.hxx"
 #include "opengm/functions/learnable/lunary.hxx"
-#include "opengm/functions/learnable/sum_of_experts.hxx"
+#include "opengm/functions/learnable/lsum_of_experts.hxx"
 
 using namespace boost::python;
 
@@ -478,7 +478,7 @@ void export_functiontypes(){
    typedef opengm::python::PythonFunction                <ValueType,IndexType,LabelType> PyPythonFunction; 
    typedef opengm::functions::learnable::LPotts          <ValueType,IndexType,LabelType> PyLPottsFunction;
    typedef opengm::functions::learnable::LUnary          <ValueType,IndexType,LabelType> PyLUnaryFunction;
-   typedef opengm::functions::learnable::SumOfExperts    <ValueType,IndexType,LabelType> PySumOfExpertsFunction;
+   typedef opengm::functions::learnable::LSumOfExperts   <ValueType,IndexType,LabelType> PyLSumOfExpertsFunction;
 
    // vector exporters
    export_function_type_vector<PyExplicitFunction>("ExplicitFunctionVector");
@@ -779,8 +779,8 @@ void export_functiontypes(){
     )
     ;
 
-    FUNCTION_TYPE_EXPORTER_HELPER(PySumOfExpertsFunction,"SumOfExpertsFunction")
-    .def("__init__", make_constructor(&pyfunction::sumOfExpertsConstructor<PySumOfExpertsFunction> ,default_call_policies(),
+    FUNCTION_TYPE_EXPORTER_HELPER(PyLSumOfExpertsFunction,"SumOfExpertsFunction")
+    .def("__init__", make_constructor(&pyfunction::sumOfExpertsConstructor<PyLSumOfExpertsFunction> ,default_call_policies(),
          (
             boost::python::arg("shape"),
             boost::python::arg("weight"),
diff --git a/src/unittest/learning/test_dataset.cxx b/src/unittest/learning/test_dataset.cxx
index b00f9d4..f4d5367 100644
--- a/src/unittest/learning/test_dataset.cxx
+++ b/src/unittest/learning/test_dataset.cxx
@@ -9,7 +9,7 @@
 #include <opengm/utilities/metaprogramming.hxx>
 
 #include <opengm/functions/learnable/lpotts.hxx>
-#include <opengm/functions/learnable/sum_of_experts.hxx>
+#include <opengm/functions/learnable/lsum_of_experts.hxx>
 //#include <opengm/learning/dataset/testdataset.hxx>
 //#include <opengm/learning/dataset/testdataset2.hxx>
 #include <opengm/learning/dataset/dataset_io.hxx>
@@ -23,7 +23,7 @@
 typedef double ValueType;
 typedef size_t IndexType;
 typedef size_t LabelType; 
-typedef opengm::meta::TypeListGenerator<opengm::ExplicitFunction<ValueType,IndexType,LabelType>, opengm::functions::learnable::LPotts<ValueType,IndexType,LabelType>, opengm::functions::learnable::SumOfExperts<ValueType,IndexType,LabelType> >::type FunctionListType;
+typedef opengm::meta::TypeListGenerator<opengm::ExplicitFunction<ValueType,IndexType,LabelType>, opengm::functions::learnable::LPotts<ValueType,IndexType,LabelType>, opengm::functions::learnable::LSumOfExperts<ValueType,IndexType,LabelType> >::type FunctionListType;
 typedef opengm::GraphicalModel<ValueType,opengm::Adder, FunctionListType, opengm::DiscreteSpace<IndexType,LabelType> > GM; 
 //typedef opengm::datasets::TestDataset<GM>  DS1;
 //typedef opengm::datasets::Dataset<GM>      DS;
diff --git a/src/unittest/learning/test_dataset_io.cxx b/src/unittest/learning/test_dataset_io.cxx
index 53b77b7..aa2a2a5 100644
--- a/src/unittest/learning/test_dataset_io.cxx
+++ b/src/unittest/learning/test_dataset_io.cxx
@@ -9,7 +9,7 @@
 #include <opengm/utilities/metaprogramming.hxx>
 
 #include <opengm/functions/learnable/lpotts.hxx>
-#include <opengm/functions/learnable/sum_of_experts.hxx>
+#include <opengm/functions/learnable/lsum_of_experts.hxx>
 //#include <opengm/learning/dataset/testdataset.hxx>
 //#include <opengm/learning/dataset/testdataset2.hxx>
 #include <opengm/learning/dataset/dataset_io.hxx>
@@ -24,7 +24,7 @@
 typedef double ValueType;
 typedef size_t IndexType;
 typedef size_t LabelType; 
-typedef opengm::meta::TypeListGenerator<opengm::ExplicitFunction<ValueType,IndexType,LabelType>, opengm::functions::learnable::LPotts<ValueType,IndexType,LabelType>, opengm::functions::learnable::SumOfExperts<ValueType,IndexType,LabelType> >::type FunctionListType;
+typedef opengm::meta::TypeListGenerator<opengm::ExplicitFunction<ValueType,IndexType,LabelType>, opengm::functions::learnable::LPotts<ValueType,IndexType,LabelType>, opengm::functions::learnable::LSumOfExperts<ValueType,IndexType,LabelType> >::type FunctionListType;
 typedef opengm::GraphicalModel<ValueType,opengm::Adder, FunctionListType, opengm::DiscreteSpace<IndexType,LabelType> > GM; 
 typedef opengm::learning::NoLoss                 LOSS1;
 typedef opengm::learning::HammingLoss            LOSS2;
diff --git a/src/unittest/learning/test_gridsearch_learner.cxx b/src/unittest/learning/test_gridsearch_learner.cxx
index f18b7e6..cef54d8 100644
--- a/src/unittest/learning/test_gridsearch_learner.cxx
+++ b/src/unittest/learning/test_gridsearch_learner.cxx
@@ -9,7 +9,7 @@
 #include <opengm/utilities/metaprogramming.hxx>
 
 #include <opengm/functions/learnable/lpotts.hxx>
-#include <opengm/functions/learnable/sum_of_experts.hxx>
+#include <opengm/functions/learnable/lsum_of_experts.hxx>
 #include <opengm/learning/gridsearch-learning.hxx>
 #include <opengm/learning/loss/hammingloss.hxx>
 //#include <opengm/learning/dataset/testdataset.hxx>
@@ -21,7 +21,7 @@
 typedef double ValueType;
 typedef size_t IndexType;
 typedef size_t LabelType; 
-typedef opengm::meta::TypeListGenerator<opengm::ExplicitFunction<ValueType,IndexType,LabelType>, opengm::functions::learnable::LPotts<ValueType,IndexType,LabelType>, opengm::functions::learnable::SumOfExperts<ValueType,IndexType,LabelType> >::type FunctionListType;
+typedef opengm::meta::TypeListGenerator<opengm::ExplicitFunction<ValueType,IndexType,LabelType>, opengm::functions::learnable::LPotts<ValueType,IndexType,LabelType>, opengm::functions::learnable::LSumOfExperts<ValueType,IndexType,LabelType> >::type FunctionListType;
 typedef opengm::GraphicalModel<ValueType,opengm::Adder, FunctionListType, opengm::DiscreteSpace<IndexType,LabelType> > GM; 
 //typedef opengm::datasets::TestDataset<GM>  DS;
 //typedef opengm::datasets::TestDataset2<GM> DS2;
diff --git a/src/unittest/learning/test_learning.cxx b/src/unittest/learning/test_learning.cxx
index 2eed459..0514124 100644
--- a/src/unittest/learning/test_learning.cxx
+++ b/src/unittest/learning/test_learning.cxx
@@ -16,7 +16,7 @@
 
 
 #include <opengm/functions/learnable/lpotts.hxx>
-#include <opengm/functions/learnable/sum_of_experts.hxx>
+#include <opengm/functions/learnable/lsum_of_experts.hxx>
 #include <opengm/learning/struct-max-margin.hxx>
 #include <opengm/learning/loss/hammingloss.hxx>
 //#include <opengm/learning/dataset/testdataset.hxx>
@@ -28,7 +28,7 @@
 typedef double ValueType;
 typedef size_t IndexType;
 typedef size_t LabelType; 
-typedef opengm::meta::TypeListGenerator<opengm::ExplicitFunction<ValueType,IndexType,LabelType>, opengm::functions::learnable::LPotts<ValueType,IndexType,LabelType>, opengm::functions::learnable::SumOfExperts<ValueType,IndexType,LabelType> >::type FunctionListType;
+typedef opengm::meta::TypeListGenerator<opengm::ExplicitFunction<ValueType,IndexType,LabelType>, opengm::functions::learnable::LPotts<ValueType,IndexType,LabelType>, opengm::functions::learnable::LSumOfExperts<ValueType,IndexType,LabelType> >::type FunctionListType;
 typedef opengm::GraphicalModel<ValueType,opengm::Adder, FunctionListType, opengm::DiscreteSpace<IndexType,LabelType> > GM; 
 typedef opengm::learning::HammingLoss     LOSS;
 

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