From 23253c757b2828b7d847a8285b95d080e3fab5b6 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Mon, 21 Oct 2019 12:23:20 -0400 Subject: [PATCH 1/4] Fix missing method definitions bug --- GRT/CoreModules/MLBase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GRT/CoreModules/MLBase.h b/GRT/CoreModules/MLBase.h index d9aaba96..ef95b5d1 100644 --- a/GRT/CoreModules/MLBase.h +++ b/GRT/CoreModules/MLBase.h @@ -462,7 +462,7 @@ class GRT_API MLBase : public GRTBase, public Observer< TrainingResult >, public @return returns the minimum change value */ -// Float getMinChange() const; + Float getMinChange() const; /** Gets the current learningRate value, this is value used to update the weights at each step of a learning algorithm such as stochastic gradient descent. @@ -538,7 +538,7 @@ class GRT_API MLBase : public GRTBase, public Observer< TrainingResult >, public @return returns true if the order of the training dataset should be randomized, false otherwise */ -// bool getRandomiseTrainingOrder() const; + bool getRandomiseTrainingOrder() const; /** Gets if the model for the derived class has been succesfully trained. From de4813792087e6450a9b084229a5d7c38f893c5a Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Mon, 21 Oct 2019 12:27:15 -0400 Subject: [PATCH 2/4] Non-const lvalue fix --- .../GaussianMixtureModelsExample.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp b/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp index 93007379..0d3a3850 100644 --- a/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp +++ b/examples/ClusteringModulesExamples/GaussianMixtureModelsExample/GaussianMixtureModelsExample.cpp @@ -58,14 +58,16 @@ int main (int argc, const char * argv[]) cout << "GMM Trained in " << gmm.getNumTrainingIterationsToConverge() << " iterations.\n\n"; + auto file = std::fstream("GMM.grt"); + //Save the model to a file - if( !gmm.save( std::fstream("GMM.grt") ) ){ + if( !gmm.save( file ) ){ cout << "Failed to save model to file!\n"; return EXIT_FAILURE; } //Load the model back from a file - if( !gmm.load( std::fstream("GMM.grt") ) ){ + if( !gmm.load( file ) ){ cout << "Failed to load model from file!\n"; return EXIT_FAILURE; } From 648831a9f5daca48dfcb96adcaf4a0524f5ec926 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Mon, 21 Oct 2019 16:10:37 -0400 Subject: [PATCH 3/4] Non-const lvalue fix --- .../ClusterTreeExample/ClusterTreeExample.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/ClusteringModulesExamples/ClusterTreeExample/ClusterTreeExample.cpp b/examples/ClusteringModulesExamples/ClusterTreeExample/ClusterTreeExample.cpp index b23e2433..562b59d1 100644 --- a/examples/ClusteringModulesExamples/ClusterTreeExample/ClusterTreeExample.cpp +++ b/examples/ClusteringModulesExamples/ClusterTreeExample/ClusterTreeExample.cpp @@ -56,12 +56,14 @@ int main (int argc, const char * argv[]) return EXIT_FAILURE; } - if( !ctree.save(std::fstream("Model.grt")) ){ + auto file = std::fstream("Model.grt"); + + if( !ctree.save( file ) ){ log << "Failed to train model!" << endl; return EXIT_FAILURE; } - if( !ctree.load(std::fstream("Model.grt")) ){ + if( !ctree.load( file ) ){ log << "Failed to train model!" << endl; return EXIT_FAILURE; } From e80a31bd9c1ccbb6b48ead1d54c2a6383407bf31 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Thu, 31 Oct 2019 19:33:06 +0000 Subject: [PATCH 4/4] Add spaces to heading markdown --- build/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build/README.md b/build/README.md index ea06685e..132ec4f4 100644 --- a/build/README.md +++ b/build/README.md @@ -1,10 +1,10 @@ -##Build +## Build This folder contains a CMakeLists.txt that can be used to generate a makefile for building the GRT (as a shared or static library) and also for building the GRT examples. -##Supported Operating Systems +## Supported Operating Systems This CMakeLists file has been tested on Windows, Linux (Ubuntu 14.04), and OSX (10.9). -##C++11 +## C++11 The default build of the GRT uses C++11, you should therefore ensure you add C++11 support to any project using the GRT. If it is difficult to add C++11 to your setup, then you can still build the by disabling GRT C++11 functionality (note, this will limit the full functionality of the toolkit). @@ -34,13 +34,13 @@ int main (int argc, const char * argv[]) } ``` -##Build Instructions +## Build Instructions - [Linux Build Instructions](#linux-build-instructions) - [OSX Build Instructions](#osx-build-instructions) - [Windows Build Instructions](#windows-build-instructions) -##Linux Build Instructions +## Linux Build Instructions Note, you will need to install make (http://www.gnu.org/software/make/) and cmake (http://www.cmake.org/) and a compiler that supports C++11 (such as g++ 4.7 and later). @@ -93,7 +93,7 @@ $ pkg-config --cflags --libs grt - the GRT examples will be: build/examples -##OSX Build Instructions +## OSX Build Instructions Note, you will need to install make (http://www.gnu.org/software/make/) and cmake (http://www.cmake.org/) and a compiler that supports C++11 (such as g++ 4.7 and later). @@ -165,7 +165,7 @@ int main (int argc, const char * argv[]) } ``` -##Windows Build Instructions +## Windows Build Instructions Note, you will need to download and install the cmake Windows installer (http://www.cmake.org/) and a compiler that supports C++11 (such as VisualStudio 2015). @@ -240,7 +240,7 @@ int main (int argc, const char * argv[]) - select the 'Linker','Input', 'Additional Dependencies' and add the GRT static library (grt.lib) - click 'Apply', you should now be able to build your custom project and link against the GRT -##Contributors +## Contributors Thanks to: - Romain Guillemot for creating the original CMake file and for improving the support for Windows!