[mlpack-git] master: Remove hmm_convert, since boost::serialization makes it unnecessary. If someone wants it back someday, we can address the issue then, but I don't think anyone is trying to convert old HMM models in mlpack to new ones, so this is kind of dead code. (cb2b579)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Mon Jul 13 04:04:36 EDT 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/8b2ca720828224607c70d2b539c43aecf8f4ec32...b4659b668021db631b3c8a48e3d735b513706fdc

>---------------------------------------------------------------

commit cb2b579c36447793376438044ed8751398cfa071
Author: Ryan Curtin <ryan at ratml.org>
Date:   Sat Jul 11 12:27:07 2015 +0000

    Remove hmm_convert, since boost::serialization makes it unnecessary.
    If someone wants it back someday, we can address the issue then, but I don't think anyone is trying to convert old HMM models in mlpack to new ones, so this is kind of dead code.


>---------------------------------------------------------------

cb2b579c36447793376438044ed8751398cfa071
 src/mlpack/methods/hmm/CMakeLists.txt       |  9 +---
 src/mlpack/methods/hmm/hmm_convert_main.cpp | 77 -----------------------------
 2 files changed, 1 insertion(+), 85 deletions(-)

diff --git a/src/mlpack/methods/hmm/CMakeLists.txt b/src/mlpack/methods/hmm/CMakeLists.txt
index 0aa8b69..ef841a6 100644
--- a/src/mlpack/methods/hmm/CMakeLists.txt
+++ b/src/mlpack/methods/hmm/CMakeLists.txt
@@ -46,12 +46,5 @@ target_link_libraries(hmm_generate
   mlpack
 )
 
-add_executable(hmm_convert
-  hmm_convert_main.cpp
-)
-target_link_libraries(hmm_convert
-  mlpack
-)
-
-install(TARGETS hmm_train hmm_loglik hmm_viterbi hmm_generate hmm_convert
+install(TARGETS hmm_train hmm_loglik hmm_viterbi hmm_generate
   RUNTIME DESTINATION bin)
diff --git a/src/mlpack/methods/hmm/hmm_convert_main.cpp b/src/mlpack/methods/hmm/hmm_convert_main.cpp
deleted file mode 100644
index 1664328..0000000
--- a/src/mlpack/methods/hmm/hmm_convert_main.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * @file hmm_convert_main.cpp
- * @author Ryan Curtin
- * @author Michael Fox
- *
- * Convert an HMM (XML) file from older MLPACK versions to current format.
- */
-#include <mlpack/core.hpp>
-
-#include "hmm.hpp"
-#include "hmm_util.hpp"
-
-#include <mlpack/methods/gmm/gmm.hpp>
-
-
-PROGRAM_INFO("Hidden Markov Model (HMM) File Converter", "This utility takes "
-    "an already-trained HMM (--model_file) and converts it to the new format "
-    "(--output_file).");
-
-PARAM_STRING_REQ("model_file", "File containing HMM (XML).", "m");
-PARAM_STRING("output_file", "File to save HMM (XML) to.", "o", "output.xml");
-
-using namespace mlpack;
-using namespace mlpack::hmm;
-using namespace mlpack::distribution;
-using namespace mlpack::util;
-using namespace mlpack::gmm;
-using namespace mlpack::math;
-using namespace arma;
-using namespace std;
-
-int main(int argc, char** argv)
-{
-  // Parse command line options.
-  CLI::ParseCommandLine(argc, argv);
-
-  // Load model
-  const string modelFile = CLI::GetParam<string>("model_file");
-
-  // Load model, but first we have to determine its type.
-  SaveRestoreUtility sr, sr2;
-  sr.ReadFile(modelFile);
-  string emissionType;
-  sr.LoadParameter(emissionType, "hmm_type");
-
-  mat observations;
-  Col<size_t> sequence;
-  if (emissionType == "discrete")
-  {
-    HMM<DiscreteDistribution> hmm(1, DiscreteDistribution(1));
-    ConvertHMM(hmm, sr);
-		hmm.Save(sr2);
-  }
-  else if (emissionType == "gaussian")
-  {
-    HMM<GaussianDistribution> hmm(1, GaussianDistribution(1));
-    ConvertHMM(hmm, sr);
-		hmm.Save(sr2);
-  }
-  else if (emissionType == "gmm")
-  {
-    HMM<GMM<> > hmm(1, GMM<>(1, 1));
-    ConvertHMM(hmm, sr);
-		hmm.Save(sr2);
-  }
-  else
-  {
-    Log::Fatal << "Unknown HMM type '" << emissionType << "' in file '" << modelFile
-        << "'!" << endl;
-  }
-
-  // Save the converted model.
-  const string outputFile = CLI::GetParam<string>("output_file");
-  sr2.WriteFile(outputFile);
-
-	return 0;
-}



More information about the mlpack-git mailing list