diff --git a/.vscode/launch.json b/.vscode/launch.json index be15d5cb..5209cf9d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "name": "Debug NeuralNetwork Main", "type": "cppdbg", "request": "launch", - "program": "${workspaceFolder}/src/neuralnetwork/main", + "program": "${workspaceFolder}/examples/main", "args": ["-g", "-O0"], "stopAtEntry": false, "cwd": "${workspaceFolder}", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 188668cc..f0a4ce6d 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -15,10 +15,14 @@ "-fdiagnostics-color=always", "-DMYODDWEB_PROFILE=0", "-O3", - "${workspaceFolder}/src/neuralnetwork/*.cpp", - "${workspaceFolder}/src/neuralnetwork/libraries/*.cpp", + "${workspaceFolder}/examples/*.cpp", + "${workspaceFolder}/include/neuralnetwork/*.cpp", + "${workspaceFolder}/include/neuralnetwork/layers/*.cpp", + "${workspaceFolder}/include/neuralnetwork/helpers/*.cpp", + "${workspaceFolder}/include/neuralnetwork/common/*.cpp", + "${workspaceFolder}/include/neuralnetwork/libraries/TinyJSON.cpp", "-o", - "${fileDirname}/main" + "${workspaceFolder}/examples/main" ], "options": { "cwd": "${fileDirname}" @@ -46,10 +50,14 @@ "-Wtype-limits", "-DMYODDWEB_PROFILE=0", "-O0", - "${workspaceFolder}/src/neuralnetwork/*.cpp", - "${workspaceFolder}/src/neuralnetwork/libraries/*.cpp", + "${workspaceFolder}/examples/*.cpp", + "${workspaceFolder}/include/neuralnetwork/*.cpp", + "${workspaceFolder}/include/neuralnetwork/layers/*.cpp", + "${workspaceFolder}/include/neuralnetwork/helpers/*.cpp", + "${workspaceFolder}/include/neuralnetwork/common/*.cpp", + "${workspaceFolder}/include/neuralnetwork/libraries/TinyJSON.cpp", "-o", - "${fileDirname}/main" + "${workspaceFolder}/examples/main" ], "options": { "cwd": "${fileDirname}" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..2361cda9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,18 @@ +# Changelog + +All notable changes to the `neural-network` library will be documented in this file. + +## [1.1.0] - 2026-06-12 + +### Added +- Created the `myoddweb::nn` namespace. +- Wrapped all core neural network library classes, structures, and helper functions in the new `myoddweb::nn` namespace (including `NeuralNetwork`, `Layer`, `Neuron`, `activation`, `NeuralNetworkOptions`, etc.). +- Added explicit documentation in the `README.md` explaining how to import and use the new namespace. + +### Changed +- Updated all stand-alone example header files in `src/neuralnetwork/examples/` to use the `myoddweb::nn` namespace. +- Updated all test files in `tests/` to use the `myoddweb::nn` namespace. +- Kept third-party libraries (`TinyJSON`, `tracy`) and instrumentation code (`instrumentor.h`) outside the namespace to maintain clean integration boundaries. +- Reorganised the core NeuralNetwork library directory structure from a flat root layout into `/layers/`, `/helpers/`, and `/common/` subdirectories to improve code modularity. +- Updated all include directives in library headers, source files, tests, and examples to point to the new subdirectory paths. +- Updated MSVC Visual Studio project files (`.vcxproj` and `.vcxproj.filters`) and CMake files (`CMakeLists.txt`) to reflect the new folder structure. diff --git a/README.md b/README.md index b4ef11a2..8facedda 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,23 @@ While not focused on high performance, it provides a clean implementation of the ## How to use +### Namespace + +All classes, structures, and functions of the core neural network library are wrapped in the `myoddweb::nn` namespace. + +To use the library, you can import the namespace: + +```cpp +using namespace myoddweb::nn; +``` + +Or reference the types explicitly: + +```cpp +myoddweb::nn::NeuralNetworkOptions options = ... +myoddweb::nn::NeuralNetwork nn(options); +``` + ### Activation methods * linear @@ -252,6 +269,18 @@ To enable these optimizations, ensure your compiler is configured to target the For more information on AVX2, see the [Intel Intrinsics Guide](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html) or [Wikipedia](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions). +## Repository Layout + +* `\include\neuralnetwork\`: The stand-alone core neural network library (including `/layers/`, `/helpers/`, and `/common/` subdirectories). +* `\examples\`: Standalone example implementations, runner (`main.cpp`), and the main Visual Studio solution (`neuralnetwork.sln`). +* `\tests\`: Comprehensive unit test suite. + +## Building and Running + +1. Open `examples/neuralnetwork.sln` in Visual Studio 2022. +2. Select `neuralnetwork` (to run the examples) or `neuralnetwork_tests` (to run unit tests) as the startup project. +3. Build and run using the IDE. + ## Technical Stack * **Language:** C++17/C++20 diff --git a/src/neuralnetwork/examples/addingproblem.h b/examples/addingproblem.h similarity index 96% rename from src/neuralnetwork/examples/addingproblem.h rename to examples/addingproblem.h index b7c492a7..85cc8b73 100644 --- a/src/neuralnetwork/examples/addingproblem.h +++ b/examples/addingproblem.h @@ -1,13 +1,15 @@ -#pragma once +#pragma once #include "helper.h" -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetworkserializer.h" +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "helpers/neuralnetworkserializer.h" #include #include #include + +using namespace myoddweb::nn; class ExampleAddingProblem { public: diff --git a/src/neuralnetwork/examples/branched_output.h b/examples/branched_output.h similarity index 97% rename from src/neuralnetwork/examples/branched_output.h rename to examples/branched_output.h index 71cb3107..afe5187f 100644 --- a/src/neuralnetwork/examples/branched_output.h +++ b/examples/branched_output.h @@ -1,12 +1,14 @@ -#pragma once +#pragma once #include #include #include #include -#include "../neuralnetwork.h" -#include "../neuralnetworkserializer.h" -#include "../logger.h" +#include "neuralnetwork.h" +#include "helpers/neuralnetworkserializer.h" +#include "common/logger.h" + +using namespace myoddweb::nn; class ExampleBranchedOutput { public: diff --git a/src/neuralnetwork/examples/compound_output_sandwich.h b/examples/compound_output_sandwich.h similarity index 97% rename from src/neuralnetwork/examples/compound_output_sandwich.h rename to examples/compound_output_sandwich.h index 60a67c5a..d08ad84e 100644 --- a/src/neuralnetwork/examples/compound_output_sandwich.h +++ b/examples/compound_output_sandwich.h @@ -1,7 +1,7 @@ -#pragma once -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetworkserializer.h" +#pragma once +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "helpers/neuralnetworkserializer.h" #include "helper.h" #include #include @@ -21,6 +21,8 @@ * This confirms that Softmax, compound slicing, multi-head hidden layers, * recurrent states, residual jumps, and persistence all work in perfect harmony. */ + +using namespace myoddweb::nn; class ExampleCompoundOutputSandwich { private: diff --git a/src/neuralnetwork/examples/compound_softmax.h b/examples/compound_softmax.h similarity index 97% rename from src/neuralnetwork/examples/compound_softmax.h rename to examples/compound_softmax.h index ea9debd8..dd32d6bd 100644 --- a/src/neuralnetwork/examples/compound_softmax.h +++ b/examples/compound_softmax.h @@ -1,7 +1,7 @@ -#pragma once -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetwork.h" +#pragma once +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "neuralnetwork.h" #include "helper.h" #include #include @@ -21,6 +21,8 @@ * - Bucket 3: 0.4 <= x < 1.2 * - Bucket 4: x >= 1.2 */ + +using namespace myoddweb::nn; class ExampleCompoundSoftmax { private: diff --git a/src/neuralnetwork/examples/compound_trivial_softmax.h b/examples/compound_trivial_softmax.h similarity index 96% rename from src/neuralnetwork/examples/compound_trivial_softmax.h rename to examples/compound_trivial_softmax.h index 3ddf11ad..33dad135 100644 --- a/src/neuralnetwork/examples/compound_trivial_softmax.h +++ b/examples/compound_trivial_softmax.h @@ -1,11 +1,13 @@ -#pragma once -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetworkserializer.h" +#pragma once +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "helpers/neuralnetworkserializer.h" #include "helper.h" #include // Compound + +using namespace myoddweb::nn; class ExampleCompoundTrivialSoftmax { private: diff --git a/src/neuralnetwork/examples/copymemory.h b/examples/copymemory.h similarity index 97% rename from src/neuralnetwork/examples/copymemory.h rename to examples/copymemory.h index 1e5a0b30..b319dbd3 100644 --- a/src/neuralnetwork/examples/copymemory.h +++ b/examples/copymemory.h @@ -1,10 +1,12 @@ -#include +#include #include -#include "../logger.h" -#include "../neuralnetwork.h" +#include "common/logger.h" +#include "neuralnetwork.h" #include "helper.h" + +using namespace myoddweb::nn; class ExampleCopyMemory { public: diff --git a/src/neuralnetwork/examples/helper.h b/examples/helper.h similarity index 97% rename from src/neuralnetwork/examples/helper.h rename to examples/helper.h index 41ba26f9..ae47c405 100644 --- a/src/neuralnetwork/examples/helper.h +++ b/examples/helper.h @@ -1,4 +1,4 @@ -#include +#include #include #define TEST_START(label) \ diff --git a/src/neuralnetwork/examples/lstm.h b/examples/lstm.h similarity index 96% rename from src/neuralnetwork/examples/lstm.h rename to examples/lstm.h index 3499135f..de2f7c5c 100644 --- a/src/neuralnetwork/examples/lstm.h +++ b/examples/lstm.h @@ -1,10 +1,12 @@ #pragma once -#include "../neuralnetwork.h" -#include "../neuralnetworkoptions.h" -#include "../logger.h" +#include "neuralnetwork.h" +#include "neuralnetworkoptions.h" +#include "common/logger.h" #include "helper.h" #include + +using namespace myoddweb::nn; class ExampleLstm { private: diff --git a/src/neuralnetwork/examples/lstm_multi.h b/examples/lstm_multi.h similarity index 97% rename from src/neuralnetwork/examples/lstm_multi.h rename to examples/lstm_multi.h index 9c7c9ad0..00e1a828 100644 --- a/src/neuralnetwork/examples/lstm_multi.h +++ b/examples/lstm_multi.h @@ -1,7 +1,7 @@ -#pragma once -#include "../neuralnetwork.h" -#include "../neuralnetworkoptions.h" -#include "../logger.h" +#pragma once +#include "neuralnetwork.h" +#include "neuralnetworkoptions.h" +#include "common/logger.h" #include "helper.h" #include @@ -13,6 +13,8 @@ * * It is used to verify the integration of LSTM with Multi-Output functionality. */ + +using namespace myoddweb::nn; class ExampleLstmMulti { private: diff --git a/src/neuralnetwork/main.cpp b/examples/main.cpp similarity index 63% rename from src/neuralnetwork/main.cpp rename to examples/main.cpp index 6e2c7188..5671c938 100644 --- a/src/neuralnetwork/main.cpp +++ b/examples/main.cpp @@ -1,30 +1,32 @@ -// neuralnetwork.cpp : This file contains the 'main' function. Program execution begins and ends there. +// neuralnetwork.cpp : This file contains the 'main' function. Program execution begins and ends there. // -#include "logger.h" +#include "common/logger.h" // neural network #include "neuralnetwork.h" // examples -#include "./examples/addingproblem.h" -#include "./examples/branched_output.h" -#include "./examples/compound_output_sandwich.h" -#include "./examples/compound_softmax.h" -#include "./examples/compound_trivial_softmax.h" -#include "./examples/copymemory.h" -#include "./examples/lstm.h" -#include "./examples/lstm_multi.h" -#include "./examples/multi_output.h" -#include "./examples/multi_output_gru.h" -#include "./examples/repro_issue.h" -#include "./examples/residualxor.h" -#include "./examples/spiral.h" -#include "./examples/syntheticsentiment.h" -#include "./examples/threebitparity.h" -#include "./examples/trivial_softmax.h" -#include "./examples/twomoon.h" -#include "./examples/xor.h" -#include "./libraries/instrumentor.h" +#include "addingproblem.h" +#include "branched_output.h" +#include "compound_output_sandwich.h" +#include "compound_softmax.h" +#include "compound_trivial_softmax.h" +#include "copymemory.h" +#include "lstm.h" +#include "lstm_multi.h" +#include "multi_output.h" +#include "multi_output_gru.h" +#include "repro_issue.h" +#include "residualxor.h" +#include "spiral.h" +#include "syntheticsentiment.h" +#include "threebitparity.h" +#include "trivial_softmax.h" +#include "twomoon.h" +#include "xor.h" +#include "libraries/instrumentor.h" + +using namespace myoddweb::nn; int main() { diff --git a/src/neuralnetwork/examples/multi_output.h b/examples/multi_output.h similarity index 97% rename from src/neuralnetwork/examples/multi_output.h rename to examples/multi_output.h index 84ad127b..90e81214 100644 --- a/src/neuralnetwork/examples/multi_output.h +++ b/examples/multi_output.h @@ -1,7 +1,7 @@ -#pragma once -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetwork.h" +#pragma once +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "neuralnetwork.h" #include "helper.h" #include #include @@ -19,6 +19,8 @@ * - Output ~1.0 if x > 0, ~0.0 if x < 0 (Sigmoid) * - Output tanh(x) as a regression value (Tanh) */ + +using namespace myoddweb::nn; class ExampleMultiOutput { private: diff --git a/src/neuralnetwork/examples/multi_output_gru.h b/examples/multi_output_gru.h similarity index 97% rename from src/neuralnetwork/examples/multi_output_gru.h rename to examples/multi_output_gru.h index 72659c68..296f55a2 100644 --- a/src/neuralnetwork/examples/multi_output_gru.h +++ b/examples/multi_output_gru.h @@ -1,7 +1,7 @@ -#pragma once -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetwork.h" +#pragma once +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "neuralnetwork.h" #include "helper.h" #include #include @@ -18,6 +18,8 @@ * 1. Sigmoid Output: Is the LAST value in the sequence positive? * 2. Tanh Output: What is the average value of the sequence? */ + +using namespace myoddweb::nn; class ExampleMultiOutputGru { private: diff --git a/src/neuralnetwork/neuralnetwork.sln b/examples/neuralnetwork.sln similarity index 96% rename from src/neuralnetwork/neuralnetwork.sln rename to examples/neuralnetwork.sln index b1ba6a5a..97285cb5 100644 --- a/src/neuralnetwork/neuralnetwork.sln +++ b/examples/neuralnetwork.sln @@ -7,7 +7,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "neuralnetwork", "neuralnetw EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "neuralnetwork_tests", "..\..\tests\neuralnetwork_tests.vcxproj", "{A3D2B8F3-6B23-4F26-990C-26CC4C33BE4B}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "neuralnetwork_tests", "..\tests\neuralnetwork_tests.vcxproj", "{A3D2B8F3-6B23-4F26-990C-26CC4C33BE4B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/neuralnetwork/neuralnetwork.vcxproj b/examples/neuralnetwork.vcxproj similarity index 59% rename from src/neuralnetwork/neuralnetwork.vcxproj rename to examples/neuralnetwork.vcxproj index 3df8123a..60ee4f4e 100644 --- a/src/neuralnetwork/neuralnetwork.vcxproj +++ b/examples/neuralnetwork.vcxproj @@ -1,4 +1,4 @@ - + @@ -112,6 +112,7 @@ stdc17 false AdvancedVectorExtensions2 + ../include/neuralnetwork/ Console @@ -138,81 +139,81 @@ - - - - - - - - - - + + + + + + + + + + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/neuralnetwork/examples/repro_issue.h b/examples/repro_issue.h similarity index 97% rename from src/neuralnetwork/examples/repro_issue.h rename to examples/repro_issue.h index 7642addb..7aea80b8 100644 --- a/src/neuralnetwork/examples/repro_issue.h +++ b/examples/repro_issue.h @@ -1,7 +1,7 @@ -#pragma once -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetwork.h" +#pragma once +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "neuralnetwork.h" #include "helper.h" #include #include @@ -18,6 +18,8 @@ * - Output 0: 1 neuron, MSE (Regression) * - Output 1: 5 neurons, Softmax + Cross Entropy (Classification) */ + +using namespace myoddweb::nn; class ExampleReproIssue { private: diff --git a/src/neuralnetwork/examples/repro_issue_softmax.h b/examples/repro_issue_softmax.h similarity index 99% rename from src/neuralnetwork/examples/repro_issue_softmax.h rename to examples/repro_issue_softmax.h index 5c44b10d..f6fb65bf 100644 --- a/src/neuralnetwork/examples/repro_issue_softmax.h +++ b/examples/repro_issue_softmax.h @@ -1,7 +1,7 @@ -#pragma once -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetwork.h" +#pragma once +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "neuralnetwork.h" #include "helper.h" #include #include @@ -21,6 +21,8 @@ * - Output 0: 1 neuron, MSE (Regression) * - Output 1: 5 neurons, Softmax + Cross Entropy (Classification) */ + +using namespace myoddweb::nn; class ExampleReproIssueSoftmax { private: diff --git a/src/neuralnetwork/examples/residualxor.h b/examples/residualxor.h similarity index 96% rename from src/neuralnetwork/examples/residualxor.h rename to examples/residualxor.h index 19c51eb9..26725e51 100644 --- a/src/neuralnetwork/examples/residualxor.h +++ b/examples/residualxor.h @@ -1,9 +1,11 @@ -#include "../neuralnetworkserializer.h" +#include "helpers/neuralnetworkserializer.h" #include "helper.h" -#include "../logger.h" +#include "common/logger.h" #include + +using namespace myoddweb::nn; class ExampleResidualXor { public: diff --git a/src/neuralnetwork/examples/spiral.csv b/examples/spiral.csv similarity index 100% rename from src/neuralnetwork/examples/spiral.csv rename to examples/spiral.csv diff --git a/src/neuralnetwork/examples/spiral.h b/examples/spiral.h similarity index 97% rename from src/neuralnetwork/examples/spiral.h rename to examples/spiral.h index fd672a31..d4e5b9c7 100644 --- a/src/neuralnetwork/examples/spiral.h +++ b/examples/spiral.h @@ -1,6 +1,6 @@ -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetworkserializer.h" +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "helpers/neuralnetworkserializer.h" #include "helper.h" @@ -9,6 +9,8 @@ #include #include + +using namespace myoddweb::nn; class SpiralLoader { public: diff --git a/src/neuralnetwork/examples/syntheticsentiment.h b/examples/syntheticsentiment.h similarity index 97% rename from src/neuralnetwork/examples/syntheticsentiment.h rename to examples/syntheticsentiment.h index aac89549..b8037715 100644 --- a/src/neuralnetwork/examples/syntheticsentiment.h +++ b/examples/syntheticsentiment.h @@ -1,15 +1,17 @@ -#pragma once +#pragma once #include "helper.h" -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetworkserializer.h" +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "helpers/neuralnetworkserializer.h" #include #include #include #include #include + +using namespace myoddweb::nn; class ExampleSyntheticSentiment { public: diff --git a/src/neuralnetwork/examples/threebitparity.h b/examples/threebitparity.h similarity index 97% rename from src/neuralnetwork/examples/threebitparity.h rename to examples/threebitparity.h index 06bc2721..cf5d6f30 100644 --- a/src/neuralnetwork/examples/threebitparity.h +++ b/examples/threebitparity.h @@ -1,9 +1,11 @@ -#include +#include -#include "../logger.h" -#include "../neuralnetwork.h" +#include "common/logger.h" +#include "neuralnetwork.h" #include "helper.h" + +using namespace myoddweb::nn; class ExampleThreebitParity { public: diff --git a/src/neuralnetwork/examples/trivial_softmax.h b/examples/trivial_softmax.h similarity index 94% rename from src/neuralnetwork/examples/trivial_softmax.h rename to examples/trivial_softmax.h index feef4d74..3b10ba32 100644 --- a/src/neuralnetwork/examples/trivial_softmax.h +++ b/examples/trivial_softmax.h @@ -1,10 +1,12 @@ -#pragma once -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetworkserializer.h" +#pragma once +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "helpers/neuralnetworkserializer.h" #include "helper.h" #include + +using namespace myoddweb::nn; class ExampleTrivialSoftmax { private: diff --git a/src/neuralnetwork/examples/two_moons.csv b/examples/two_moons.csv similarity index 100% rename from src/neuralnetwork/examples/two_moons.csv rename to examples/two_moons.csv diff --git a/src/neuralnetwork/examples/two_moons_test.csv b/examples/two_moons_test.csv similarity index 100% rename from src/neuralnetwork/examples/two_moons_test.csv rename to examples/two_moons_test.csv diff --git a/src/neuralnetwork/examples/twomoon.h b/examples/twomoon.h similarity index 97% rename from src/neuralnetwork/examples/twomoon.h rename to examples/twomoon.h index c933b1d5..54b306c0 100644 --- a/src/neuralnetwork/examples/twomoon.h +++ b/examples/twomoon.h @@ -1,6 +1,6 @@ -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetworkserializer.h" +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "helpers/neuralnetworkserializer.h" #include "helper.h" #include // For errno @@ -8,6 +8,8 @@ #include #include + +using namespace myoddweb::nn; class TwoMoonLoader { public: diff --git a/src/neuralnetwork/examples/xor.h b/examples/xor.h similarity index 96% rename from src/neuralnetwork/examples/xor.h rename to examples/xor.h index 2747d5cf..38618dfe 100644 --- a/src/neuralnetwork/examples/xor.h +++ b/examples/xor.h @@ -1,8 +1,10 @@ -#include "../errorcalculation.h" -#include "../logger.h" -#include "../neuralnetworkserializer.h" +#include "helpers/errorcalculation.h" +#include "common/logger.h" +#include "helpers/neuralnetworkserializer.h" #include "helper.h" + +using namespace myoddweb::nn; class ExampleXor { private: diff --git a/src/neuralnetwork/activation.cpp b/include/neuralnetwork/common/activation.cpp similarity index 99% rename from src/neuralnetwork/activation.cpp rename to include/neuralnetwork/common/activation.cpp index dc5c6d54..47b95043 100644 --- a/src/neuralnetwork/activation.cpp +++ b/include/neuralnetwork/common/activation.cpp @@ -1,4 +1,4 @@ -#include "activation.h" +#include "activation.h" #include #include #include @@ -12,6 +12,9 @@ #define SELU_LAMBDA 1.0507 #define SELU_ALPHA 1.67326 + +namespace myoddweb::nn +{ activation::activation(const method method, double alpha, double temperature, double inference_temperature) : _method(method), _alpha(alpha), @@ -627,3 +630,5 @@ std::string activation::method_to_string(method m) Logger::panic("Unknown or unsupported 'method' enum value."); } } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/activation.h b/include/neuralnetwork/common/activation.h similarity index 97% rename from src/neuralnetwork/activation.h rename to include/neuralnetwork/common/activation.h index 45f1e078..b8c04b82 100644 --- a/src/neuralnetwork/activation.h +++ b/include/neuralnetwork/common/activation.h @@ -1,9 +1,12 @@ -#pragma once -#include "./libraries/instrumentor.h" +#pragma once +#include "../libraries/instrumentor.h" #include #include + +namespace myoddweb::nn +{ class activation { private: @@ -122,4 +125,5 @@ class activation double _inference_temperature; activation_function _activate_ptr; activation_function _derivative_ptr; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/aligned_allocator.h b/include/neuralnetwork/common/aligned_allocator.h similarity index 95% rename from src/neuralnetwork/aligned_allocator.h rename to include/neuralnetwork/common/aligned_allocator.h index d6b5f616..a4df2093 100644 --- a/src/neuralnetwork/aligned_allocator.h +++ b/include/neuralnetwork/common/aligned_allocator.h @@ -1,5 +1,5 @@ -#pragma once -#include "libraries/instrumentor.h" +#pragma once +#include "../libraries/instrumentor.h" #include #include @@ -15,6 +15,9 @@ #undef new #endif + +namespace myoddweb::nn +{ template class AlignedAllocator { @@ -107,4 +110,5 @@ bool operator!=(const AlignedAllocator&, const AlignedAllocator& #if defined(_MSC_VER) #pragma pop_macro("new") -#endif \ No newline at end of file +#endif +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/evaluationconfig.h b/include/neuralnetwork/common/evaluationconfig.h similarity index 96% rename from src/neuralnetwork/evaluationconfig.h rename to include/neuralnetwork/common/evaluationconfig.h index 0e989a70..d952359a 100644 --- a/src/neuralnetwork/evaluationconfig.h +++ b/include/neuralnetwork/common/evaluationconfig.h @@ -1,7 +1,10 @@ -#pragma once +#pragma once -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" + +namespace myoddweb::nn +{ class EvaluationConfig final { public: @@ -102,3 +105,5 @@ class EvaluationConfig final double _cross_entropy_lambda; double _epsilon = 1e-8; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/gradientsandoutputs.h b/include/neuralnetwork/common/gradientsandoutputs.h similarity index 98% rename from src/neuralnetwork/gradientsandoutputs.h rename to include/neuralnetwork/common/gradientsandoutputs.h index d04bda79..6fca216f 100644 --- a/src/neuralnetwork/gradientsandoutputs.h +++ b/include/neuralnetwork/common/gradientsandoutputs.h @@ -1,5 +1,5 @@ -#pragma once -#include "./libraries/instrumentor.h" +#pragma once +#include "../libraries/instrumentor.h" #include "layersandneuronscontainer.h" #include "logger.h" @@ -7,6 +7,9 @@ #include #include + +namespace myoddweb::nn +{ class GradientsAndOutputs { public: @@ -236,3 +239,5 @@ class GradientsAndOutputs std::vector> _rnn_gradients; std::vector> _rnn_gate_gradients; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/hiddenstate.h b/include/neuralnetwork/common/hiddenstate.h similarity index 97% rename from src/neuralnetwork/hiddenstate.h rename to include/neuralnetwork/common/hiddenstate.h index d98e25a9..181ca7b2 100644 --- a/src/neuralnetwork/hiddenstate.h +++ b/include/neuralnetwork/common/hiddenstate.h @@ -1,10 +1,13 @@ -#pragma once -#include "./libraries/instrumentor.h" +#pragma once +#include "../libraries/instrumentor.h" #include "logger.h" #include #include + +namespace myoddweb::nn +{ class HiddenState { public: @@ -126,3 +129,5 @@ class HiddenState std::span _cell_state_values; double _dummy = 0.0; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/hiddenstates.h b/include/neuralnetwork/common/hiddenstates.h similarity index 98% rename from src/neuralnetwork/hiddenstates.h rename to include/neuralnetwork/common/hiddenstates.h index 8c4b5192..7eb924b8 100644 --- a/src/neuralnetwork/hiddenstates.h +++ b/include/neuralnetwork/common/hiddenstates.h @@ -1,5 +1,5 @@ -#pragma once -#include "./libraries/instrumentor.h" +#pragma once +#include "../libraries/instrumentor.h" #include #include #include @@ -7,6 +7,9 @@ #include "hiddenstate.h" #include "logger.h" + +namespace myoddweb::nn +{ class HiddenStates { public: @@ -173,3 +176,5 @@ class HiddenStates std::vector> _cell_state_values; std::vector> _layer_views; // [layer][time] }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/layersandneuronscontainer.h b/include/neuralnetwork/common/layersandneuronscontainer.h similarity index 98% rename from src/neuralnetwork/layersandneuronscontainer.h rename to include/neuralnetwork/common/layersandneuronscontainer.h index 07f73cfe..5f5acf29 100644 --- a/src/neuralnetwork/layersandneuronscontainer.h +++ b/include/neuralnetwork/common/layersandneuronscontainer.h @@ -1,10 +1,13 @@ -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "aligned_allocator.h" #include "logger.h" #include #include #include + +namespace myoddweb::nn +{ class LayersAndNeuronsContainer { public: @@ -187,3 +190,5 @@ class LayersAndNeuronsContainer std::vector> _data; std::vector _topology; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/logger.h b/include/neuralnetwork/common/logger.h similarity index 99% rename from src/neuralnetwork/logger.h rename to include/neuralnetwork/common/logger.h index 881bb5d7..d1b8dec2 100644 --- a/src/neuralnetwork/logger.h +++ b/include/neuralnetwork/common/logger.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once // C headers #include @@ -23,6 +23,9 @@ #include #include + +namespace myoddweb::nn +{ class Logger { public: @@ -410,4 +413,5 @@ class Logger throw std::runtime_error(oss.str()); } } -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/optimiser.h b/include/neuralnetwork/common/optimiser.h similarity index 97% rename from src/neuralnetwork/optimiser.h rename to include/neuralnetwork/common/optimiser.h index 4a70fde1..24e98846 100644 --- a/src/neuralnetwork/optimiser.h +++ b/include/neuralnetwork/common/optimiser.h @@ -4,6 +4,9 @@ #include #include + +namespace myoddweb::nn +{ enum class OptimiserType { SGD, @@ -110,4 +113,5 @@ inline OptimiserType string_to_optimiser_type(const std::string& str) } // If no match is found after checking all possibilities, throw an exception Logger::panic("Unknown optimiser type: ", str); -} \ No newline at end of file +} +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/rng.h b/include/neuralnetwork/common/rng.h similarity index 95% rename from src/neuralnetwork/rng.h rename to include/neuralnetwork/common/rng.h index 430ab81a..0aeac937 100644 --- a/src/neuralnetwork/rng.h +++ b/include/neuralnetwork/common/rng.h @@ -1,8 +1,11 @@ -#pragma once +#pragma once #include #include // For std::mt19937 and std::random_device + +namespace myoddweb::nn +{ class Rng { private: @@ -53,4 +56,5 @@ class Rng private: seed_type _seed; std::mt19937 _engine; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/simd_utils.h b/include/neuralnetwork/common/simd_utils.h similarity index 99% rename from src/neuralnetwork/simd_utils.h rename to include/neuralnetwork/common/simd_utils.h index 5b3d2dc4..87ff2d22 100644 --- a/src/neuralnetwork/simd_utils.h +++ b/include/neuralnetwork/common/simd_utils.h @@ -1,6 +1,6 @@ -#pragma once +#pragma once -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include #include #include @@ -11,6 +11,9 @@ #define SIMD_AVX2_ENABLED #endif + +namespace myoddweb::nn +{ class simd { public: @@ -565,4 +568,5 @@ class simd #endif scalar_add_vectors(x, y, n, j); } -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/taskqueue.h b/include/neuralnetwork/common/taskqueue.h similarity index 99% rename from src/neuralnetwork/taskqueue.h rename to include/neuralnetwork/common/taskqueue.h index 682e64d0..0f69df52 100644 --- a/src/neuralnetwork/taskqueue.h +++ b/include/neuralnetwork/common/taskqueue.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include #include @@ -7,9 +7,12 @@ #include #include -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "logger.h" + +namespace myoddweb::nn +{ template class TaskQueue { @@ -1099,3 +1102,5 @@ class TaskQueuePool std::atomic _threads_index; std::once_flag _start_flag; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/weightparam.h b/include/neuralnetwork/common/weightparam.h similarity index 98% rename from src/neuralnetwork/weightparam.h rename to include/neuralnetwork/common/weightparam.h index d93daf6f..07e0793c 100644 --- a/src/neuralnetwork/weightparam.h +++ b/include/neuralnetwork/common/weightparam.h @@ -1,9 +1,12 @@ -#pragma once +#pragma once #include "logger.h" -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include + +namespace myoddweb::nn +{ class WeightParam { public: @@ -204,4 +207,5 @@ class WeightParam double _second_moment_estimate = 0.0; long long _time_step = 0; double _weight_decay = 0.0; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/adaptivelearningratescheduler.h b/include/neuralnetwork/helpers/adaptivelearningratescheduler.h similarity index 98% rename from src/neuralnetwork/adaptivelearningratescheduler.h rename to include/neuralnetwork/helpers/adaptivelearningratescheduler.h index c850602a..55456005 100644 --- a/src/neuralnetwork/adaptivelearningratescheduler.h +++ b/include/neuralnetwork/helpers/adaptivelearningratescheduler.h @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -7,8 +7,11 @@ #include #include -#include "logger.h" +#include "../common/logger.h" + +namespace myoddweb::nn +{ class AdaptiveLearningRateScheduler { private: @@ -282,4 +285,5 @@ class AdaptiveLearningRateScheduler { return current_learning_rate * (1.0 - static_cast(epoch) / number_of_epoch); } -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/errorcalculation.h b/include/neuralnetwork/helpers/errorcalculation.h similarity index 99% rename from src/neuralnetwork/errorcalculation.h rename to include/neuralnetwork/helpers/errorcalculation.h index 67d36ac1..09dd97d0 100644 --- a/src/neuralnetwork/errorcalculation.h +++ b/include/neuralnetwork/helpers/errorcalculation.h @@ -1,5 +1,5 @@ -#pragma once -#include "./libraries/instrumentor.h" +#pragma once +#include "../libraries/instrumentor.h" #include #include @@ -7,10 +7,13 @@ #include #include -#include "activation.h" -#include "evaluationconfig.h" -#include "logger.h" +#include "../common/activation.h" +#include "../common/evaluationconfig.h" +#include "../common/logger.h" + +namespace myoddweb::nn +{ class ErrorCalculation { public: @@ -1007,4 +1010,5 @@ class ErrorCalculation } return (total == 0) ? 0.0 : static_cast(predicted) / total; } -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/neuralnetworkhelper.cpp b/include/neuralnetwork/helpers/neuralnetworkhelper.cpp similarity index 90% rename from src/neuralnetwork/neuralnetworkhelper.cpp rename to include/neuralnetwork/helpers/neuralnetworkhelper.cpp index ce5800a4..ca5c812b 100644 --- a/src/neuralnetwork/neuralnetworkhelper.cpp +++ b/include/neuralnetwork/helpers/neuralnetworkhelper.cpp @@ -1,6 +1,9 @@ -#include "neuralnetworkhelper.h" -#include "neuralnetwork.h" +#include "neuralnetworkhelper.h" +#include "../neuralnetwork.h" + +namespace myoddweb::nn +{ NeuralNetworkHelper::NeuralNetworkHelper( NeuralNetwork& neural_network, double learning_rate, @@ -30,3 +33,5 @@ std::vector> NeuralNetworkHelper::calcul MYODDWEB_PROFILE_FUNCTION("NeuralNetworkHelper"); return _neural_network->calculate_forecast_metrics_all_layers(error_types); } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/neuralnetworkhelper.h b/include/neuralnetwork/helpers/neuralnetworkhelper.h similarity index 98% rename from src/neuralnetwork/neuralnetworkhelper.h rename to include/neuralnetwork/helpers/neuralnetworkhelper.h index 87622bee..34a58a4a 100644 --- a/src/neuralnetwork/neuralnetworkhelper.h +++ b/include/neuralnetwork/helpers/neuralnetworkhelper.h @@ -1,11 +1,14 @@ -#pragma once +#pragma once #include -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "errorcalculation.h" #include "neuralnetworkhelpermetrics.h" #include "trainingmonitor.h" + +namespace myoddweb::nn +{ class NeuralNetwork; class NeuralNetworkHelper { @@ -186,3 +189,5 @@ class NeuralNetworkHelper std::vector _final_check_indexes; TrainingMonitor _training_monitor; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/neuralnetworkhelpermetrics.h b/include/neuralnetwork/helpers/neuralnetworkhelpermetrics.h similarity index 93% rename from src/neuralnetwork/neuralnetworkhelpermetrics.h rename to include/neuralnetwork/helpers/neuralnetworkhelpermetrics.h index b30cdc98..a7b8a8ff 100644 --- a/src/neuralnetwork/neuralnetworkhelpermetrics.h +++ b/include/neuralnetwork/helpers/neuralnetworkhelpermetrics.h @@ -1,8 +1,11 @@ -#pragma once +#pragma once -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "errorcalculation.h" + +namespace myoddweb::nn +{ class NeuralNetworkHelperMetrics final { public: @@ -66,3 +69,5 @@ class NeuralNetworkHelperMetrics final double _error; ErrorCalculation::type _error_type; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/neuralnetworkserializer.cpp b/include/neuralnetwork/helpers/neuralnetworkserializer.cpp similarity index 99% rename from src/neuralnetwork/neuralnetworkserializer.cpp rename to include/neuralnetwork/helpers/neuralnetworkserializer.cpp index dd6f7004..c9816d10 100644 --- a/src/neuralnetwork/neuralnetworkserializer.cpp +++ b/include/neuralnetwork/helpers/neuralnetworkserializer.cpp @@ -1,13 +1,16 @@ -#include +#include #include #include #include -#include "./libraries/instrumentor.h" -#include "logger.h" +#include "../libraries/instrumentor.h" +#include "../common/logger.h" #include "neuralnetworkserializer.h" -#include "optimiser.h" +#include "../common/optimiser.h" + +namespace myoddweb::nn +{ NeuralNetworkSerializer::NeuralNetworkSerializer() { MYODDWEB_PROFILE_FUNCTION("NeuralNetworkSerializer"); @@ -2488,3 +2491,5 @@ void NeuralNetworkSerializer::load_weights(Layer& layer, const TinyJSON::TJValue layer.set_residual_projector(projector); } } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/neuralnetworkserializer.h b/include/neuralnetwork/helpers/neuralnetworkserializer.h similarity index 88% rename from src/neuralnetwork/neuralnetworkserializer.h rename to include/neuralnetwork/helpers/neuralnetworkserializer.h index 29e49f90..c445c529 100644 --- a/src/neuralnetwork/neuralnetworkserializer.h +++ b/include/neuralnetwork/helpers/neuralnetworkserializer.h @@ -1,28 +1,31 @@ -#pragma once +#pragma once #include #include #include #include -#include "elmanrnnlayer.h" +#include "../layers/elmanrnnlayer.h" #include "errorcalculation.h" -#include "evaluationconfig.h" -#include "fflayer.h" -#include "ffoutputlayer.h" -#include "grurnnlayer.h" -#include "lstmlayer.h" -#include "layer.h" -#include "layerdetails.h" -#include "layers.h" -#include "multioutputlayer.h" -#include "multioutputlayerdetails.h" -#include "neuralnetwork.h" -#include "neuron.h" -#include "outputlayerdetails.h" -#include "weightparam.h" +#include "../common/evaluationconfig.h" +#include "../layers/fflayer.h" +#include "../layers/ffoutputlayer.h" +#include "../layers/grurnnlayer.h" +#include "../layers/lstmlayer.h" +#include "../layers/layer.h" +#include "../layers/layerdetails.h" +#include "../layers/layers.h" +#include "../layers/multioutputlayer.h" +#include "../layers/multioutputlayerdetails.h" +#include "../neuralnetwork.h" +#include "../neuron.h" +#include "../layers/outputlayerdetails.h" +#include "../common/weightparam.h" -#include "libraries/TinyJSON.h" +#include "../libraries/TinyJSON.h" + +namespace myoddweb::nn +{ class NeuralNetworkSerializer { public: @@ -83,4 +86,5 @@ class NeuralNetworkSerializer static TinyJSON::TJValueObject* add_residual_projector(const ResidualProjector* residual_projector); static TinyJSON::TJValueArray* add_hidden_layers(const std::vector& hidden_layers); static TinyJSON::TJValueArray* add_output_layer_details(const std::vector& output_layer_details); -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/trainingmonitor.h b/include/neuralnetwork/helpers/trainingmonitor.h similarity index 96% rename from src/neuralnetwork/trainingmonitor.h rename to include/neuralnetwork/helpers/trainingmonitor.h index cb8c1d14..1a77d48d 100644 --- a/src/neuralnetwork/trainingmonitor.h +++ b/include/neuralnetwork/helpers/trainingmonitor.h @@ -1,10 +1,13 @@ -#pragma once +#pragma once #include #include "errorcalculation.h" -#include "logger.h" -#include "libraries/instrumentor.h" +#include "../common/logger.h" +#include "../libraries/instrumentor.h" + +namespace myoddweb::nn +{ class TrainingMonitor { public: @@ -142,4 +145,5 @@ class TrainingMonitor double _rmse_weight; double _da_threshold; double _rmse_tolerance; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/elmanrnnlayer.cpp b/include/neuralnetwork/layers/elmanrnnlayer.cpp similarity index 99% rename from src/neuralnetwork/elmanrnnlayer.cpp rename to include/neuralnetwork/layers/elmanrnnlayer.cpp index 9d1570b5..cbc4bc43 100644 --- a/src/neuralnetwork/elmanrnnlayer.cpp +++ b/include/neuralnetwork/layers/elmanrnnlayer.cpp @@ -1,11 +1,14 @@ -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "elmanrnnlayer.h" #include "fflayer.h" -#include "logger.h" -#include "simd_utils.h" +#include "../common/logger.h" +#include "../common/simd_utils.h" #include #include + +namespace myoddweb::nn +{ ElmanRNNLayer::ElmanRNNLayer( unsigned layer_index, unsigned num_neurons_in_previous_layer, @@ -857,3 +860,5 @@ void ElmanRNNLayer::cache_recurrent_weights() } } } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/elmanrnnlayer.h b/include/neuralnetwork/layers/elmanrnnlayer.h similarity index 98% rename from src/neuralnetwork/elmanrnnlayer.h rename to include/neuralnetwork/layers/elmanrnnlayer.h index 3a9aecc8..30bc6048 100644 --- a/src/neuralnetwork/elmanrnnlayer.h +++ b/include/neuralnetwork/layers/elmanrnnlayer.h @@ -1,10 +1,13 @@ -#pragma once -#include "errorcalculation.h" -#include "hiddenstate.h" +#pragma once +#include "../helpers/errorcalculation.h" +#include "../common/hiddenstate.h" #include "layer.h" #include + +namespace myoddweb::nn +{ class ElmanRNNLayer final : public Layer { protected: @@ -280,3 +283,5 @@ class ElmanRNNLayer final : public Layer // Per-thread workspaces for BPTT std::vector> _thread_workspaces; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/fflayer.cpp b/include/neuralnetwork/layers/fflayer.cpp similarity index 99% rename from src/neuralnetwork/fflayer.cpp rename to include/neuralnetwork/layers/fflayer.cpp index 4fb0418f..f2d2c55b 100644 --- a/src/neuralnetwork/fflayer.cpp +++ b/include/neuralnetwork/layers/fflayer.cpp @@ -1,9 +1,12 @@ -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "fflayer.h" -#include "simd_utils.h" -#include "logger.h" +#include "../common/simd_utils.h" +#include "../common/logger.h" #include + +namespace myoddweb::nn +{ FFLayer::FFLayer( unsigned layer_index, unsigned num_neurons_in_previous_layer, @@ -758,3 +761,5 @@ void FFLayer::calculate_and_store_gradients_chunk( } } } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/fflayer.h b/include/neuralnetwork/layers/fflayer.h similarity index 97% rename from src/neuralnetwork/fflayer.h rename to include/neuralnetwork/layers/fflayer.h index 32570f4d..a266f889 100644 --- a/src/neuralnetwork/fflayer.h +++ b/include/neuralnetwork/layers/fflayer.h @@ -1,10 +1,13 @@ -#pragma once -#include "errorcalculation.h" -#include "hiddenstate.h" +#pragma once +#include "../helpers/errorcalculation.h" +#include "../common/hiddenstate.h" #include "layer.h" #include + +namespace myoddweb::nn +{ class FFLayer : public Layer { public: @@ -192,4 +195,5 @@ class FFLayer : public Layer size_t num_time_steps, std::vector& local_w_grads, std::vector& local_b_grads) const; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/ffoutputlayer.cpp b/include/neuralnetwork/layers/ffoutputlayer.cpp similarity index 99% rename from src/neuralnetwork/ffoutputlayer.cpp rename to include/neuralnetwork/layers/ffoutputlayer.cpp index 15836127..8a5cb3d1 100644 --- a/src/neuralnetwork/ffoutputlayer.cpp +++ b/include/neuralnetwork/layers/ffoutputlayer.cpp @@ -1,8 +1,11 @@ -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "ffoutputlayer.h" -#include "logger.h" -#include "neuralnetworkhelpermetrics.h" +#include "../common/logger.h" +#include "../helpers/neuralnetworkhelpermetrics.h" + +namespace myoddweb::nn +{ FFOutputLayer::FFOutputLayer( unsigned layer_index, const std::vector& output_layer_details, @@ -631,3 +634,5 @@ void FFOutputLayer::apply_stored_gradients(double learning_rate, double clipping std::fill(_w_grads.begin(), _w_grads.end(), 0.0); std::fill(_b_grads.begin(), _b_grads.end(), 0.0); } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/ffoutputlayer.h b/include/neuralnetwork/layers/ffoutputlayer.h similarity index 97% rename from src/neuralnetwork/ffoutputlayer.h rename to include/neuralnetwork/layers/ffoutputlayer.h index c61df058..00a8c743 100644 --- a/src/neuralnetwork/ffoutputlayer.h +++ b/include/neuralnetwork/layers/ffoutputlayer.h @@ -1,10 +1,13 @@ -#pragma once -#include "errorcalculation.h" +#pragma once +#include "../helpers/errorcalculation.h" #include "fflayer.h" #include "outputlayer.h" #include + +namespace myoddweb::nn +{ class FFOutputLayer final : public FFLayer, public OutputLayer { public: @@ -115,4 +118,5 @@ class FFOutputLayer final : public FFLayer, public OutputLayer std::vector& deltas, const std::vector& target_outputs, const std::vector& given_outputs) const; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/grurnnlayer.cpp b/include/neuralnetwork/layers/grurnnlayer.cpp similarity index 99% rename from src/neuralnetwork/grurnnlayer.cpp rename to include/neuralnetwork/layers/grurnnlayer.cpp index f726c686..87d8e396 100644 --- a/src/neuralnetwork/grurnnlayer.cpp +++ b/include/neuralnetwork/layers/grurnnlayer.cpp @@ -1,10 +1,13 @@ -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "grurnnlayer.h" #include "fflayer.h" -#include "logger.h" -#include "simd_utils.h" +#include "../common/logger.h" +#include "../common/simd_utils.h" #include + +namespace myoddweb::nn +{ GRURNNLayer::GRURNNLayer( unsigned layer_index, unsigned num_neurons_in_previous_layer, @@ -1779,3 +1782,5 @@ void GRURNNLayer::set_rw_decays(const std::vector& v) _rw_decays = v; } } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/grurnnlayer.h b/include/neuralnetwork/layers/grurnnlayer.h similarity index 99% rename from src/neuralnetwork/grurnnlayer.h rename to include/neuralnetwork/layers/grurnnlayer.h index 30bd482d..de785c45 100644 --- a/src/neuralnetwork/grurnnlayer.h +++ b/include/neuralnetwork/layers/grurnnlayer.h @@ -1,11 +1,14 @@ -#pragma once -#include "aligned_allocator.h" -#include "errorcalculation.h" -#include "hiddenstate.h" +#pragma once +#include "../common/aligned_allocator.h" +#include "../helpers/errorcalculation.h" +#include "../common/hiddenstate.h" #include "layer.h" #include + +namespace myoddweb::nn +{ class GRURNNLayer final : public Layer { protected: @@ -672,3 +675,5 @@ class GRURNNLayer final : public Layer // Per-thread workspaces for BPTT std::vector> _thread_workspaces; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/layer.cpp b/include/neuralnetwork/layers/layer.cpp similarity index 99% rename from src/neuralnetwork/layer.cpp rename to include/neuralnetwork/layers/layer.cpp index 25f09b62..5bbe8d5b 100644 --- a/src/neuralnetwork/layer.cpp +++ b/include/neuralnetwork/layers/layer.cpp @@ -1,13 +1,16 @@ -#include +#include #include "layer.h" -#include "simd_utils.h" -#include "logger.h" +#include "../common/simd_utils.h" +#include "../common/logger.h" #include "layerdetails.h" #include "fflayer.h" #include "elmanrnnlayer.h" #include "grurnnlayer.h" #include "lstmlayer.h" + +namespace myoddweb::nn +{ std::unique_ptr Layer::create_hidden_layer( unsigned layer_index, unsigned number_input_neurons, @@ -753,3 +756,5 @@ void Layer::apply_weight_gradient(double gradient, double learning_rate, bool is apply_update_to_weight(_w_values, _w_grads, _w_velocities, _w_m1, _w_m2, _w_timesteps, _w_decays, weight_index, gradient, learning_rate, clipping_scale, optimiser_type, neuron_number); } } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/layer.h b/include/neuralnetwork/layers/layer.h similarity index 98% rename from src/neuralnetwork/layer.h rename to include/neuralnetwork/layers/layer.h index 471fed72..d623d137 100644 --- a/src/neuralnetwork/layer.h +++ b/include/neuralnetwork/layers/layer.h @@ -1,24 +1,27 @@ -#pragma once - -#include "./libraries/instrumentor.h" - -#include "activation.h" -#include "errorcalculation.h" -#include "evaluationconfig.h" -#include "gradientsandoutputs.h" -#include "hiddenstates.h" -#include "neuralnetworkhelpermetrics.h" -#include "neuron.h" -#include "optimiser.h" +#pragma once + +#include "../libraries/instrumentor.h" + +#include "../common/activation.h" +#include "../helpers/errorcalculation.h" +#include "../common/evaluationconfig.h" +#include "../common/gradientsandoutputs.h" +#include "../common/hiddenstates.h" +#include "../helpers/neuralnetworkhelpermetrics.h" +#include "../neuron.h" +#include "../common/optimiser.h" #include "residualprojector.h" -#include "taskqueue.h" -#include "weightparam.h" +#include "../common/taskqueue.h" +#include "../common/weightparam.h" #include #include #include #include + +namespace myoddweb::nn +{ class layer_activation_helper { public: @@ -1306,3 +1309,5 @@ class Layer layer_activation_helper _layer_activation_helper; double _momentum; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/layerdetails.h b/include/neuralnetwork/layers/layerdetails.h similarity index 94% rename from src/neuralnetwork/layerdetails.h rename to include/neuralnetwork/layers/layerdetails.h index 7d4dd719..ef7d0633 100644 --- a/src/neuralnetwork/layerdetails.h +++ b/include/neuralnetwork/layers/layerdetails.h @@ -1,15 +1,18 @@ -#pragma once +#pragma once -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "layer.h" -#include "logger.h" +#include "../common/logger.h" -#include "activation.h" -#include "optimiser.h" +#include "../common/activation.h" +#include "../common/optimiser.h" #include "outputlayerdetails.h" #include + +namespace myoddweb::nn +{ class LayerDetails { public: @@ -141,4 +144,5 @@ class LayerDetails double _weight_decay; OptimiserType _optimiser_type; double _momentum; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/layergradients.h b/include/neuralnetwork/layers/layergradients.h similarity index 82% rename from src/neuralnetwork/layergradients.h rename to include/neuralnetwork/layers/layergradients.h index 9454277d..4034f106 100644 --- a/src/neuralnetwork/layergradients.h +++ b/include/neuralnetwork/layers/layergradients.h @@ -1,7 +1,10 @@ -#pragma once +#pragma once #include + +namespace myoddweb::nn +{ struct LayerGradients { // For FFLayer weights or ElmanRNNLayer input-to-hidden std::vector weights; @@ -12,3 +15,5 @@ struct LayerGradients { // For residual weights std::vector residual_weights; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/layers.cpp b/include/neuralnetwork/layers/layers.cpp similarity index 99% rename from src/neuralnetwork/layers.cpp rename to include/neuralnetwork/layers/layers.cpp index 4ef17b75..574d8261 100644 --- a/src/neuralnetwork/layers.cpp +++ b/include/neuralnetwork/layers/layers.cpp @@ -1,4 +1,4 @@ -#include "elmanrnnlayer.h" +#include "elmanrnnlayer.h" #include "fflayer.h" #include "ffoutputlayer.h" #include "grurnnlayer.h" @@ -7,6 +7,9 @@ #include "lstmlayer.h" #include "multioutputlayer.h" + +namespace myoddweb::nn +{ Layers::Layers(const NeuralNetworkOptions& options) noexcept : _update_weights_pool(nullptr) { @@ -754,3 +757,5 @@ void Layers::cache_recurrent_weights() layer->cache_recurrent_weights(); } } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/layers.h b/include/neuralnetwork/layers/layers.h similarity index 95% rename from src/neuralnetwork/layers.h rename to include/neuralnetwork/layers/layers.h index 18cd274c..c8680d65 100644 --- a/src/neuralnetwork/layers.h +++ b/include/neuralnetwork/layers/layers.h @@ -1,17 +1,20 @@ -#pragma once +#pragma once #include #include -#include "gradientsandoutputs.h" +#include "../common/gradientsandoutputs.h" #include "layer.h" #include "layerdetails.h" -#include "logger.h" +#include "../common/logger.h" #include "multioutputlayerdetails.h" -#include "neuralnetworkoptions.h" -#include "optimiser.h" +#include "../neuralnetworkoptions.h" +#include "../common/optimiser.h" #include "residualprojector.h" -#include "taskqueue.h" +#include "../common/taskqueue.h" + +namespace myoddweb::nn +{ class Layers { public: @@ -154,4 +157,5 @@ class Layers mutable std::shared_mutex _mutex; TaskQueuePool* _update_weights_pool; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/lstmlayer.cpp b/include/neuralnetwork/layers/lstmlayer.cpp similarity index 99% rename from src/neuralnetwork/lstmlayer.cpp rename to include/neuralnetwork/layers/lstmlayer.cpp index 7fe986b2..ee7bf5d2 100644 --- a/src/neuralnetwork/lstmlayer.cpp +++ b/include/neuralnetwork/layers/lstmlayer.cpp @@ -1,11 +1,14 @@ -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" #include "lstmlayer.h" #include "fflayer.h" -#include "simd_utils.h" -#include "logger.h" +#include "../common/simd_utils.h" +#include "../common/logger.h" #include #include + +namespace myoddweb::nn +{ LSTMLayer::LSTMLayer(unsigned layer_index, unsigned num_neurons_in_previous_layer, unsigned num_neurons_in_this_layer, @@ -1409,3 +1412,5 @@ void LSTMLayer::set_rw_decays(const std::vector& v) _rw_decays = v; } } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/lstmlayer.h b/include/neuralnetwork/layers/lstmlayer.h similarity index 99% rename from src/neuralnetwork/lstmlayer.h rename to include/neuralnetwork/layers/lstmlayer.h index ca9db212..efc398ca 100644 --- a/src/neuralnetwork/lstmlayer.h +++ b/include/neuralnetwork/layers/lstmlayer.h @@ -1,11 +1,14 @@ -#pragma once -#include "aligned_allocator.h" -#include "errorcalculation.h" -#include "hiddenstate.h" +#pragma once +#include "../common/aligned_allocator.h" +#include "../helpers/errorcalculation.h" +#include "../common/hiddenstate.h" #include "layer.h" #include + +namespace myoddweb::nn +{ class LSTMLayer final : public Layer { protected: @@ -1066,3 +1069,5 @@ class LSTMLayer final : public Layer std::vector> _thread_workspaces; }; + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/multioutputlayer.h b/include/neuralnetwork/layers/multioutputlayer.h similarity index 99% rename from src/neuralnetwork/multioutputlayer.h rename to include/neuralnetwork/layers/multioutputlayer.h index da716bcc..706d12dc 100644 --- a/src/neuralnetwork/multioutputlayer.h +++ b/include/neuralnetwork/layers/multioutputlayer.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "elmanrnnlayer.h" #include "fflayer.h" @@ -17,6 +17,9 @@ * A minimal layer implementation to act as a source for branch layers. * Branch layers expect their input from index 0 of the branch's internal buffers. */ + +namespace myoddweb::nn +{ class MultiInputProxyLayer final : public Layer { public: @@ -875,4 +878,5 @@ class MultiOutputLayer final : public Layer, public OutputLayer std::vector _branches; mutable std::mutex _mutex; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/multioutputlayerdetails.h b/include/neuralnetwork/layers/multioutputlayerdetails.h similarity index 94% rename from src/neuralnetwork/multioutputlayerdetails.h rename to include/neuralnetwork/layers/multioutputlayerdetails.h index b0162c52..39a4ff2e 100644 --- a/src/neuralnetwork/multioutputlayerdetails.h +++ b/include/neuralnetwork/layers/multioutputlayerdetails.h @@ -1,14 +1,17 @@ -#pragma once +#pragma once -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" -#include "logger.h" +#include "../common/logger.h" #include "layerdetails.h" #include "outputlayerdetails.h" #include + +namespace myoddweb::nn +{ class MultiOutputLayerDetails { @@ -88,4 +91,5 @@ class MultiOutputLayerDetails private: std::vector _hidden_layers; OutputLayerDetails _output_details; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/outputlayer.h b/include/neuralnetwork/layers/outputlayer.h similarity index 96% rename from src/neuralnetwork/outputlayer.h rename to include/neuralnetwork/layers/outputlayer.h index d1441e30..c39ea221 100644 --- a/src/neuralnetwork/outputlayer.h +++ b/include/neuralnetwork/layers/outputlayer.h @@ -1,10 +1,13 @@ -#pragma once +#pragma once -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" -#include "evaluationconfig.h" +#include "../common/evaluationconfig.h" #include "outputlayerdetails.h" + +namespace myoddweb::nn +{ class OutputLayer { public: @@ -149,4 +152,5 @@ class OutputLayer std::vector _output_layer_details; std::vector _bounds; unsigned _number_output_layers; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/outputlayerdetails.h b/include/neuralnetwork/layers/outputlayerdetails.h similarity index 94% rename from src/neuralnetwork/outputlayerdetails.h rename to include/neuralnetwork/layers/outputlayerdetails.h index 847c86c1..47fd6b4b 100644 --- a/src/neuralnetwork/outputlayerdetails.h +++ b/include/neuralnetwork/layers/outputlayerdetails.h @@ -1,12 +1,15 @@ -#pragma once +#pragma once -#include "./libraries/instrumentor.h" +#include "../libraries/instrumentor.h" -#include "activation.h" -#include "errorcalculation.h" -#include "evaluationconfig.h" -#include "optimiser.h" +#include "../common/activation.h" +#include "../helpers/errorcalculation.h" +#include "../common/evaluationconfig.h" +#include "../common/optimiser.h" + +namespace myoddweb::nn +{ class OutputLayerDetails { public: @@ -143,4 +146,5 @@ class OutputLayerDetails double _weight_decay; OptimiserType _optimiser_type; double _momentum; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/residualprojector.h b/include/neuralnetwork/layers/residualprojector.h similarity index 98% rename from src/neuralnetwork/residualprojector.h rename to include/neuralnetwork/layers/residualprojector.h index 30e5657c..ea38760d 100644 --- a/src/neuralnetwork/residualprojector.h +++ b/include/neuralnetwork/layers/residualprojector.h @@ -1,12 +1,15 @@ -#pragma once +#pragma once #include -#include "libraries/instrumentor.h" +#include "../libraries/instrumentor.h" -#include "activation.h" -#include "weightparam.h" +#include "../common/activation.h" +#include "../common/weightparam.h" + +namespace myoddweb::nn +{ class ResidualProjector { public: @@ -313,4 +316,5 @@ class ResidualProjector mutable std::vector> _cached_weights; mutable bool _weights_cache_dirty; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/libraries/TinyJSON.cpp b/include/neuralnetwork/libraries/TinyJSON.cpp similarity index 99% rename from src/neuralnetwork/libraries/TinyJSON.cpp rename to include/neuralnetwork/libraries/TinyJSON.cpp index 7cc2a676..75d36e78 100644 --- a/src/neuralnetwork/libraries/TinyJSON.cpp +++ b/include/neuralnetwork/libraries/TinyJSON.cpp @@ -1,4 +1,4 @@ -// Licensed to Florent Guelfucci under one or more agreements. +// Licensed to Florent Guelfucci under one or more agreements. // Florent Guelfucci licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "TinyJSON.h" diff --git a/src/neuralnetwork/libraries/TinyJSON.h b/include/neuralnetwork/libraries/TinyJSON.h similarity index 99% rename from src/neuralnetwork/libraries/TinyJSON.h rename to include/neuralnetwork/libraries/TinyJSON.h index b6c7d8fa..b6c4b036 100644 --- a/src/neuralnetwork/libraries/TinyJSON.h +++ b/include/neuralnetwork/libraries/TinyJSON.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once // Licensed to Florent Guelfucci under one or more agreements. // Florent Guelfucci licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/neuralnetwork/libraries/instrumentor.h b/include/neuralnetwork/libraries/instrumentor.h similarity index 98% rename from src/neuralnetwork/libraries/instrumentor.h rename to include/neuralnetwork/libraries/instrumentor.h index bb48af5a..b3c4ab94 100644 --- a/src/neuralnetwork/libraries/instrumentor.h +++ b/include/neuralnetwork/libraries/instrumentor.h @@ -1,10 +1,10 @@ -// Licensed to Florent Guelfucci under one or more agreements. +// Licensed to Florent Guelfucci under one or more agreements. // Florent Guelfucci licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #pragma once #ifdef TRACY_ENABLE #if MYODDWEB_PROFILE - #include "../libraries/tracy/tracy/Tracy.hpp" + #include "tracy/tracy/Tracy.hpp" #define MYODDWEB_PROFILE_BEGIN_SESSION(name, filepath) #define MYODDWEB_PROFILE_END_SESSION() FrameMark #define MYODDWEB_PROFILE_SCOPE(name, category) diff --git a/src/neuralnetwork/libraries/tracy/TracyClient.F90 b/include/neuralnetwork/libraries/tracy/TracyClient.F90 similarity index 100% rename from src/neuralnetwork/libraries/tracy/TracyClient.F90 rename to include/neuralnetwork/libraries/tracy/TracyClient.F90 diff --git a/src/neuralnetwork/libraries/tracy/TracyClient.cpp b/include/neuralnetwork/libraries/tracy/TracyClient.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/TracyClient.cpp rename to include/neuralnetwork/libraries/tracy/TracyClient.cpp index 8e669759..34f6c56b 100644 --- a/src/neuralnetwork/libraries/tracy/TracyClient.cpp +++ b/include/neuralnetwork/libraries/tracy/TracyClient.cpp @@ -1,4 +1,4 @@ -// +// // Tracy profiler // ---------------- // diff --git a/src/neuralnetwork/libraries/tracy/client/TracyAlloc.cpp b/include/neuralnetwork/libraries/tracy/client/TracyAlloc.cpp similarity index 96% rename from src/neuralnetwork/libraries/tracy/client/TracyAlloc.cpp rename to include/neuralnetwork/libraries/tracy/client/TracyAlloc.cpp index c675b6d3..76f7914d 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyAlloc.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyAlloc.cpp @@ -1,4 +1,4 @@ -#include "../common/TracyAlloc.hpp" +#include "../common/TracyAlloc.hpp" #ifdef TRACY_USE_RPMALLOC diff --git a/src/neuralnetwork/libraries/tracy/client/TracyArmCpuTable.hpp b/include/neuralnetwork/libraries/tracy/client/TracyArmCpuTable.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyArmCpuTable.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyArmCpuTable.hpp index 2b47c3a6..bcc62773 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyArmCpuTable.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyArmCpuTable.hpp @@ -1,4 +1,4 @@ -namespace tracy +namespace tracy { #if defined __linux__ && defined __ARM_ARCH diff --git a/src/neuralnetwork/libraries/tracy/client/TracyCallstack.cpp b/include/neuralnetwork/libraries/tracy/client/TracyCallstack.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyCallstack.cpp rename to include/neuralnetwork/libraries/tracy/client/TracyCallstack.cpp index 7ab6b1c4..f00226c0 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyCallstack.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyCallstack.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracyCallstack.h b/include/neuralnetwork/libraries/tracy/client/TracyCallstack.h similarity index 96% rename from src/neuralnetwork/libraries/tracy/client/TracyCallstack.h rename to include/neuralnetwork/libraries/tracy/client/TracyCallstack.h index 2df15420..0f890fca 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyCallstack.h +++ b/include/neuralnetwork/libraries/tracy/client/TracyCallstack.h @@ -1,4 +1,4 @@ -#ifndef __TRACYCALLSTACK_H__ +#ifndef __TRACYCALLSTACK_H__ #define __TRACYCALLSTACK_H__ #ifndef TRACY_NO_CALLSTACK diff --git a/src/neuralnetwork/libraries/tracy/client/TracyCallstack.hpp b/include/neuralnetwork/libraries/tracy/client/TracyCallstack.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyCallstack.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyCallstack.hpp index 7d8ed6e6..bb361c61 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyCallstack.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyCallstack.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYCALLSTACK_HPP__ +#ifndef __TRACYCALLSTACK_HPP__ #define __TRACYCALLSTACK_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracyCpuid.hpp b/include/neuralnetwork/libraries/tracy/client/TracyCpuid.hpp similarity index 93% rename from src/neuralnetwork/libraries/tracy/client/TracyCpuid.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyCpuid.hpp index 9820be00..93d021b4 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyCpuid.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyCpuid.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYCPUID_HPP__ +#ifndef __TRACYCPUID_HPP__ #define __TRACYCPUID_HPP__ // Prior to GCC 11 the cpuid.h header did not have any include guards and thus diff --git a/src/neuralnetwork/libraries/tracy/client/TracyDebug.hpp b/include/neuralnetwork/libraries/tracy/client/TracyDebug.hpp similarity index 85% rename from src/neuralnetwork/libraries/tracy/client/TracyDebug.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyDebug.hpp index 8723356f..1393d02d 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyDebug.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyDebug.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYPRINT_HPP__ +#ifndef __TRACYPRINT_HPP__ #define __TRACYPRINT_HPP__ #ifdef TRACY_VERBOSE diff --git a/src/neuralnetwork/libraries/tracy/client/TracyDxt1.cpp b/include/neuralnetwork/libraries/tracy/client/TracyDxt1.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyDxt1.cpp rename to include/neuralnetwork/libraries/tracy/client/TracyDxt1.cpp index 930d0982..8456acf9 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyDxt1.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyDxt1.cpp @@ -1,4 +1,4 @@ -#include "TracyDxt1.hpp" +#include "TracyDxt1.hpp" #include "../common/TracyForceInline.hpp" #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracyDxt1.hpp b/include/neuralnetwork/libraries/tracy/client/TracyDxt1.hpp similarity index 81% rename from src/neuralnetwork/libraries/tracy/client/TracyDxt1.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyDxt1.hpp index c2313542..965d3390 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyDxt1.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyDxt1.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYDXT1_HPP__ +#ifndef __TRACYDXT1_HPP__ #define __TRACYDXT1_HPP__ namespace tracy diff --git a/src/neuralnetwork/libraries/tracy/client/TracyFastVector.hpp b/include/neuralnetwork/libraries/tracy/client/TracyFastVector.hpp similarity index 98% rename from src/neuralnetwork/libraries/tracy/client/TracyFastVector.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyFastVector.hpp index 38accc92..d4b4af75 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyFastVector.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyFastVector.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYFASTVECTOR_HPP__ +#ifndef __TRACYFASTVECTOR_HPP__ #define __TRACYFASTVECTOR_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracyKCore.cpp b/include/neuralnetwork/libraries/tracy/client/TracyKCore.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyKCore.cpp rename to include/neuralnetwork/libraries/tracy/client/TracyKCore.cpp index 09d51d11..18630b5e 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyKCore.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyKCore.cpp @@ -1,4 +1,4 @@ -#ifdef __linux__ +#ifdef __linux__ #include #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracyKCore.hpp b/include/neuralnetwork/libraries/tracy/client/TracyKCore.hpp similarity index 93% rename from src/neuralnetwork/libraries/tracy/client/TracyKCore.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyKCore.hpp index 437e172c..c29b21b2 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyKCore.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyKCore.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYKCORE_HPP__ +#ifndef __TRACYKCORE_HPP__ #define __TRACYKCORE_HPP__ #ifdef __linux__ diff --git a/src/neuralnetwork/libraries/tracy/client/TracyLock.hpp b/include/neuralnetwork/libraries/tracy/client/TracyLock.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyLock.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyLock.hpp index e00b344a..de2eb06f 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyLock.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyLock.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYLOCK_HPP__ +#ifndef __TRACYLOCK_HPP__ #define __TRACYLOCK_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracyOverride.cpp b/include/neuralnetwork/libraries/tracy/client/TracyOverride.cpp similarity index 95% rename from src/neuralnetwork/libraries/tracy/client/TracyOverride.cpp rename to include/neuralnetwork/libraries/tracy/client/TracyOverride.cpp index 591508a7..0216fab4 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyOverride.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyOverride.cpp @@ -1,4 +1,4 @@ -#ifdef TRACY_ENABLE +#ifdef TRACY_ENABLE # ifdef __linux__ # include "TracyDebug.hpp" # ifdef TRACY_VERBOSE diff --git a/src/neuralnetwork/libraries/tracy/client/TracyProfiler.cpp b/include/neuralnetwork/libraries/tracy/client/TracyProfiler.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyProfiler.cpp rename to include/neuralnetwork/libraries/tracy/client/TracyProfiler.cpp index 0691f78e..395a1394 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyProfiler.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyProfiler.cpp @@ -1,4 +1,4 @@ -#ifdef TRACY_ENABLE +#ifdef TRACY_ENABLE #ifdef _WIN32 # ifndef NOMINMAX diff --git a/src/neuralnetwork/libraries/tracy/client/TracyProfiler.hpp b/include/neuralnetwork/libraries/tracy/client/TracyProfiler.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyProfiler.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyProfiler.hpp index aacfa16b..7c143434 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyProfiler.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyProfiler.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYPROFILER_HPP__ +#ifndef __TRACYPROFILER_HPP__ #define __TRACYPROFILER_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracyRingBuffer.hpp b/include/neuralnetwork/libraries/tracy/client/TracyRingBuffer.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyRingBuffer.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyRingBuffer.hpp index e9100e2d..395dad8a 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyRingBuffer.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyRingBuffer.hpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracyRocprof.cpp b/include/neuralnetwork/libraries/tracy/client/TracyRocprof.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyRocprof.cpp rename to include/neuralnetwork/libraries/tracy/client/TracyRocprof.cpp index 370e42ec..5f5d7cc4 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyRocprof.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyRocprof.cpp @@ -1,4 +1,4 @@ -#include "../server/tracy_robin_hood.h" +#include "../server/tracy_robin_hood.h" #include "TracyProfiler.hpp" #include "TracyThread.hpp" #include "tracy/TracyC.h" diff --git a/src/neuralnetwork/libraries/tracy/client/TracyScoped.hpp b/include/neuralnetwork/libraries/tracy/client/TracyScoped.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracyScoped.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyScoped.hpp index c2f7eda0..136f4837 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyScoped.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyScoped.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYSCOPED_HPP__ +#ifndef __TRACYSCOPED_HPP__ #define __TRACYSCOPED_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracyStringHelpers.hpp b/include/neuralnetwork/libraries/tracy/client/TracyStringHelpers.hpp similarity index 95% rename from src/neuralnetwork/libraries/tracy/client/TracyStringHelpers.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyStringHelpers.hpp index 977be6a3..f534217a 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyStringHelpers.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyStringHelpers.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYSTRINGHELPERS_HPP__ +#ifndef __TRACYSTRINGHELPERS_HPP__ #define __TRACYSTRINGHELPERS_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/client/TracySysPower.cpp b/include/neuralnetwork/libraries/tracy/client/TracySysPower.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracySysPower.cpp rename to include/neuralnetwork/libraries/tracy/client/TracySysPower.cpp index 6ad1d647..18a004f1 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracySysPower.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracySysPower.cpp @@ -1,4 +1,4 @@ -#include "TracySysPower.hpp" +#include "TracySysPower.hpp" #ifdef TRACY_HAS_SYSPOWER diff --git a/src/neuralnetwork/libraries/tracy/client/TracySysPower.hpp b/include/neuralnetwork/libraries/tracy/client/TracySysPower.hpp similarity index 94% rename from src/neuralnetwork/libraries/tracy/client/TracySysPower.hpp rename to include/neuralnetwork/libraries/tracy/client/TracySysPower.hpp index 210123bc..a5bd7542 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracySysPower.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracySysPower.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYSYSPOWER_HPP__ +#ifndef __TRACYSYSPOWER_HPP__ #define __TRACYSYSPOWER_HPP__ #if defined __linux__ diff --git a/src/neuralnetwork/libraries/tracy/client/TracySysTime.cpp b/include/neuralnetwork/libraries/tracy/client/TracySysTime.cpp similarity index 98% rename from src/neuralnetwork/libraries/tracy/client/TracySysTime.cpp rename to include/neuralnetwork/libraries/tracy/client/TracySysTime.cpp index cf7dd9b1..96a0ea50 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracySysTime.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracySysTime.cpp @@ -1,4 +1,4 @@ -#include "TracySysTime.hpp" +#include "TracySysTime.hpp" #ifdef TRACY_HAS_SYSTIME diff --git a/src/neuralnetwork/libraries/tracy/client/TracySysTime.hpp b/include/neuralnetwork/libraries/tracy/client/TracySysTime.hpp similarity index 92% rename from src/neuralnetwork/libraries/tracy/client/TracySysTime.hpp rename to include/neuralnetwork/libraries/tracy/client/TracySysTime.hpp index cb5ebe73..1e58bae5 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracySysTime.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracySysTime.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYSYSTIME_HPP__ +#ifndef __TRACYSYSTIME_HPP__ #define __TRACYSYSTIME_HPP__ #if defined _WIN32 || defined __linux__ || defined __APPLE__ diff --git a/src/neuralnetwork/libraries/tracy/client/TracySysTrace.cpp b/include/neuralnetwork/libraries/tracy/client/TracySysTrace.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/TracySysTrace.cpp rename to include/neuralnetwork/libraries/tracy/client/TracySysTrace.cpp index 1dd94774..97f44778 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracySysTrace.cpp +++ b/include/neuralnetwork/libraries/tracy/client/TracySysTrace.cpp @@ -1,4 +1,4 @@ -#include "TracyDebug.hpp" +#include "TracyDebug.hpp" #include "TracyStringHelpers.hpp" #include "TracySysTrace.hpp" #include "../common/TracySystem.hpp" diff --git a/src/neuralnetwork/libraries/tracy/client/TracySysTrace.hpp b/include/neuralnetwork/libraries/tracy/client/TracySysTrace.hpp similarity index 94% rename from src/neuralnetwork/libraries/tracy/client/TracySysTrace.hpp rename to include/neuralnetwork/libraries/tracy/client/TracySysTrace.hpp index 2a28e8b8..fe1f6e23 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracySysTrace.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracySysTrace.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYSYSTRACE_HPP__ +#ifndef __TRACYSYSTRACE_HPP__ #define __TRACYSYSTRACE_HPP__ #if !defined TRACY_NO_SYSTEM_TRACING && ( defined _WIN32 || defined __linux__ ) diff --git a/src/neuralnetwork/libraries/tracy/client/TracyThread.hpp b/include/neuralnetwork/libraries/tracy/client/TracyThread.hpp similarity index 98% rename from src/neuralnetwork/libraries/tracy/client/TracyThread.hpp rename to include/neuralnetwork/libraries/tracy/client/TracyThread.hpp index 5638756a..ee89f662 100644 --- a/src/neuralnetwork/libraries/tracy/client/TracyThread.hpp +++ b/include/neuralnetwork/libraries/tracy/client/TracyThread.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYTHREAD_HPP__ +#ifndef __TRACYTHREAD_HPP__ #define __TRACYTHREAD_HPP__ #if defined _WIN32 diff --git a/src/neuralnetwork/libraries/tracy/client/tracy_SPSCQueue.h b/include/neuralnetwork/libraries/tracy/client/tracy_SPSCQueue.h similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/tracy_SPSCQueue.h rename to include/neuralnetwork/libraries/tracy/client/tracy_SPSCQueue.h index 7f1752b5..2871db0d 100644 --- a/src/neuralnetwork/libraries/tracy/client/tracy_SPSCQueue.h +++ b/include/neuralnetwork/libraries/tracy/client/tracy_SPSCQueue.h @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2020 Erik Rigtorp Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/src/neuralnetwork/libraries/tracy/client/tracy_concurrentqueue.h b/include/neuralnetwork/libraries/tracy/client/tracy_concurrentqueue.h similarity index 100% rename from src/neuralnetwork/libraries/tracy/client/tracy_concurrentqueue.h rename to include/neuralnetwork/libraries/tracy/client/tracy_concurrentqueue.h diff --git a/src/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.cpp b/include/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.cpp rename to include/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.cpp index c43b8cab..043b2016 100644 --- a/src/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.cpp +++ b/include/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.cpp @@ -1,4 +1,4 @@ -#ifdef TRACY_ENABLE +#ifdef TRACY_ENABLE /* rpmalloc.c - Memory allocator - Public Domain - 2016-2020 Mattias Jansson * diff --git a/src/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.hpp b/include/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.hpp rename to include/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.hpp index 51216a21..170f37ae 100644 --- a/src/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.hpp +++ b/include/neuralnetwork/libraries/tracy/client/tracy_rpmalloc.hpp @@ -1,4 +1,4 @@ -/* rpmalloc.h - Memory allocator - Public Domain - 2016 Mattias Jansson +/* rpmalloc.h - Memory allocator - Public Domain - 2016 Mattias Jansson * * This library provides a cross-platform lock free thread caching malloc implementation in C11. * The latest source code is always available at diff --git a/src/neuralnetwork/libraries/tracy/common/TracyAlign.hpp b/include/neuralnetwork/libraries/tracy/common/TracyAlign.hpp similarity index 92% rename from src/neuralnetwork/libraries/tracy/common/TracyAlign.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyAlign.hpp index c3531ba0..f1ca0a8e 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyAlign.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyAlign.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYALIGN_HPP__ +#ifndef __TRACYALIGN_HPP__ #define __TRACYALIGN_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/common/TracyAlloc.hpp b/include/neuralnetwork/libraries/tracy/common/TracyAlloc.hpp similarity index 97% rename from src/neuralnetwork/libraries/tracy/common/TracyAlloc.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyAlloc.hpp index ddb0e5df..73a7a9da 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyAlloc.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyAlloc.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYALLOC_HPP__ +#ifndef __TRACYALLOC_HPP__ #define __TRACYALLOC_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/common/TracyApi.h b/include/neuralnetwork/libraries/tracy/common/TracyApi.h similarity index 92% rename from src/neuralnetwork/libraries/tracy/common/TracyApi.h rename to include/neuralnetwork/libraries/tracy/common/TracyApi.h index f396ce0c..133c6944 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyApi.h +++ b/include/neuralnetwork/libraries/tracy/common/TracyApi.h @@ -1,4 +1,4 @@ -#ifndef __TRACYAPI_H__ +#ifndef __TRACYAPI_H__ #define __TRACYAPI_H__ #if defined _WIN32 diff --git a/src/neuralnetwork/libraries/tracy/common/TracyColor.hpp b/include/neuralnetwork/libraries/tracy/common/TracyColor.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/TracyColor.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyColor.hpp index 4825c0fb..5631539d 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyColor.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyColor.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYCOLOR_HPP__ +#ifndef __TRACYCOLOR_HPP__ #define __TRACYCOLOR_HPP__ namespace tracy diff --git a/src/neuralnetwork/libraries/tracy/common/TracyForceInline.hpp b/include/neuralnetwork/libraries/tracy/common/TracyForceInline.hpp similarity index 92% rename from src/neuralnetwork/libraries/tracy/common/TracyForceInline.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyForceInline.hpp index b6a5833e..6a3e9790 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyForceInline.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyForceInline.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYFORCEINLINE_HPP__ +#ifndef __TRACYFORCEINLINE_HPP__ #define __TRACYFORCEINLINE_HPP__ #if defined(__GNUC__) diff --git a/src/neuralnetwork/libraries/tracy/common/TracyMutex.hpp b/include/neuralnetwork/libraries/tracy/common/TracyMutex.hpp similarity index 88% rename from src/neuralnetwork/libraries/tracy/common/TracyMutex.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyMutex.hpp index 57fb01a0..7f17be1f 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyMutex.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyMutex.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYMUTEX_HPP__ +#ifndef __TRACYMUTEX_HPP__ #define __TRACYMUTEX_HPP__ #if defined _MSC_VER diff --git a/src/neuralnetwork/libraries/tracy/common/TracyProtocol.hpp b/include/neuralnetwork/libraries/tracy/common/TracyProtocol.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/TracyProtocol.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyProtocol.hpp index 8174d932..c392d68f 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyProtocol.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyProtocol.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYPROTOCOL_HPP__ +#ifndef __TRACYPROTOCOL_HPP__ #define __TRACYPROTOCOL_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/common/TracyQueue.hpp b/include/neuralnetwork/libraries/tracy/common/TracyQueue.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/TracyQueue.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyQueue.hpp index 765c83c7..82ed8597 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyQueue.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyQueue.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYQUEUE_HPP__ +#ifndef __TRACYQUEUE_HPP__ #define __TRACYQUEUE_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/common/TracySocket.cpp b/include/neuralnetwork/libraries/tracy/common/TracySocket.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/TracySocket.cpp rename to include/neuralnetwork/libraries/tracy/common/TracySocket.cpp index bdba3619..5bdbe181 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracySocket.cpp +++ b/include/neuralnetwork/libraries/tracy/common/TracySocket.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/src/neuralnetwork/libraries/tracy/common/TracySocket.hpp b/include/neuralnetwork/libraries/tracy/common/TracySocket.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/TracySocket.hpp rename to include/neuralnetwork/libraries/tracy/common/TracySocket.hpp index f7713aac..762c951f 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracySocket.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracySocket.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYSOCKET_HPP__ +#ifndef __TRACYSOCKET_HPP__ #define __TRACYSOCKET_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/common/TracyStackFrames.cpp b/include/neuralnetwork/libraries/tracy/common/TracyStackFrames.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/TracyStackFrames.cpp rename to include/neuralnetwork/libraries/tracy/common/TracyStackFrames.cpp index 7b0abace..6ce6a7bc 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyStackFrames.cpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyStackFrames.cpp @@ -1,4 +1,4 @@ -#include "TracyStackFrames.hpp" +#include "TracyStackFrames.hpp" namespace tracy { diff --git a/src/neuralnetwork/libraries/tracy/common/TracyStackFrames.hpp b/include/neuralnetwork/libraries/tracy/common/TracyStackFrames.hpp similarity index 88% rename from src/neuralnetwork/libraries/tracy/common/TracyStackFrames.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyStackFrames.hpp index 9d4262c0..29ebf0cd 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyStackFrames.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyStackFrames.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYSTACKFRAMES_HPP__ +#ifndef __TRACYSTACKFRAMES_HPP__ #define __TRACYSTACKFRAMES_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/common/TracySystem.cpp b/include/neuralnetwork/libraries/tracy/common/TracySystem.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/TracySystem.cpp rename to include/neuralnetwork/libraries/tracy/common/TracySystem.cpp index 7696ca32..ca9cd0fd 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracySystem.cpp +++ b/include/neuralnetwork/libraries/tracy/common/TracySystem.cpp @@ -1,4 +1,4 @@ -#ifdef _MSC_VER +#ifdef _MSC_VER # pragma warning(disable:4996) #endif #if defined _WIN32 diff --git a/src/neuralnetwork/libraries/tracy/common/TracySystem.hpp b/include/neuralnetwork/libraries/tracy/common/TracySystem.hpp similarity index 95% rename from src/neuralnetwork/libraries/tracy/common/TracySystem.hpp rename to include/neuralnetwork/libraries/tracy/common/TracySystem.hpp index 2f565e9a..dab92f74 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracySystem.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracySystem.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYSYSTEM_HPP__ +#ifndef __TRACYSYSTEM_HPP__ #define __TRACYSYSTEM_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/common/TracyUwp.hpp b/include/neuralnetwork/libraries/tracy/common/TracyUwp.hpp similarity index 88% rename from src/neuralnetwork/libraries/tracy/common/TracyUwp.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyUwp.hpp index 7dce96b9..9a73f366 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyUwp.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyUwp.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYUWP_HPP__ +#ifndef __TRACYUWP_HPP__ #define __TRACYUWP_HPP__ #ifdef _WIN32 diff --git a/src/neuralnetwork/libraries/tracy/common/TracyVersion.hpp b/include/neuralnetwork/libraries/tracy/common/TracyVersion.hpp similarity index 81% rename from src/neuralnetwork/libraries/tracy/common/TracyVersion.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyVersion.hpp index 6dde8cf8..cdb3b726 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyVersion.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyVersion.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYVERSION_HPP__ +#ifndef __TRACYVERSION_HPP__ #define __TRACYVERSION_HPP__ namespace tracy diff --git a/src/neuralnetwork/libraries/tracy/common/TracyWinFamily.hpp b/include/neuralnetwork/libraries/tracy/common/TracyWinFamily.hpp similarity index 91% rename from src/neuralnetwork/libraries/tracy/common/TracyWinFamily.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyWinFamily.hpp index b601455c..6398cef2 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyWinFamily.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyWinFamily.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYWINFAMILY_HPP__ +#ifndef __TRACYWINFAMILY_HPP__ #define __TRACYWINFAMILY_HPP__ #ifdef _WIN32 diff --git a/src/neuralnetwork/libraries/tracy/common/TracyYield.hpp b/include/neuralnetwork/libraries/tracy/common/TracyYield.hpp similarity index 94% rename from src/neuralnetwork/libraries/tracy/common/TracyYield.hpp rename to include/neuralnetwork/libraries/tracy/common/TracyYield.hpp index 035836cd..766b540f 100644 --- a/src/neuralnetwork/libraries/tracy/common/TracyYield.hpp +++ b/include/neuralnetwork/libraries/tracy/common/TracyYield.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYYIELD_HPP__ +#ifndef __TRACYYIELD_HPP__ #define __TRACYYIELD_HPP__ #if defined __SSE2__ || defined _M_AMD64 || (defined _M_IX86_FP && _M_IX86_FP == 2) diff --git a/src/neuralnetwork/libraries/tracy/common/tracy_lz4.cpp b/include/neuralnetwork/libraries/tracy/common/tracy_lz4.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/tracy_lz4.cpp rename to include/neuralnetwork/libraries/tracy/common/tracy_lz4.cpp index 15d0990f..423bf74c 100644 --- a/src/neuralnetwork/libraries/tracy/common/tracy_lz4.cpp +++ b/include/neuralnetwork/libraries/tracy/common/tracy_lz4.cpp @@ -1,4 +1,4 @@ -/* +/* LZ4 - Fast LZ compression algorithm Copyright (C) 2011-2020, Yann Collet. diff --git a/src/neuralnetwork/libraries/tracy/common/tracy_lz4.hpp b/include/neuralnetwork/libraries/tracy/common/tracy_lz4.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/tracy_lz4.hpp rename to include/neuralnetwork/libraries/tracy/common/tracy_lz4.hpp index 672c2feb..4668e4cd 100644 --- a/src/neuralnetwork/libraries/tracy/common/tracy_lz4.hpp +++ b/include/neuralnetwork/libraries/tracy/common/tracy_lz4.hpp @@ -1,4 +1,4 @@ -/* +/* * LZ4 - Fast LZ compression algorithm * Header File * Copyright (C) 2011-2020, Yann Collet. diff --git a/src/neuralnetwork/libraries/tracy/common/tracy_lz4hc.cpp b/include/neuralnetwork/libraries/tracy/common/tracy_lz4hc.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/tracy_lz4hc.cpp rename to include/neuralnetwork/libraries/tracy/common/tracy_lz4hc.cpp index eec7239e..e799345d 100644 --- a/src/neuralnetwork/libraries/tracy/common/tracy_lz4hc.cpp +++ b/include/neuralnetwork/libraries/tracy/common/tracy_lz4hc.cpp @@ -1,4 +1,4 @@ -/* +/* LZ4 HC - High Compression Mode of LZ4 Copyright (C) 2011-2020, Yann Collet. diff --git a/src/neuralnetwork/libraries/tracy/common/tracy_lz4hc.hpp b/include/neuralnetwork/libraries/tracy/common/tracy_lz4hc.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/common/tracy_lz4hc.hpp rename to include/neuralnetwork/libraries/tracy/common/tracy_lz4hc.hpp index 460cbae7..f4e025a0 100644 --- a/src/neuralnetwork/libraries/tracy/common/tracy_lz4hc.hpp +++ b/include/neuralnetwork/libraries/tracy/common/tracy_lz4hc.hpp @@ -1,4 +1,4 @@ -/* +/* LZ4 HC - High Compression Mode of LZ4 Header File Copyright (C) 2011-2020, Yann Collet. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/LICENSE b/include/neuralnetwork/libraries/tracy/libbacktrace/LICENSE similarity index 100% rename from src/neuralnetwork/libraries/tracy/libbacktrace/LICENSE rename to include/neuralnetwork/libraries/tracy/libbacktrace/LICENSE diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/alloc.cpp b/include/neuralnetwork/libraries/tracy/libbacktrace/alloc.cpp similarity index 98% rename from src/neuralnetwork/libraries/tracy/libbacktrace/alloc.cpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/alloc.cpp index a365a486..1e4df8f3 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/alloc.cpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/alloc.cpp @@ -1,4 +1,4 @@ -/* alloc.c -- Memory allocation without mmap. +/* alloc.c -- Memory allocation without mmap. Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/backtrace.hpp b/include/neuralnetwork/libraries/tracy/libbacktrace/backtrace.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/libbacktrace/backtrace.hpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/backtrace.hpp index e4be297a..eedd22e2 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/backtrace.hpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/backtrace.hpp @@ -1,4 +1,4 @@ -/* backtrace.h -- Public header file for stack backtrace library. +/* backtrace.h -- Public header file for stack backtrace library. Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/config.h b/include/neuralnetwork/libraries/tracy/libbacktrace/config.h similarity index 96% rename from src/neuralnetwork/libraries/tracy/libbacktrace/config.h rename to include/neuralnetwork/libraries/tracy/libbacktrace/config.h index 87e38a95..b80ecd49 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/config.h +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/config.h @@ -1,4 +1,4 @@ -#include +#include #if defined(__linux__) && !defined(__GLIBC__) && !defined(__WORDSIZE) // include __WORDSIZE headers for musl # include diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/dwarf.cpp b/include/neuralnetwork/libraries/tracy/libbacktrace/dwarf.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/libbacktrace/dwarf.cpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/dwarf.cpp index 52fa8a8d..6ed569e5 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/dwarf.cpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/dwarf.cpp @@ -1,4 +1,4 @@ -/* dwarf.c -- Get file/line information from DWARF for backtraces. +/* dwarf.c -- Get file/line information from DWARF for backtraces. Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/elf.cpp b/include/neuralnetwork/libraries/tracy/libbacktrace/elf.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/libbacktrace/elf.cpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/elf.cpp index 352b50dc..ca24a302 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/elf.cpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/elf.cpp @@ -1,4 +1,4 @@ -/* elf.c -- Get debug data from an ELF file for backtraces. +/* elf.c -- Get debug data from an ELF file for backtraces. Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/fileline.cpp b/include/neuralnetwork/libraries/tracy/libbacktrace/fileline.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/libbacktrace/fileline.cpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/fileline.cpp index 5a37ff0c..4d4acb8b 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/fileline.cpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/fileline.cpp @@ -1,4 +1,4 @@ -/* fileline.c -- Get file and line number information in a backtrace. +/* fileline.c -- Get file and line number information in a backtrace. Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/filenames.hpp b/include/neuralnetwork/libraries/tracy/libbacktrace/filenames.hpp similarity index 97% rename from src/neuralnetwork/libraries/tracy/libbacktrace/filenames.hpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/filenames.hpp index aa7bd7ad..bb278135 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/filenames.hpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/filenames.hpp @@ -1,4 +1,4 @@ -/* btest.c -- Filename header for libbacktrace library +/* btest.c -- Filename header for libbacktrace library Copyright (C) 2012-2018 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/internal.hpp b/include/neuralnetwork/libraries/tracy/libbacktrace/internal.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/libbacktrace/internal.hpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/internal.hpp index 21395975..d624bea0 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/internal.hpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/internal.hpp @@ -1,4 +1,4 @@ -/* internal.h -- Internal header file for stack backtrace library. +/* internal.h -- Internal header file for stack backtrace library. Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/macho.cpp b/include/neuralnetwork/libraries/tracy/libbacktrace/macho.cpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/libbacktrace/macho.cpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/macho.cpp index bb2e4682..e71e8de4 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/macho.cpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/macho.cpp @@ -1,4 +1,4 @@ -/* elf.c -- Get debug data from a Mach-O file for backtraces. +/* elf.c -- Get debug data from a Mach-O file for backtraces. Copyright (C) 2020-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/mmapio.cpp b/include/neuralnetwork/libraries/tracy/libbacktrace/mmapio.cpp similarity index 98% rename from src/neuralnetwork/libraries/tracy/libbacktrace/mmapio.cpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/mmapio.cpp index 0e8f599b..3a32153c 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/mmapio.cpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/mmapio.cpp @@ -1,4 +1,4 @@ -/* mmapio.c -- File views using mmap. +/* mmapio.c -- File views using mmap. Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/posix.cpp b/include/neuralnetwork/libraries/tracy/libbacktrace/posix.cpp similarity index 97% rename from src/neuralnetwork/libraries/tracy/libbacktrace/posix.cpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/posix.cpp index 8233a8ea..0e70401c 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/posix.cpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/posix.cpp @@ -1,4 +1,4 @@ -/* posix.c -- POSIX file I/O routines for the backtrace library. +/* posix.c -- POSIX file I/O routines for the backtrace library. Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/sort.cpp b/include/neuralnetwork/libraries/tracy/libbacktrace/sort.cpp similarity index 98% rename from src/neuralnetwork/libraries/tracy/libbacktrace/sort.cpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/sort.cpp index 6daee0a6..7384f78a 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/sort.cpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/sort.cpp @@ -1,4 +1,4 @@ -/* sort.c -- Sort without allocating memory +/* sort.c -- Sort without allocating memory Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/libbacktrace/state.cpp b/include/neuralnetwork/libraries/tracy/libbacktrace/state.cpp similarity index 98% rename from src/neuralnetwork/libraries/tracy/libbacktrace/state.cpp rename to include/neuralnetwork/libraries/tracy/libbacktrace/state.cpp index ea3c137c..e7815687 100644 --- a/src/neuralnetwork/libraries/tracy/libbacktrace/state.cpp +++ b/include/neuralnetwork/libraries/tracy/libbacktrace/state.cpp @@ -1,4 +1,4 @@ -/* state.c -- Create the backtrace state. +/* state.c -- Create the backtrace state. Copyright (C) 2012-2021 Free Software Foundation, Inc. Written by Ian Lance Taylor, Google. diff --git a/src/neuralnetwork/libraries/tracy/tracy/Tracy.hpp b/include/neuralnetwork/libraries/tracy/tracy/Tracy.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/tracy/Tracy.hpp rename to include/neuralnetwork/libraries/tracy/tracy/Tracy.hpp index 84813969..90eeccf7 100644 --- a/src/neuralnetwork/libraries/tracy/tracy/Tracy.hpp +++ b/include/neuralnetwork/libraries/tracy/tracy/Tracy.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACY_HPP__ +#ifndef __TRACY_HPP__ #define __TRACY_HPP__ #include "../common/TracyColor.hpp" diff --git a/src/neuralnetwork/libraries/tracy/tracy/TracyC.h b/include/neuralnetwork/libraries/tracy/tracy/TracyC.h similarity index 99% rename from src/neuralnetwork/libraries/tracy/tracy/TracyC.h rename to include/neuralnetwork/libraries/tracy/tracy/TracyC.h index e77c01f7..cc62ae7c 100644 --- a/src/neuralnetwork/libraries/tracy/tracy/TracyC.h +++ b/include/neuralnetwork/libraries/tracy/tracy/TracyC.h @@ -1,4 +1,4 @@ -#ifndef __TRACYC_HPP__ +#ifndef __TRACYC_HPP__ #define __TRACYC_HPP__ #include diff --git a/src/neuralnetwork/libraries/tracy/tracy/TracyCUDA.hpp b/include/neuralnetwork/libraries/tracy/tracy/TracyCUDA.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/tracy/TracyCUDA.hpp rename to include/neuralnetwork/libraries/tracy/tracy/TracyCUDA.hpp index 40ff55dc..f4373406 100644 --- a/src/neuralnetwork/libraries/tracy/tracy/TracyCUDA.hpp +++ b/include/neuralnetwork/libraries/tracy/tracy/TracyCUDA.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYCUDA_HPP__ +#ifndef __TRACYCUDA_HPP__ #define __TRACYCUDA_HPP__ #ifndef TRACY_ENABLE diff --git a/src/neuralnetwork/libraries/tracy/tracy/TracyD3D11.hpp b/include/neuralnetwork/libraries/tracy/tracy/TracyD3D11.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/tracy/TracyD3D11.hpp rename to include/neuralnetwork/libraries/tracy/tracy/TracyD3D11.hpp index acab3831..cf0447ca 100644 --- a/src/neuralnetwork/libraries/tracy/tracy/TracyD3D11.hpp +++ b/include/neuralnetwork/libraries/tracy/tracy/TracyD3D11.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYD3D11_HPP__ +#ifndef __TRACYD3D11_HPP__ #define __TRACYD3D11_HPP__ #ifndef TRACY_ENABLE diff --git a/src/neuralnetwork/libraries/tracy/tracy/TracyD3D12.hpp b/include/neuralnetwork/libraries/tracy/tracy/TracyD3D12.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/tracy/TracyD3D12.hpp rename to include/neuralnetwork/libraries/tracy/tracy/TracyD3D12.hpp index d36253d7..01ac612a 100644 --- a/src/neuralnetwork/libraries/tracy/tracy/TracyD3D12.hpp +++ b/include/neuralnetwork/libraries/tracy/tracy/TracyD3D12.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYD3D12_HPP__ +#ifndef __TRACYD3D12_HPP__ #define __TRACYD3D12_HPP__ #ifndef TRACY_ENABLE diff --git a/src/neuralnetwork/libraries/tracy/tracy/TracyLua.hpp b/include/neuralnetwork/libraries/tracy/tracy/TracyLua.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/tracy/TracyLua.hpp rename to include/neuralnetwork/libraries/tracy/tracy/TracyLua.hpp index f0c5c406..a2240977 100644 --- a/src/neuralnetwork/libraries/tracy/tracy/TracyLua.hpp +++ b/include/neuralnetwork/libraries/tracy/tracy/TracyLua.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYLUA_HPP__ +#ifndef __TRACYLUA_HPP__ #define __TRACYLUA_HPP__ // Include this file after you include lua headers. diff --git a/src/neuralnetwork/libraries/tracy/tracy/TracyMetal.hmm b/include/neuralnetwork/libraries/tracy/tracy/TracyMetal.hmm similarity index 100% rename from src/neuralnetwork/libraries/tracy/tracy/TracyMetal.hmm rename to include/neuralnetwork/libraries/tracy/tracy/TracyMetal.hmm diff --git a/src/neuralnetwork/libraries/tracy/tracy/TracyOpenCL.hpp b/include/neuralnetwork/libraries/tracy/tracy/TracyOpenCL.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/tracy/TracyOpenCL.hpp rename to include/neuralnetwork/libraries/tracy/tracy/TracyOpenCL.hpp index ede5c461..5cf14cb8 100644 --- a/src/neuralnetwork/libraries/tracy/tracy/TracyOpenCL.hpp +++ b/include/neuralnetwork/libraries/tracy/tracy/TracyOpenCL.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYOPENCL_HPP__ +#ifndef __TRACYOPENCL_HPP__ #define __TRACYOPENCL_HPP__ #if !defined TRACY_ENABLE diff --git a/src/neuralnetwork/libraries/tracy/tracy/TracyOpenGL.hpp b/include/neuralnetwork/libraries/tracy/tracy/TracyOpenGL.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/tracy/TracyOpenGL.hpp rename to include/neuralnetwork/libraries/tracy/tracy/TracyOpenGL.hpp index 30abd4fd..91c18cc2 100644 --- a/src/neuralnetwork/libraries/tracy/tracy/TracyOpenGL.hpp +++ b/include/neuralnetwork/libraries/tracy/tracy/TracyOpenGL.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYOPENGL_HPP__ +#ifndef __TRACYOPENGL_HPP__ #define __TRACYOPENGL_HPP__ #if !defined TRACY_ENABLE || defined __APPLE__ diff --git a/src/neuralnetwork/libraries/tracy/tracy/TracyVulkan.hpp b/include/neuralnetwork/libraries/tracy/tracy/TracyVulkan.hpp similarity index 99% rename from src/neuralnetwork/libraries/tracy/tracy/TracyVulkan.hpp rename to include/neuralnetwork/libraries/tracy/tracy/TracyVulkan.hpp index 429f299d..13e48281 100644 --- a/src/neuralnetwork/libraries/tracy/tracy/TracyVulkan.hpp +++ b/include/neuralnetwork/libraries/tracy/tracy/TracyVulkan.hpp @@ -1,4 +1,4 @@ -#ifndef __TRACYVULKAN_HPP__ +#ifndef __TRACYVULKAN_HPP__ #define __TRACYVULKAN_HPP__ #if !defined TRACY_ENABLE diff --git a/src/neuralnetwork/neuralnetwork.cpp b/include/neuralnetwork/neuralnetwork.cpp similarity index 99% rename from src/neuralnetwork/neuralnetwork.cpp rename to include/neuralnetwork/neuralnetwork.cpp index de01ea78..f07fbe41 100644 --- a/src/neuralnetwork/neuralnetwork.cpp +++ b/include/neuralnetwork/neuralnetwork.cpp @@ -1,4 +1,4 @@ -#include "logger.h" +#include "common/logger.h" #include "neuralnetwork.h" #include @@ -12,6 +12,9 @@ # define M_PI 3.141592653589793238462643383279502884 #endif + +namespace myoddweb::nn +{ NeuralNetwork::NeuralNetwork(const NeuralNetworkOptions& options) : _learning_rate(0.0), _layers(options), @@ -1500,3 +1503,5 @@ void NeuralNetwork::log_training_info( } } } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/neuralnetwork.h b/include/neuralnetwork/neuralnetwork.h similarity index 93% rename from src/neuralnetwork/neuralnetwork.h rename to include/neuralnetwork/neuralnetwork.h index f53a077a..e8b7a97b 100644 --- a/src/neuralnetwork/neuralnetwork.h +++ b/include/neuralnetwork/neuralnetwork.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #ifndef VALIDATE_DATA #if !defined(NDEBUG) #define VALIDATE_DATA 1 @@ -13,20 +13,23 @@ #include #include -#include "./libraries/instrumentor.h" +#include "libraries/instrumentor.h" -#include "activation.h" -#include "adaptivelearningratescheduler.h" -#include "errorcalculation.h" -#include "gradientsandoutputs.h" -#include "hiddenstates.h" -#include "layers.h" -#include "neuralnetworkhelper.h" -#include "neuralnetworkhelpermetrics.h" +#include "common/activation.h" +#include "helpers/adaptivelearningratescheduler.h" +#include "helpers/errorcalculation.h" +#include "common/gradientsandoutputs.h" +#include "common/hiddenstates.h" +#include "layers/layers.h" +#include "helpers/neuralnetworkhelper.h" +#include "helpers/neuralnetworkhelpermetrics.h" #include "neuralnetworkoptions.h" -#include "rng.h" -#include "taskqueue.h" +#include "common/rng.h" +#include "common/taskqueue.h" + +namespace myoddweb::nn +{ class NeuralNetwork { public: @@ -132,4 +135,5 @@ class NeuralNetwork mutable SingleTaskQueue> _adaptive_lr_task; mutable std::vector _last_metrics; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/neuralnetworkoptions.h b/include/neuralnetwork/neuralnetworkoptions.h similarity index 98% rename from src/neuralnetwork/neuralnetworkoptions.h rename to include/neuralnetwork/neuralnetworkoptions.h index 817c8480..c09470b3 100644 --- a/src/neuralnetwork/neuralnetworkoptions.h +++ b/include/neuralnetwork/neuralnetworkoptions.h @@ -1,19 +1,22 @@ -#pragma once +#pragma once #include #include #include "libraries/instrumentor.h" -#include "activation.h" -#include "errorcalculation.h" -#include "layer.h" -#include "layerdetails.h" -#include "logger.h" -#include "neuralnetworkhelper.h" -#include "multioutputlayerdetails.h" -#include "optimiser.h" -#include "outputlayerdetails.h" +#include "common/activation.h" +#include "helpers/errorcalculation.h" +#include "layers/layer.h" +#include "layers/layerdetails.h" +#include "common/logger.h" +#include "helpers/neuralnetworkhelper.h" +#include "layers/multioutputlayerdetails.h" +#include "common/optimiser.h" +#include "layers/outputlayerdetails.h" + +namespace myoddweb::nn +{ class NeuralNetworkHelper; class NeuralNetworkOptions { @@ -557,4 +560,5 @@ class NeuralNetworkOptions int _bptt_max_ticks; double _update_training_monitor_percent; bool _has_bias; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/neuron.cpp b/include/neuralnetwork/neuron.cpp similarity index 94% rename from src/neuralnetwork/neuron.cpp rename to include/neuralnetwork/neuron.cpp index de2ad23d..6b64b005 100644 --- a/src/neuralnetwork/neuron.cpp +++ b/include/neuralnetwork/neuron.cpp @@ -1,8 +1,11 @@ -#include "neuron.h" +#include "neuron.h" #include -#include "logger.h" -#include "./libraries/instrumentor.h" +#include "common/logger.h" +#include "libraries/instrumentor.h" + +namespace myoddweb::nn +{ Neuron::Neuron( unsigned index, const Type& type, @@ -121,3 +124,5 @@ const Neuron::Type& Neuron::get_type() const noexcept MYODDWEB_PROFILE_FUNCTION("Neuron"); return _type; } + +} // namespace myoddweb::nn diff --git a/src/neuralnetwork/neuron.h b/include/neuralnetwork/neuron.h similarity index 90% rename from src/neuralnetwork/neuron.h rename to include/neuralnetwork/neuron.h index 78655f15..6c0059cd 100644 --- a/src/neuralnetwork/neuron.h +++ b/include/neuralnetwork/neuron.h @@ -1,4 +1,7 @@ -#pragma once +#pragma once + +namespace myoddweb::nn +{ class Neuron { public: @@ -36,4 +39,5 @@ class Neuron unsigned _index; Type _type; double _dropout_rate; -}; \ No newline at end of file +}; +} // namespace myoddweb::nn diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a2d863e9..112e5732 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.14) +cmake_minimum_required(VERSION 3.14) project(NeuralNetworkTests CXX) # Set C++ standard @@ -19,21 +19,21 @@ FetchContent_MakeAvailable(googletest) option(ENABLE_TRACY "Enable Tracy Profiler" OFF) # Define source files from the main project (relative to this directory) -set(NN_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../src/neuralnetwork") +set(NN_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../include/neuralnetwork") set(NN_SOURCES - "${NN_SOURCE_DIR}/activation.cpp" - "${NN_SOURCE_DIR}/elmanrnnlayer.cpp" - "${NN_SOURCE_DIR}/fflayer.cpp" - "${NN_SOURCE_DIR}/ffoutputlayer.cpp" - "${NN_SOURCE_DIR}/grurnnlayer.cpp" - "${NN_SOURCE_DIR}/layer.cpp" - "${NN_SOURCE_DIR}/layers.cpp" + "${NN_SOURCE_DIR}/common/activation.cpp" + "${NN_SOURCE_DIR}/layers/elmanrnnlayer.cpp" + "${NN_SOURCE_DIR}/layers/fflayer.cpp" + "${NN_SOURCE_DIR}/layers/ffoutputlayer.cpp" + "${NN_SOURCE_DIR}/layers/grurnnlayer.cpp" + "${NN_SOURCE_DIR}/layers/layer.cpp" + "${NN_SOURCE_DIR}/layers/layers.cpp" "${NN_SOURCE_DIR}/libraries/TinyJSON.cpp" - "${NN_SOURCE_DIR}/lstmlayer.cpp" + "${NN_SOURCE_DIR}/layers/lstmlayer.cpp" "${NN_SOURCE_DIR}/neuralnetwork.cpp" - "${NN_SOURCE_DIR}/neuralnetworkhelper.cpp" - "${NN_SOURCE_DIR}/neuralnetworkserializer.cpp" + "${NN_SOURCE_DIR}/helpers/neuralnetworkhelper.cpp" + "${NN_SOURCE_DIR}/helpers/neuralnetworkserializer.cpp" "${NN_SOURCE_DIR}/neuron.cpp" ) diff --git a/tests/activation_tests.cpp b/tests/activation_tests.cpp index 526d1063..6d61a73f 100644 --- a/tests/activation_tests.cpp +++ b/tests/activation_tests.cpp @@ -1,5 +1,5 @@ -#include -#include "activation.h" +#include +#include "common/activation.h" #include #include #include @@ -10,6 +10,8 @@ #endif // Helper function to calculate exact mathematical expectations independently + +using namespace myoddweb::nn; namespace math_expect { double linear(double x, double) { return x; } double linear_deriv(double, double) { return 1.0; } diff --git a/tests/adaptive_learning_rate_scheduler_tests.cpp b/tests/adaptive_learning_rate_scheduler_tests.cpp index 1f1e9035..ecfd5494 100644 --- a/tests/adaptive_learning_rate_scheduler_tests.cpp +++ b/tests/adaptive_learning_rate_scheduler_tests.cpp @@ -1,8 +1,10 @@ -#include -#include "../src/neuralnetwork/adaptivelearningratescheduler.h" -#include "../src/neuralnetwork/logger.h" +#include +#include "helpers/adaptivelearningratescheduler.h" +#include "common/logger.h" #include + +using namespace myoddweb::nn; class AdaptiveLearningRateSchedulerTest : public ::testing::Test { protected: void SetUp() override { diff --git a/tests/aligned_allocator_tests.cpp b/tests/aligned_allocator_tests.cpp index f8159edf..891084fa 100644 --- a/tests/aligned_allocator_tests.cpp +++ b/tests/aligned_allocator_tests.cpp @@ -1,9 +1,11 @@ -#include -#include "aligned_allocator.h" +#include +#include "common/aligned_allocator.h" #include #include // A dummy class to test construct/destroy + +using namespace myoddweb::nn; class LifecycleTracker { public: static int constructions; diff --git a/tests/elmanrnnlayer_mt_tests.cpp b/tests/elmanrnnlayer_mt_tests.cpp index 62a75a7f..6bbc8ed1 100644 --- a/tests/elmanrnnlayer_mt_tests.cpp +++ b/tests/elmanrnnlayer_mt_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/elmanrnnlayer.h" +#include +#include "layers/elmanrnnlayer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class ElmanRNNLayerMTTest : public ::testing::Test diff --git a/tests/elmanrnnlayer_tests.cpp b/tests/elmanrnnlayer_tests.cpp index 59d925e4..9c98a2d9 100644 --- a/tests/elmanrnnlayer_tests.cpp +++ b/tests/elmanrnnlayer_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/elmanrnnlayer.h" +#include +#include "layers/elmanrnnlayer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class ElmanRNNLayerTest : public ::testing::Test { diff --git a/tests/error_calculation_tests.cpp b/tests/error_calculation_tests.cpp index cee93322..cd55df65 100644 --- a/tests/error_calculation_tests.cpp +++ b/tests/error_calculation_tests.cpp @@ -1,5 +1,5 @@ -#include "activation.h" -#include "errorcalculation.h" +#include "common/activation.h" +#include "helpers/errorcalculation.h" #include "neuralnetwork.h" #include "neuralnetworkoptions.h" #include @@ -7,6 +7,8 @@ #include #include + +using namespace myoddweb::nn; namespace math_expect { // --- Basic Formulas --- diff --git a/tests/fflayer_mt_tests.cpp b/tests/fflayer_mt_tests.cpp index c15ca4ef..f68be1f9 100644 --- a/tests/fflayer_mt_tests.cpp +++ b/tests/fflayer_mt_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/fflayer.h" +#include +#include "layers/fflayer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class FFLayerMTTest : public ::testing::Test diff --git a/tests/fflayer_tests.cpp b/tests/fflayer_tests.cpp index 476d9ed7..e78b49ea 100644 --- a/tests/fflayer_tests.cpp +++ b/tests/fflayer_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/fflayer.h" +#include +#include "layers/fflayer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class FFLayerTest : public ::testing::Test { diff --git a/tests/ffoutputlayer_mt_tests.cpp b/tests/ffoutputlayer_mt_tests.cpp index 9acf564a..46ba183c 100644 --- a/tests/ffoutputlayer_mt_tests.cpp +++ b/tests/ffoutputlayer_mt_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/ffoutputlayer.h" +#include +#include "layers/ffoutputlayer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class FFOutputLayerMTTest : public ::testing::Test diff --git a/tests/ffoutputlayer_tests.cpp b/tests/ffoutputlayer_tests.cpp index f84aea74..eabc4046 100644 --- a/tests/ffoutputlayer_tests.cpp +++ b/tests/ffoutputlayer_tests.cpp @@ -1,9 +1,11 @@ -#include -#include "../src/neuralnetwork/ffoutputlayer.h" +#include +#include "layers/ffoutputlayer.h" #include "test_helper.h" #include #include + +using namespace myoddweb::nn; using namespace test_helper; class FFOutputLayerTest : public ::testing::Test { diff --git a/tests/gradients_and_outputs_tests.cpp b/tests/gradients_and_outputs_tests.cpp index 6e2bf828..e9bd92d1 100644 --- a/tests/gradients_and_outputs_tests.cpp +++ b/tests/gradients_and_outputs_tests.cpp @@ -1,8 +1,10 @@ -#include -#include "gradientsandoutputs.h" +#include +#include "common/gradientsandoutputs.h" #include #include + +using namespace myoddweb::nn; class GradientsAndOutputsTest : public ::testing::Test { protected: std::vector topology = {3, 5, 2}; // 3 layers diff --git a/tests/grurnnlayer_mt_tests.cpp b/tests/grurnnlayer_mt_tests.cpp index bad2958e..e06a2061 100644 --- a/tests/grurnnlayer_mt_tests.cpp +++ b/tests/grurnnlayer_mt_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/grurnnlayer.h" +#include +#include "layers/grurnnlayer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class GRURNNLayerMTTest : public ::testing::Test diff --git a/tests/grurnnlayer_tests.cpp b/tests/grurnnlayer_tests.cpp index edab8e0d..0a954021 100644 --- a/tests/grurnnlayer_tests.cpp +++ b/tests/grurnnlayer_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/grurnnlayer.h" +#include +#include "layers/grurnnlayer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class GRURNNLayerTest : public ::testing::Test { diff --git a/tests/hidden_state_tests.cpp b/tests/hidden_state_tests.cpp index 7b6ba09a..ef9faf31 100644 --- a/tests/hidden_state_tests.cpp +++ b/tests/hidden_state_tests.cpp @@ -1,8 +1,10 @@ -#include -#include "../src/neuralnetwork/hiddenstate.h" +#include +#include "common/hiddenstate.h" #include #include + +using namespace myoddweb::nn; TEST(HiddenStateTest, ConstructorInitializesCorrectly) { unsigned num_neurons = 5; diff --git a/tests/layer_details_tests.cpp b/tests/layer_details_tests.cpp index fcaf368a..d05a2c17 100644 --- a/tests/layer_details_tests.cpp +++ b/tests/layer_details_tests.cpp @@ -1,17 +1,19 @@ -#include -#include "../src/neuralnetwork/layerdetails.h" -#include "../src/neuralnetwork/outputlayerdetails.h" -#include "../src/neuralnetwork/multioutputlayerdetails.h" -#include "../src/neuralnetwork/multioutputlayer.h" -#include "../src/neuralnetwork/activation.h" -#include "../src/neuralnetwork/errorcalculation.h" -#include "../src/neuralnetwork/optimiser.h" -#include "../src/neuralnetwork/evaluationconfig.h" +#include +#include "layers/layerdetails.h" +#include "layers/outputlayerdetails.h" +#include "layers/multioutputlayerdetails.h" +#include "layers/multioutputlayer.h" +#include "common/activation.h" +#include "helpers/errorcalculation.h" +#include "common/optimiser.h" +#include "common/evaluationconfig.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class LayerDetailsTest : public ::testing::Test { diff --git a/tests/layer_optimizer_tests.cpp b/tests/layer_optimizer_tests.cpp index e7e2ec5c..9fa74a34 100644 --- a/tests/layer_optimizer_tests.cpp +++ b/tests/layer_optimizer_tests.cpp @@ -1,9 +1,11 @@ -#include -#include "../src/neuralnetwork/layer.h" +#include +#include "layers/layer.h" #include "test_helper.h" #include #include + +using namespace myoddweb::nn; using namespace test_helper; class LayerOptimizerTest : public ::testing::Test { diff --git a/tests/layer_tests.cpp b/tests/layer_tests.cpp index 295e403a..5ef19704 100644 --- a/tests/layer_tests.cpp +++ b/tests/layer_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/layer.h" +#include +#include "layers/layer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; TEST(LayerTest, ArchitectureToString) { diff --git a/tests/layers_and_neurons_container_tests.cpp b/tests/layers_and_neurons_container_tests.cpp index e301c451..77759f3a 100644 --- a/tests/layers_and_neurons_container_tests.cpp +++ b/tests/layers_and_neurons_container_tests.cpp @@ -1,8 +1,10 @@ -#include -#include "../src/neuralnetwork/layersandneuronscontainer.h" +#include +#include "common/layersandneuronscontainer.h" #include #include + +using namespace myoddweb::nn; TEST(LayersAndNeuronsContainerTest, ConstructorInitializesTopologyAndOffsets) { std::vector topology = { 3, 5, 2 }; diff --git a/tests/learning_rate_tests.cpp b/tests/learning_rate_tests.cpp index 98711088..7e4f0330 100644 --- a/tests/learning_rate_tests.cpp +++ b/tests/learning_rate_tests.cpp @@ -1,6 +1,6 @@ -#include "../src/neuralnetwork/logger.h" -#include "../src/neuralnetwork/neuralnetwork.h" -#include "../src/neuralnetwork/neuralnetworkoptions.h" +#include "common/logger.h" +#include "neuralnetwork.h" +#include "neuralnetworkoptions.h" #include "test_helper.h" #include #include @@ -10,6 +10,8 @@ #include #include + +using namespace myoddweb::nn; using namespace test_helper; #ifndef M_PI diff --git a/tests/lstmlayer_mt_tests.cpp b/tests/lstmlayer_mt_tests.cpp index e5dbb65c..97e64714 100644 --- a/tests/lstmlayer_mt_tests.cpp +++ b/tests/lstmlayer_mt_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/lstmlayer.h" +#include +#include "layers/lstmlayer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class LSTMLayerMTTest : public ::testing::Test diff --git a/tests/lstmlayer_tests.cpp b/tests/lstmlayer_tests.cpp index d69f9113..d48cc8f0 100644 --- a/tests/lstmlayer_tests.cpp +++ b/tests/lstmlayer_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/lstmlayer.h" +#include +#include "layers/lstmlayer.h" #include "test_helper.h" #include #include #include + +using namespace myoddweb::nn; using namespace test_helper; class LSTMLayerTest : public ::testing::Test { diff --git a/tests/multioutputlayer_tests.cpp b/tests/multioutputlayer_tests.cpp index ce9368a1..958d54a2 100644 --- a/tests/multioutputlayer_tests.cpp +++ b/tests/multioutputlayer_tests.cpp @@ -1,12 +1,14 @@ -#include -#include "../src/neuralnetwork/multioutputlayer.h" -#include "../src/neuralnetwork/multioutputlayerdetails.h" -#include "../src/neuralnetwork/layerdetails.h" -#include "../src/neuralnetwork/outputlayerdetails.h" +#include +#include "layers/multioutputlayer.h" +#include "layers/multioutputlayerdetails.h" +#include "layers/layerdetails.h" +#include "layers/outputlayerdetails.h" #include "test_helper.h" #include #include + +using namespace myoddweb::nn; using namespace test_helper; class MultiOutputLayerTest : public ::testing::Test { diff --git a/tests/network_integration_tests.cpp b/tests/network_integration_tests.cpp index 18df7093..e6d8d371 100644 --- a/tests/network_integration_tests.cpp +++ b/tests/network_integration_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/fflayer.h" -#include "../src/neuralnetwork/grurnnlayer.h" -#include "../src/neuralnetwork/ffoutputlayer.h" +#include +#include "layers/fflayer.h" +#include "layers/grurnnlayer.h" +#include "layers/ffoutputlayer.h" #include "test_helper.h" #include + +using namespace myoddweb::nn; using namespace test_helper; TEST(NetworkIntegrationTest, CrossLayerGradientPropagation) { diff --git a/tests/neuralnetwork_tests.cpp b/tests/neuralnetwork_tests.cpp index 76f841f1..a44a6612 100644 --- a/tests/neuralnetwork_tests.cpp +++ b/tests/neuralnetwork_tests.cpp @@ -1,4 +1,4 @@ -#include +#include int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); diff --git a/tests/neuralnetwork_tests.vcxproj b/tests/neuralnetwork_tests.vcxproj index 9ae7237d..7a7a7271 100644 --- a/tests/neuralnetwork_tests.vcxproj +++ b/tests/neuralnetwork_tests.vcxproj @@ -50,7 +50,7 @@ _DEBUG;_CONSOLE;VALIDATE_DATA=1;_CRT_SECURE_NO_WARNINGS;MYODDWEB_PROFILE=0;%(PreprocessorDefinitions) true stdcpp20 - ../src/neuralnetwork;../src/neuralnetwork/libraries;%(AdditionalIncludeDirectories) + ../include;../include/neuralnetwork;../include/neuralnetwork/libraries;%(AdditionalIncludeDirectories) AdvancedVectorExtensions2 @@ -67,7 +67,7 @@ NDEBUG;_CONSOLE;VALIDATE_DATA=1;_CRT_SECURE_NO_WARNINGS;MYODDWEB_PROFILE=0;%(PreprocessorDefinitions) true stdcpp20 - ../src/neuralnetwork;../src/neuralnetwork/libraries;%(AdditionalIncludeDirectories) + ../include;../include/neuralnetwork;../include/neuralnetwork/libraries;%(AdditionalIncludeDirectories) AdvancedVectorExtensions2 @@ -78,7 +78,7 @@ - + @@ -110,31 +110,31 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/go/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/tests/neuron_tests.cpp b/tests/neuron_tests.cpp index 60dc3ad6..b190b91e 100644 --- a/tests/neuron_tests.cpp +++ b/tests/neuron_tests.cpp @@ -1,7 +1,9 @@ -#include +#include #include "neuron.h" #include + +using namespace myoddweb::nn; TEST(NeuronTest, NormalNeuronInitialization) { Neuron n(42, Neuron::Type::Normal, 0.0); diff --git a/tests/output_layer_details_tests.cpp b/tests/output_layer_details_tests.cpp index 02e7387c..d592770e 100644 --- a/tests/output_layer_details_tests.cpp +++ b/tests/output_layer_details_tests.cpp @@ -1,6 +1,8 @@ -#include -#include "../src/neuralnetwork/outputlayerdetails.h" +#include +#include "layers/outputlayerdetails.h" + +using namespace myoddweb::nn; TEST(OutputLayerDetailsTest, ConstructorAndGetters) { unsigned layer_size = 10; activation act(activation::method::softmax, 0.1, 1.2, 0.8); diff --git a/tests/simd_utils_mt_tests.cpp b/tests/simd_utils_mt_tests.cpp index 17ff9d11..5d09b959 100644 --- a/tests/simd_utils_mt_tests.cpp +++ b/tests/simd_utils_mt_tests.cpp @@ -1,9 +1,11 @@ -#include -#include "../src/neuralnetwork/simd_utils.h" +#include +#include "common/simd_utils.h" #include #include #include + +using namespace myoddweb::nn; namespace { constexpr size_t NUM_THREADS = 8; constexpr size_t NUM_ITERATIONS = 1000; diff --git a/tests/simd_utils_tests.cpp b/tests/simd_utils_tests.cpp index ea48a082..a65e96f0 100644 --- a/tests/simd_utils_tests.cpp +++ b/tests/simd_utils_tests.cpp @@ -1,9 +1,11 @@ -#include -#include "../src/neuralnetwork/simd_utils.h" +#include +#include "common/simd_utils.h" #include #include #include + +using namespace myoddweb::nn; namespace { constexpr double EPSILON = 1e-9; diff --git a/tests/taskqueue_comprehensive_tests.cpp b/tests/taskqueue_comprehensive_tests.cpp index 20373bd9..9546cfc7 100644 --- a/tests/taskqueue_comprehensive_tests.cpp +++ b/tests/taskqueue_comprehensive_tests.cpp @@ -1,10 +1,12 @@ -#include -#include "../src/neuralnetwork/taskqueue.h" +#include +#include "common/taskqueue.h" #include #include #include #include + +using namespace myoddweb::nn; class TaskQueueComprehensiveTest : public ::testing::Test { protected: diff --git a/tests/taskqueue_tests.cpp b/tests/taskqueue_tests.cpp index dce2d355..e15fb73f 100644 --- a/tests/taskqueue_tests.cpp +++ b/tests/taskqueue_tests.cpp @@ -1,5 +1,5 @@ -#include -#include "../src/neuralnetwork/taskqueue.h" +#include +#include "common/taskqueue.h" #include #include #include @@ -8,6 +8,8 @@ // --- TaskQueue Tests --- + +using namespace myoddweb::nn; TEST(TaskQueueTest, BasicIntOutput) { TaskQueue queue; for (int i = 0; i < 10; ++i) { diff --git a/tests/test_helper.h b/tests/test_helper.h index e1170027..4895139b 100644 --- a/tests/test_helper.h +++ b/tests/test_helper.h @@ -1,12 +1,14 @@ -#pragma once +#pragma once #include #include #include -#include "../src/neuralnetwork/fflayer.h" -#include "../src/neuralnetwork/gradientsandoutputs.h" -#include "../src/neuralnetwork/hiddenstates.h" -#include "../src/neuralnetwork/layer.h" +#include "layers/fflayer.h" +#include "common/gradientsandoutputs.h" +#include "common/hiddenstates.h" +#include "layers/layer.h" + +using namespace myoddweb::nn; namespace test_helper { inline std::vector create_batch_gradients_and_outputs(const std::vector& topology, size_t batch_size) { std::vector batch; diff --git a/tests/weight_param_tests.cpp b/tests/weight_param_tests.cpp index 48dea11b..a7b2ea2a 100644 --- a/tests/weight_param_tests.cpp +++ b/tests/weight_param_tests.cpp @@ -1,8 +1,10 @@ -#include -#include "weightparam.h" +#include +#include "common/weightparam.h" #include #include + +using namespace myoddweb::nn; TEST(WeightParamTest, ConstructorInitialization) { // Test the full constructor WeightParam wp(1.5, 0.1, 0.01, 0.001, 0.0001, 42, 0.05);