[opengm] 23/386: write test for grid search learning(todo: rename this file)
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Wed Aug 31 08:35:00 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 a747fd37f47646372ea974cd7360fa131828aecc
Author: joergkappes <kappes at math.uni-heidelberg.de>
Date: Wed Nov 19 15:42:00 2014 +0100
write test for grid search learning(todo: rename this file)
---
src/unittest/test_randomlearner.cxx | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/src/unittest/test_randomlearner.cxx b/src/unittest/test_randomlearner.cxx
index 01f52bd..887bb35 100644
--- a/src/unittest/test_randomlearner.cxx
+++ b/src/unittest/test_randomlearner.cxx
@@ -14,8 +14,34 @@
#include <opengm/learning/dataset/testdataset.hxx>
+//*************************************
+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> >::type FunctionListType;
+typedef opengm::GraphicalModel<ValueType,opengm::Adder, FunctionListType, opengm::DiscreteSpace<IndexType,LabelType> > GM;
+typedef opengm::datasets::TestDataset<GM> DS;
+typedef opengm::learning::HammingLoss LOSS;
+typedef opengm::ICM<GM,opengm::Minimizer> INF;
+
+//*************************************
+
int main() {
- std::cout << " Includes are fine :-) " << std::endl;
+ std::cout << " Includes are fine :-) " << std::endl;
+
+ DS dataset;
+ std::cout << "Dataset includes " << dataset.getNumberOfModels() << " instances and has " << dataset.getNumberOfParameters() << " parameters."<<std::endl;
+
+
+ opengm::learning::GridSearchLearner<DS,LOSS>::Parameter para;
+ para.parameterUpperbound_.resize(1,1);
+ para.parameterLowerbound_.resize(1,0);
+ para.testingPoints_.resize(1,10);
+ opengm::learning::GridSearchLearner<DS,LOSS> learner(dataset,para);
+
+
+ INF::Parameter infPara;
+ learner.learn<INF>(infPara);
}
--
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