[mlpack-git] master: Remove deprecated conversion utility. I don't think anyone was using it anyway, and like the HMM conversion utility, we can reimplement it if someone complains. (2dfad1a)

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


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

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

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

commit 2dfad1ace5ad01fe75f4d2a35547a28afebbe65e
Author: Ryan Curtin <ryan at ratml.org>
Date:   Sun Jul 12 13:32:00 2015 +0000

    Remove deprecated conversion utility.
    I don't think anyone was using it anyway, and like the HMM conversion utility, we can reimplement it if someone complains.


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

2dfad1ace5ad01fe75f4d2a35547a28afebbe65e
 src/mlpack/methods/gmm/CMakeLists.txt       |  8 ----
 src/mlpack/methods/gmm/gmm_convert_main.cpp | 61 -----------------------------
 2 files changed, 69 deletions(-)

diff --git a/src/mlpack/methods/gmm/CMakeLists.txt b/src/mlpack/methods/gmm/CMakeLists.txt
index 16633b3..74e7ed2 100644
--- a/src/mlpack/methods/gmm/CMakeLists.txt
+++ b/src/mlpack/methods/gmm/CMakeLists.txt
@@ -31,12 +31,4 @@ target_link_libraries(gmm
   mlpack
 )
 
-# legacy file converter
-add_executable(gmm_convert
-  gmm_convert_main.cpp
-)
-target_link_libraries(gmm_convert
-  mlpack
-)
-
 install(TARGETS gmm gmm_convert RUNTIME DESTINATION bin)
diff --git a/src/mlpack/methods/gmm/gmm_convert_main.cpp b/src/mlpack/methods/gmm/gmm_convert_main.cpp
deleted file mode 100644
index 1f484f9..0000000
--- a/src/mlpack/methods/gmm/gmm_convert_main.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * @author Michael Fox
- * @file gmm_convert_main.cpp
- *
- * This program converts an older GMM XML file to the new format.
- */
-#include <mlpack/core.hpp>
-#include "gmm.hpp"
-
-using namespace mlpack;
-using namespace mlpack::gmm;
-using namespace mlpack::util;
-using namespace std;
-
-PROGRAM_INFO("Gaussian Mixture Model (GMM) file converter",
-    "This program takes a fitted GMM XML file from older MLPACK versions (1.0.9"
-    " and older) and converts it to the current format.");
-
-PARAM_STRING_REQ("input_file", "File containing the fitted model.", "i");
-PARAM_STRING("output_file", "The file to write the model to (as XML).", "o",
-    "gmm.xml");
-
-int main(int argc, char* argv[])
-{
-  CLI::ParseCommandLine(argc, argv);
-  string inputFile = CLI::GetParam<string>("input_file");
-  SaveRestoreUtility load;
-
-  if (!load.ReadFile(inputFile))
-    Log::Fatal << " Could not read file '" << inputFile << "'!\n";
-
-  size_t gaussians, dimensionality;
-  load.LoadParameter(gaussians, "gaussians");
-  load.LoadParameter(dimensionality, "dimensionality");
-  GMM<> gmm(gaussians, dimensionality);
-
-  load.LoadParameter(gmm.Weights(), "weights");
-
-  // We need to do a little error checking here.
-  if (gmm.Weights().n_elem != gmm.Gaussians())
-  {
-    Log::Fatal << "GMM::Load('" << inputFile << "'): file reports "
-        << gmm.Gaussians() << " gaussians but weights vector only contains "
-        << gmm.Weights().n_elem << " elements!" << endl;
-  }
-
-  for (size_t i = 0; i < gaussians; ++i)
-  {
-    stringstream o;
-    arma::mat covariance;
-    o << i;
-    string meanName = "mean" + o.str();
-    string covName = "covariance" + o.str();
-
-    load.LoadParameter(gmm.Component(i).Mean(), meanName);
-    load.LoadParameter(covariance, covName);
-    gmm.Component(i).Covariance(std::move(covariance));
-  }
-
-  gmm.Save(CLI::GetParam<string>("output_file"));
-}



More information about the mlpack-git mailing list