Commit 856ec28d authored by Joseph Larralde's avatar Joseph Larralde

fixed undefined specialized templates error when building as shared library

parent 35c20bda
......@@ -19,15 +19,15 @@ namespace rapidmix { class trainingData; }
* @brief This class is an adapter for the GVF library from Baptiste Caramiaux
*/
class rapidGVF {
public:
rapidGVF();
~rapidGVF();
bool train(const rapidmix::trainingData &newTrainingData);
std::vector<double> run(const std::vector<double> &inputVector);
//TODO: needs a "reset" message
protected:
GVF * gvf;
GVFGesture currentGesture;
......
......@@ -143,7 +143,6 @@ bool xmmTool<SingleClassModel, Model>::readJSON(const std::string &filepath) {
//============================== xmmGmmTool ==================================//
// std::vector<double> xmmGmmTool::run(const std::vector<double>& inputVector) {
std::vector<double> rapidXmmGmm::run(const std::vector<double>& inputVector) {
xmmTool::preProcess(inputVector);
return model.results.smoothed_normalized_likelihoods;
......@@ -151,7 +150,6 @@ std::vector<double> rapidXmmGmm::run(const std::vector<double>& inputVector) {
//============================== xmmGmrTool ==================================//
// std::vector<double> xmmGmrTool::run(const std::vector<double>& inputVector) {
std::vector<double> rapidXmmGmr::run(const std::vector<double>& inputVector) {
xmmTool::preProcess(inputVector);
std::vector<float> *res = &model.results.output_values;
......@@ -161,7 +159,6 @@ std::vector<double> rapidXmmGmr::run(const std::vector<double>& inputVector) {
//============================== xmmHmmTool ==================================//
// std::vector<double> xmmHmmTool::run(const std::vector<double>& inputVector) {
std::vector<double> rapidXmmHmm::run(const std::vector<double>& inputVector) {
xmmTool::preProcess(inputVector);
std::vector<double> res;
......@@ -178,7 +175,6 @@ std::vector<double> rapidXmmHmm::run(const std::vector<double>& inputVector) {
//============================== xmmHmrTool ==================================//
// std::vector<double> xmmHmrTool::run(const std::vector<double>& inputVector) {
std::vector<double> rapidXmmHmr::run(const std::vector<double>& inputVector) {
xmmTool::preProcess(inputVector);
std::vector<float> *res = &model.results.output_values;
......@@ -187,20 +183,25 @@ std::vector<double> rapidXmmHmr::run(const std::vector<double>& inputVector) {
}
///////////////////////////////////////////////////////////////////////////
///// generic train method and forward declaration of specialized templates
///// generic train method and forward declaration of specialized templates
///////////////////////////////////////////////////////////////////////////
template class xmmTool<xmm::GMM, xmm::GMM>;
template class xmmTool<xmm::HMM, xmm::HierarchicalHMM>;
template class xmmStaticTool<xmm::GMM, xmm::GMM>;
template class xmmTemporalTool<xmm::HMM, xmm::HierarchicalHMM>;
//I wonder why this can't be defined in machineLearning.cpp? -MZ
// It is needed by the template instantiations below.
// You get an undefined symbols error otherwise.
template <class MachineLearningModule>
bool rapidmix::machineLearning<MachineLearningModule>::train(const trainingData &newTrainingData) {
return MachineLearningModule::train(newTrainingData);
}
// template class rapidmix::machineLearning<xmmGmmTool>;
// template class rapidmix::machineLearning<xmmGmrTool>;
// template class rapidmix::machineLearning<xmmHmmTool>;
// template class rapidmix::machineLearning<xmmHmrTool>;
template class rapidmix::machineLearning<rapidXmmGmm>;
template class rapidmix::machineLearning<rapidXmmGmr>;
template class rapidmix::machineLearning<rapidXmmHmm>;
......
/**
* @file rapidXMM.h
* @author joseph larralde
*
*
* @copyright
* Copyright (C) 2016 - 2017 by IRCAM - Centre Pompidou, Paris, France.
* All rights reserved.
......@@ -140,7 +140,7 @@ protected:
mCfg.gaussians.set(cfg.gaussians);
mCfg.relative_regularization.set(cfg.relativeRegularization);
mCfg.absolute_regularization.set(cfg.absoluteRegularization);
xmm::MultiClassRegressionEstimator mcre;
switch (cfg.regressionEstimator) {
case xmmLikeliestRegression:
......@@ -224,16 +224,10 @@ public:
/**
* @brief Static classification using Gaussian Mixture Models
*/
// class xmmGmmTool : public xmmStaticTool<xmm::GMM, xmm::GMM> {
// class GMM : public xmmStaticTool<xmm::GMM, xmm::GMM> {
class rapidXmmGmm : public xmmStaticTool<xmm::GMM, xmm::GMM> {
public:
// xmmGmmTool(xmmToolConfig cfg = xmmToolConfig()) :
// GMM(xmmToolConfig cfg = xmmToolConfig()) :
rapidXmmGmm(xmmToolConfig cfg = xmmToolConfig()) :
xmmStaticTool<xmm::GMM, xmm::GMM>(cfg, false) {}
// ~xmmGmmTool() {}
// ~GMM() {}
~rapidXmmGmm() {}
std::vector<double> run(const std::vector<double>& inputVector);
......@@ -242,16 +236,10 @@ public:
/**
* @brief Static regression using Gaussian Mixture Models
*/
// class xmmGmrTool : public xmmStaticTool<xmm::GMM, xmm::GMM> {
// class GMR : public xmmStaticTool<xmm::GMM, xmm::GMM> {
class rapidXmmGmr : public xmmStaticTool<xmm::GMM, xmm::GMM> {
public:
// xmmGmrTool(xmmToolConfig cfg = xmmToolConfig()) :
// GMR(xmmToolConfig cfg = xmmToolConfig()) :
rapidXmmGmr(xmmToolConfig cfg = xmmToolConfig()) :
xmmStaticTool<xmm::GMM, xmm::GMM>(cfg, true) {}
// ~xmmGmrTool() {}
// ~GMR() {}
~rapidXmmGmr() {}
std::vector<double> run(const std::vector<double>& inputVector);
......@@ -260,16 +248,10 @@ public:
/**
* @brief Temporal classification using Hierarchical Hidden Markov Models
*/
// class xmmHmmTool : public xmmTemporalTool<xmm::HMM, xmm::HierarchicalHMM> {
// class HMM : public xmmTemporalTool<xmm::HMM, xmm::HierarchicalHMM> {
class rapidXmmHmm : public xmmTemporalTool<xmm::HMM, xmm::HierarchicalHMM> {
public:
// xmmHmmTool(xmmToolConfig cfg = xmmToolConfig()) :
// HMM(xmmToolConfig cfg = xmmToolConfig()) :
rapidXmmHmm(xmmToolConfig cfg = xmmToolConfig()) :
xmmTemporalTool<xmm::HMM, xmm::HierarchicalHMM>(cfg, false) {}
// ~xmmHmmTool() {}
// ~HMM() {}
~rapidXmmHmm() {}
std::vector<double> run(const std::vector<double>& inputVector);
......@@ -278,16 +260,10 @@ public:
/**
* @brief Temporal regression using Hierarchical Hidden Markov Models
*/
// class xmmHmrTool : public xmmTemporalTool<xmm::HMM, xmm::HierarchicalHMM> {
// class HMR : public xmmTemporalTool<xmm::HMM, xmm::HierarchicalHMM> {
class rapidXmmHmr : public xmmTemporalTool<xmm::HMM, xmm::HierarchicalHMM> {
public:
// xmmHmrTool(xmmToolConfig cfg = xmmToolConfig()) :
// HMR(xmmToolConfig cfg = xmmToolConfig()) :
rapidXmmHmr(xmmToolConfig cfg = xmmToolConfig()) :
xmmTemporalTool<xmm::HMM, xmm::HierarchicalHMM>(cfg, true) {}
// ~xmmHmrTool() {}
// ~HMR() {}
~rapidXmmHmr() {}
std::vector<double> run(const std::vector<double>& inputVector);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment