Skip to content

Commit

Permalink
Merge pull request #161 from leondavi/onn600
Browse files Browse the repository at this point in the history
[OPENNN_6.0.0] upgrade opennn to version 6.0.0 - compilation passed
  • Loading branch information
leondavi authored Apr 23, 2023
2 parents 9dacec6 + f4cab20 commit 7e5e434
Show file tree
Hide file tree
Showing 42 changed files with 334 additions and 4,582 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "simple-cpp-logger"]
path = src_cpp/simple-cpp-logger
url = https://github.com/nadrino/simple-cpp-logger
[submodule "nifpp"]
path = src_cpp/nifpp
url = https://github.com/goertzenator/nifpp.git
23 changes: 15 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,30 @@
# @copyright Copyright (c) 2021 Nerlnet
# *****************************************************/

project(nerlnet DESCRIPTION "Nerlnet Distributed Machine Learning Research Platform")
cmake_minimum_required(VERSION 3.16.3 FATAL_ERROR)

find_package(OpenMP REQUIRED)
project(nerlnet DESCRIPTION "Nerlnet Distributed Machine Learning Research Platform")

set(PROJECT_BINARY_DIR build)
set (CMAKE_CXX_STANDARD 11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -latomic -fopenmp")#${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -latomic -fopenmp")#${OpenMP_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -latomic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -latomic")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")

#add_compile_definitions(EIGEN_MAX_ALIGN_BYTES=8) #Open this line for RASPI

option(USE_OpenMP "Use-OpenMP" ON)
if(USE_OpenMP)
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()

###########################
# adding sub directories
###########################
add_subdirectory(src_cpp) # actually adding opennnBridge

add_library(${PROJECT_NAME} SHARED $<TARGET_OBJECTS:opennnBridge>)
target_link_libraries(${PROJECT_NAME} PUBLIC opennn opennnBridge)
target_link_libraries(${PROJECT_NAME} PUBLIC opennnBridge)
10 changes: 10 additions & 0 deletions NerlnetBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ done

NERLNET_BUILD_PREFIX="[Nerlnet Build] "

OPTION="add_compile_definitions(EIGEN_MAX_ALIGN_BYTES=8)"
is_rasp="$(grep -c raspbian /etc/os-release)"
if [ $is_rasp -gt "0" ]; then
echo "$NERLNET_BUILD_PREFIX Detected raspberrypi => setting alignment to 8"
sed -i "s/^.*#\(${OPTION}\)/\1/" CMakeLists.txt
else
echo "$NERLNET_BUILD_PREFIX Using default alignment"
sed -i "s/^.*\(${OPTION}.*$\)/#\1/" CMakeLists.txt
fi

echo "$NERLNET_BUILD_PREFIX Building Nerlnet Library"
echo "$NERLNET_BUILD_PREFIX Cmake command of Nerlnet NIFPP"
cmake -S . -B build/release -DCMAKE_BUILD_TYPE=RELEASE
Expand Down
2 changes: 1 addition & 1 deletion NerlnetGetData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ -d "$INPUT_DATA_DIR" ]; then
else
echo "$NERLNET_PREFIX $INPUT_DATA_DIR is generated and is empty!"
wget https://github.com/halfway258/NerlnetData/archive/refs/heads/main.zip
unzip main.zip -d inputDataDir
unzip main.zip -d $INPUT_DATA_DIR
rm main.zip
echo "$NERLNET_PREFIX Add input data to $INPUT_DATA_DIR"
fi
Binary file added NerlnetLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed Nerlnet_logo.jpg
Binary file not shown.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


<p align="center">
<img src="Nerlnet_logo.jpg" width="350" title="NerlNet">
<img src="NerlnetLogo.png" width="200" title="NerlNet">
</p>

Nerlnet is an open-source library for research of distributed machine learning algorithms on IoT devices that gives full insights into both edge devices that run neural network models and network performance and statistics. Nerlnet can simulate distributed ML architectures and deploy them on various IoT devices. <br><br>
Expand Down Expand Up @@ -62,8 +62,9 @@ After running the installation script, NErlNet directory can be accessed via the
## Python API and Jupyter (For GUI Server):
Minimum Python version: 3.8

1. Create and activate a virtual environment for Nerlnet https://docs.python.org/3/library/venv.html
2. Install required modules ```pip install -r src_py/requirements.txt```
1. Create and activate a virtual environment for Nerlnet: (https://docs.python.org/3/library/venv.html)
```python -m venv VENV_PATH/VENV_NAME ==== then ===> source VENV/bin/acticvate```
2. Install required modules while in venv ```pip install -r src_py/requirements.txt```
3. Install Jupyter Notebook ```pip install jupyterlab```
4. Call Jupyter environment creator script with an experiment directory ```./NerlnetJupyterEnvGenerator.sh --j <experiment_direcotry>```
5. Run Jupyter notebook and import the ApiServer module to the notebook.
Expand Down
File renamed without changes.
File renamed without changes.
17 changes: 9 additions & 8 deletions inputJsonFiles/Architecture/arch_1PC1WorkerHealth.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,26 @@
"workers": [
{
"name": "w1",
"modelId": "0",
"modelId": "1",
"_comment0": "E_APPROXIMATION = 1, E_CLASSIFICATION = 2, E_FORECASTING = 3 , E_NCODER_DECODER = 4, E_CUSTOMNN = 5, E_AE = 6, E_AEC = 7",
"modelType": "5",
"scalingMethod": "0",
"_comment1": "NoScaling = 1 , MinimumMaximum = 2 , MeanStandardDeviation = 3 , StandardDeviation = 4 , Logarithm = 5",
"layerTypesList": "[6,1,1,1,1,1,1,1,1]",
"_comment1": "Non-Scaling = 1 , MinimumMaximum = 2 , MeanStandardDeviation = 3 , StandardDeviation = 4 , Logarithm = 5",
"scalingMethod": "1",
"_commnet_layer_type": "E_LAYER_TYPE_DEFAULT(perceptron) = 0, E_LAYER_TYPE_SCALING = 1, E_LAYER_TYPE_CONVOLUTIONAL = 2 , E_LAYER_TYPE_PERCEPTRON = 3 , E_LAYER_TYPE_POOLING = 4 , E_LAYER_TYPE_PROBABILISTIC = 5 , E_LAYER_TYPE_LSTM = 6 , E_LAYER_TYPE_RECURRENT = 7 , E_LAYER_TYPE_UNSCALING = 8 , E_LAYER_TYPE_BOUNDING = 9 ",
"layerTypesList": "[4,1,1,1,0,0,0]",
"layersSizes": "[4,1,1,13,10,6,5]",
"_comment2": "Activation functions explain: Threshold = 1, SymmetricThreshold = 2 ,Logistic = 3 ,HyperbolicTangent = 4 ,Linear = 5 ,RectifiedLinear = 6 ,ExponentialLinear = 7 ,ScaledExponentialLinear = 8 ,SoftPlus = 9 ,SoftSign = 10 ,HardSigmoid = 11",
"layersActivationFunctions": "[6,1,1,5,9,5,9,5,11]",
"_comment2": "Activation functions explain: Threshold = 1, SymmetricThreshold = 2 ,Logistic = 3 ,HyperbolicTangent = 4 ,Linear = 5,RectifiedLinear = 6 ,ExponentialLinear = 7 ,ScaledExponentialLinear = 8 ,SoftPlus = 9 ,SoftSign = 10 ,HardSigmoid = 11",
"layersActivationFunctions": "[4,1,1,6,6,11,11]",
"federatedMode": "0",
"countLimit": "10",
"_comment4": "LOSS: SUM_SQUARED_ERROR = 1, MSE = 2 /* MSE - Mean Squared Error */, E_LOSS_METHOD_NSE = 3 /* NSE - Normalized Squared Error */, MINKOWSKI_ERROR = 4, WSE = 5 /* WSE - Weighted Squared Error */, CEE = 6 /* CEE - Cross Entropy Error */",
"lossMethod": "2",
"_comment5": "TODOTODO explain learningRate",
"learningRate": "0.01",
"_comment3": "OptimizerExplain: 0- NONE, 1- SGD, 2- MINI_BATCH_SGD, 3- MOMENTUM, 4- NAG, 5- ADAGRAD, 6- ADAM",
"optimizer":"5",
"optimizer":"6",
"features": "13",
"labels": "1"
"labels": "5"
}
],
"clients": [
Expand Down
2 changes: 1 addition & 1 deletion inputJsonFiles/Architecture/arch_2PC2Workers.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"entities": "mainServer,c1,s1,r1"
},
{
"host": "192.168.0.102",
"host": "192.168.0.103",
"entities": "c2"
}
],
Expand Down
58 changes: 30 additions & 28 deletions inputJsonFiles/experimentsFlow/exp_1Worker1SourceHealth.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
{
"CSV path": "health_comb",
"Batches per source":
{
"Training": 50,
"Prediction": 50
},
"Training": [
{
"source name": "s1",
"workers": "w1",
"CSV path": "health_comb_train"
}
],

"Prediction": [
{
"source name": "s1",
"workers": "w1",
"CSV path": "health_comb_predict"
}
],

"Statistics": [
{
"workers": "w1",
"routers": "r1"
}
]
"Features": 13,
"Labels": [1, 2, 3, 4, 5],
"CSV path": "health_comb",
"Batches per source":
{
"Training": 50,
"Prediction": 20
},
"Training": [
{
"source name": "s1",
"workers": "w1",
"CSV path": "health_comb_train"
}
],

"Prediction": [
{
"source name": "s1",
"workers": "w1",
"CSV path": "health_comb_predict"
}
],

"Statistics": [
{
"workers": "w1",
"routers": "r1"
}
]
}

Binary file removed nerlnet_log_large.jpg
Binary file not shown.
Loading

0 comments on commit 7e5e434

Please sign in to comment.