Complex toy classes & DataAnalysis initial
This commit is contained in:
parent
93a90e0291
commit
43e374f269
12 changed files with 376 additions and 169 deletions
32
DataAnalysis/CMakeLists.txt
Normal file
32
DataAnalysis/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
project(DataAnalysis)
|
||||
|
||||
### ---------------------- Static Library --------------------- ###
|
||||
file(GLOB SOURCES "./private/*.cpp" "./private/*/*.cpp")
|
||||
file(GLOB HEADERS "./public/*.hpp" "./public/*/*.hpp" "./applications/*.hpp")
|
||||
|
||||
add_library(${PROJECT_NAME} STATIC ${SOURCES} ${HEADERS})
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ./public/)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC Math Containers)
|
||||
|
||||
### -------------------------- Applications -------------------------- ###
|
||||
add_executable(NumberRec ./applications/NumberRecognition.cpp)
|
||||
target_link_libraries(NumberRec ${PROJECT_NAME})
|
||||
#file(COPY "applications/rsc" DESTINATION "${CMAKE_BINARY_DIR}/${PROJECT_NAME}/")
|
||||
|
||||
### -------------------------- Tests -------------------------- ###
|
||||
enable_testing()
|
||||
file(GLOB TEST_SOURCES "./tests/*.cpp" "./tests/*/*.cpp")
|
||||
add_executable(${PROJECT_NAME}Tests ${TEST_SOURCES})
|
||||
|
||||
target_include_directories(${PROJECT_NAME}Tests PUBLIC ./applications/)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}Tests ${PROJECT_NAME} Utils)
|
||||
add_test(NAME ${PROJECT_NAME}Tests COMMAND ${PROJECT_NAME}Tests)
|
||||
|
||||
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/lib)
|
||||
3
DataAnalysis/applications/NumberRecognition.cpp
Normal file
3
DataAnalysis/applications/NumberRecognition.cpp
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#include "FullyConnectedNN.hpp"
|
||||
|
||||
int main() { return 0; }
|
||||
8
DataAnalysis/private/DataAnalysisCommon.cpp
Normal file
8
DataAnalysis/private/DataAnalysisCommon.cpp
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#include "DataAnalysisCommon.hpp"
|
||||
#include "ContainersCommon.hpp"
|
||||
#include "MathCommon.hpp"
|
||||
|
||||
namespace tp {
|
||||
static ModuleManifest* deps[] = {&gModuleMath, &gModuleContainers, nullptr};
|
||||
ModuleManifest gModuleDataAnalysis = ModuleManifest("DataAnalysis", nullptr, nullptr, deps);
|
||||
}
|
||||
7
DataAnalysis/public/DataAnalysisCommon.hpp
Normal file
7
DataAnalysis/public/DataAnalysisCommon.hpp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "Module.hpp"
|
||||
|
||||
namespace tp {
|
||||
extern ModuleManifest gModuleDataAnalysis;
|
||||
}
|
||||
20
DataAnalysis/public/FullyConnectedNN.hpp
Normal file
20
DataAnalysis/public/FullyConnectedNN.hpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#pragma once
|
||||
|
||||
#include "Buffer.hpp"
|
||||
#include "DataAnalysisCommon.hpp"
|
||||
|
||||
namespace tp {
|
||||
class FullyConnectedNN {
|
||||
public:
|
||||
struct Layer {
|
||||
halnf mBias;
|
||||
Buffer<halnf> mWeights;
|
||||
};
|
||||
|
||||
public:
|
||||
FullyConnectedNN() = default;
|
||||
|
||||
private:
|
||||
Buffer<Layer> mLayers;
|
||||
};
|
||||
};
|
||||
26
DataAnalysis/tests/Tests.cpp
Normal file
26
DataAnalysis/tests/Tests.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
#include "FullyConnectedNN.hpp"
|
||||
#include "Testing.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
static bool init(const tp::ModuleManifest* self) {
|
||||
tp::gTesting.setRootName(self->getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
void test() {}
|
||||
|
||||
int main() {
|
||||
tp::ModuleManifest* deps[] = {&tp::gModuleDataAnalysis, &tp::gModuleUtils, nullptr};
|
||||
tp::ModuleManifest testModule("DataAnalysisTest", init, nullptr, deps);
|
||||
|
||||
if (!testModule.initialize()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
testModule.deinitialize();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue