Add Linux specific options to compile
This commit is contained in:
parent
284ef6dfd1
commit
7c3e315ae7
26
.clang-uml
26
.clang-uml
@ -1,19 +1,31 @@
|
|||||||
compilation_database_dir: build
|
compilation_database_dir: build
|
||||||
output_directory: puml
|
output_directory: puml
|
||||||
diagrams:
|
diagrams:
|
||||||
myproject_class:
|
BayesNet:
|
||||||
type: class
|
type: class
|
||||||
glob:
|
glob:
|
||||||
- src/bayesnet/*.cc
|
- src/BayesNet/*.cc
|
||||||
- src/platform/*.cc
|
- src/Platform/*.cc
|
||||||
using_namespace: bayesnet
|
using_namespace: bayesnet
|
||||||
include:
|
include:
|
||||||
namespaces:
|
namespaces:
|
||||||
- bayesnet
|
- bayesnet
|
||||||
- platform
|
- platform
|
||||||
exclude:
|
|
||||||
namespaces:
|
|
||||||
- myproject::detail
|
|
||||||
plantuml:
|
plantuml:
|
||||||
after:
|
after:
|
||||||
- 'note left of {{ alias("MyProjectMain") }}: Main class of myproject library.'
|
- "note left of {{ alias(\"MyProjectMain\") }}: Main class of myproject library."
|
||||||
|
sequence:
|
||||||
|
type: sequence
|
||||||
|
glob:
|
||||||
|
- src/Platform/main.cc
|
||||||
|
combine_free_functions_into_file_participants: true
|
||||||
|
using_namespace:
|
||||||
|
- std
|
||||||
|
- bayesnet
|
||||||
|
- platform
|
||||||
|
include:
|
||||||
|
paths:
|
||||||
|
- src/BayesNet
|
||||||
|
- src/Platform
|
||||||
|
start_from:
|
||||||
|
- function: main(int,const char **)
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -35,3 +35,4 @@ build/
|
|||||||
*.dSYM/**
|
*.dSYM/**
|
||||||
cmake-build*/**
|
cmake-build*/**
|
||||||
.idea
|
.idea
|
||||||
|
puml/**
|
||||||
|
@ -30,7 +30,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
|
|||||||
option(ENABLE_CLANG_TIDY "Enable to add clang tidy." OFF)
|
option(ENABLE_CLANG_TIDY "Enable to add clang tidy." OFF)
|
||||||
option(ENABLE_TESTING "Unit testing build" OFF)
|
option(ENABLE_TESTING "Unit testing build" OFF)
|
||||||
option(CODE_COVERAGE "Collect coverage from test library" OFF)
|
option(CODE_COVERAGE "Collect coverage from test library" OFF)
|
||||||
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||||
# CMakes modules
|
# CMakes modules
|
||||||
# --------------
|
# --------------
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
||||||
|
3
Makefile
3
Makefile
@ -32,6 +32,9 @@ clean: ## Clean the debug info
|
|||||||
find . -name "*.gcda" -print0 | xargs -0 rm
|
find . -name "*.gcda" -print0 | xargs -0 rm
|
||||||
@echo ">>> Done";
|
@echo ">>> Done";
|
||||||
|
|
||||||
|
clang-uml: ## Create uml class and sequence diagrams
|
||||||
|
clang-uml -p --add-compile-flag -I /usr/lib/gcc/x86_64-redhat-linux/8/include/
|
||||||
|
|
||||||
debug: ## Build a debug version of the project
|
debug: ## Build a debug version of the project
|
||||||
@echo ">>> Building Debug BayesNet ...";
|
@echo ">>> Building Debug BayesNet ...";
|
||||||
@if [ -d ./build ]; then rm -rf ./build; fi
|
@if [ -d ./build ]; then rm -rf ./build; fi
|
||||||
|
12
TAN_iris.dot
12
TAN_iris.dot
@ -1,12 +0,0 @@
|
|||||||
digraph BayesNet {
|
|
||||||
label=<BayesNet >
|
|
||||||
fontsize=30
|
|
||||||
fontcolor=blue
|
|
||||||
labelloc=t
|
|
||||||
layout=circo
|
|
||||||
class [shape=circle, fontcolor=red, fillcolor=lightblue, style=filled ]
|
|
||||||
class -> sepallength class -> sepalwidth class -> petallength class -> petalwidth petallength [shape=circle]
|
|
||||||
petallength -> sepallength petalwidth [shape=circle]
|
|
||||||
sepallength [shape=circle]
|
|
||||||
sepallength -> sepalwidth sepalwidth [shape=circle]
|
|
||||||
sepalwidth -> petalwidth }
|
|
@ -10,7 +10,7 @@
|
|||||||
#include "Folding.h"
|
#include "Folding.h"
|
||||||
#include "Models.h"
|
#include "Models.h"
|
||||||
#include "modelRegister.h"
|
#include "modelRegister.h"
|
||||||
|
#include <fstream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -195,11 +195,11 @@ int main(int argc, char** argv)
|
|||||||
Xt.index_put_({ i, "..." }, torch::tensor(Xd[i], torch::kInt32));
|
Xt.index_put_({ i, "..." }, torch::tensor(Xd[i], torch::kInt32));
|
||||||
}
|
}
|
||||||
float total_score = 0, total_score_train = 0, score_train, score_test;
|
float total_score = 0, total_score_train = 0, score_train, score_test;
|
||||||
Fold* fold;
|
platform::Fold* fold;
|
||||||
if (stratified)
|
if (stratified)
|
||||||
fold = new StratifiedKFold(nFolds, y, seed);
|
fold = new platform::StratifiedKFold(nFolds, y, seed);
|
||||||
else
|
else
|
||||||
fold = new KFold(nFolds, y.size(), seed);
|
fold = new platform::KFold(nFolds, y.size(), seed);
|
||||||
for (auto i = 0; i < nFolds; ++i) {
|
for (auto i = 0; i < nFolds; ++i) {
|
||||||
auto [train, test] = fold->getFold(i);
|
auto [train, test] = fold->getFold(i);
|
||||||
cout << "Fold: " << i + 1 << endl;
|
cout << "Fold: " << i + 1 << endl;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "Datasets.h"
|
#include "Datasets.h"
|
||||||
#include "platformUtils.h"
|
#include "platformUtils.h"
|
||||||
#include "ArffFiles.h"
|
#include "ArffFiles.h"
|
||||||
|
#include <fstream>
|
||||||
namespace platform {
|
namespace platform {
|
||||||
void Datasets::load()
|
void Datasets::load()
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#include "Datasets.h"
|
#include "Datasets.h"
|
||||||
#include "Models.h"
|
#include "Models.h"
|
||||||
#include "ReportConsole.h"
|
#include "ReportConsole.h"
|
||||||
|
#include <fstream>
|
||||||
namespace platform {
|
namespace platform {
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
string get_date()
|
string get_date()
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "Folding.h"
|
#include "Folding.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
namespace platform {
|
||||||
Fold::Fold(int k, int n, int seed) : k(k), n(n), seed(seed)
|
Fold::Fold(int k, int n, int seed) : k(k), n(n), seed(seed)
|
||||||
{
|
{
|
||||||
random_device rd;
|
random_device rd;
|
||||||
@ -93,3 +94,4 @@ pair<vector<int>, vector<int>> StratifiedKFold::getFold(int nFold)
|
|||||||
}
|
}
|
||||||
return { train_indices, test_indices };
|
return { train_indices, test_indices };
|
||||||
}
|
}
|
||||||
|
}
|
@ -4,7 +4,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <random>
|
#include <random>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
namespace platform {
|
||||||
class Fold {
|
class Fold {
|
||||||
protected:
|
protected:
|
||||||
int k;
|
int k;
|
||||||
@ -34,4 +34,5 @@ public:
|
|||||||
StratifiedKFold(int k, torch::Tensor& y, int seed = -1);
|
StratifiedKFold(int k, torch::Tensor& y, int seed = -1);
|
||||||
pair<vector<int>, vector<int>> getFold(int nFold) override;
|
pair<vector<int>, vector<int>> getFold(int nFold) override;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue
Block a user