Passing the hmm test, replace boost::archive into cereal

Signed-off-by: Omar Shrit <omar@shrit.me>
This commit is contained in:
Omar Shrit
2020-07-17 18:52:36 +02:00
parent bb664f4305
commit f2a2833fbe
3 changed files with 10 additions and 13 deletions
-3
View File
@@ -365,9 +365,6 @@ class HMM
template<typename Archive>
void save(Archive& ar, const unsigned int version) const;
CEREAL_SPLIT_MEMBER();
protected:
// Helper functions.
/**
+2 -2
View File
@@ -36,8 +36,8 @@ add_executable(mlpack_test
facilities_test.cpp
# feedforward_network_test.cpp
# gan_test.cpp
### gmm_test.cpp recompile alone
### hmm_test.cpp
gmm_test.cpp
hmm_test.cpp
### hoeffding_tree_test.cpp
hpt_test.cpp
hyperplane_test.cpp
+8 -8
View File
@@ -1080,7 +1080,7 @@ BOOST_AUTO_TEST_CASE(GMMHMMLoadSaveTest)
// Save the HMM.
{
std::ofstream ofs("test-hmm-save.xml");
boost::archive::xml_oarchive ar(ofs);
cereal::XMLOutputArchive ar(ofs);
ar << CEREAL_NVP(hmm);
}
@@ -1088,7 +1088,7 @@ BOOST_AUTO_TEST_CASE(GMMHMMLoadSaveTest)
HMM<GMM> hmm2(3, GMM(4, 3));
{
std::ifstream ifs("test-hmm-save.xml");
boost::archive::xml_iarchive ar(ifs);
cereal::XMLInputArchive ar(ifs);
ar >> CEREAL_NVP(hmm2);
}
@@ -1145,7 +1145,7 @@ BOOST_AUTO_TEST_CASE(GaussianHMMLoadSaveTest)
// Save the HMM.
{
std::ofstream ofs("test-hmm-save.xml");
boost::archive::xml_oarchive ar(ofs);
cereal::XMLOutputArchive ar(ofs);
ar << CEREAL_NVP(hmm);
}
@@ -1153,7 +1153,7 @@ BOOST_AUTO_TEST_CASE(GaussianHMMLoadSaveTest)
HMM<GaussianDistribution> hmm2(3, GaussianDistribution(2));
{
std::ifstream ifs("test-hmm-save.xml");
boost::archive::xml_iarchive ar(ifs);
cereal::XMLInputArchive ar(ifs);
ar >> CEREAL_NVP(hmm2);
}
@@ -1208,7 +1208,7 @@ BOOST_AUTO_TEST_CASE(DiscreteHMMLoadSaveTest)
// Save the HMM.
{
std::ofstream ofs("test-hmm-save.xml");
boost::archive::xml_oarchive ar(ofs);
cereal::XMLOutputArchive ar(ofs);
ar << CEREAL_NVP(hmm);
}
@@ -1216,7 +1216,7 @@ BOOST_AUTO_TEST_CASE(DiscreteHMMLoadSaveTest)
HMM<DiscreteDistribution> hmm2(3, DiscreteDistribution(3));
{
std::ifstream ifs("test-hmm-save.xml");
boost::archive::xml_iarchive ar(ifs);
cereal::XMLInputArchive ar(ifs);
ar >> CEREAL_NVP(hmm2);
}
@@ -1809,7 +1809,7 @@ BOOST_AUTO_TEST_CASE(DiagonalGMMHMMLoadSaveTest)
// Save the HMM.
{
std::ofstream ofs("test-hmm-save.xml");
boost::archive::xml_oarchive ar(ofs);
cereal::XMLOutputArchive ar(ofs);
ar << CEREAL_NVP(hmm);
}
@@ -1817,7 +1817,7 @@ BOOST_AUTO_TEST_CASE(DiagonalGMMHMMLoadSaveTest)
HMM<DiagonalGMM> hmm2(3, DiagonalGMM(4, 3));
{
std::ifstream ifs("test-hmm-save.xml");
boost::archive::xml_iarchive ar(ifs);
cereal::XMLInputArchive ar(ifs);
ar >> CEREAL_NVP(hmm2);
}