Skip to content

Commit

Permalink
[ONN] Add batch norm layer to nerlplanner
Browse files Browse the repository at this point in the history
  • Loading branch information
leondavi committed Jun 27, 2024
1 parent bfd5c09 commit 96c140b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src_cpp/common/worker_definitions_ag.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace nerlnet {

enum LayerTypeEnum{LAYER_TYPE_DEFAULT=0,LAYER_TYPE_SCALING=1,LAYER_TYPE_CONV=2,LAYER_TYPE_PERCEPTRON=3,LAYER_TYPE_POOLING=4,LAYER_TYPE_PROBABILISTIC=5,LAYER_TYPE_LSTM=6,LAYER_TYPE_RECCURRENT=7,LAYER_TYPE_UNSCALING=8,LAYER_TYPE_FLATTEN=9,LAYER_TYPE_BOUNDING=10};
enum LayerTypeEnum{LAYER_TYPE_DEFAULT=0,LAYER_TYPE_SCALING=1,LAYER_TYPE_CONV=2,LAYER_TYPE_PERCEPTRON=3,LAYER_TYPE_POOLING=4,LAYER_TYPE_PROBABILISTIC=5,LAYER_TYPE_BATCHNORMALIZATION=6,LAYER_TYPE_LSTM=7,LAYER_TYPE_RECCURRENT=8,LAYER_TYPE_UNSCALING=9,LAYER_TYPE_FLATTEN=10,LAYER_TYPE_BOUNDING=11};
enum ProbabilisticActivationEnum{PROBABILISTIC_ACTIVATION_BINARY=1,PROBABILISTIC_ACTIVATION_LOGISTIC=2,PROBABILISTIC_ACTIVATION_COMPETITIVE=3,PROBABILISTIC_ACTIVATION_SOFTMAX=4};
enum ScalingEnum{SCALING_NONE=1,SCALING_MINMAX=2,SCALING_MEANSTD=3,SCALING_STD=4,SCALING_LOG=5};
enum BoundingEnum{BOUNDING_NONE=1,BOUNDING_BOUNDING=2};
Expand Down
11 changes: 6 additions & 5 deletions src_erl/NerlnetApp/src/Bridge/layers_types_ag.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
-define(LAYERS_TYPE_PERCEPTRON_IDX,"3").
-define(LAYERS_TYPE_POOLING_IDX,"4").
-define(LAYERS_TYPE_PROBABILISTIC_IDX,"5").
-define(LAYERS_TYPE_LSTM_IDX,"6").
-define(LAYERS_TYPE_RECCURRENT_IDX,"7").
-define(LAYERS_TYPE_UNSCALING_IDX,"8").
-define(LAYERS_TYPE_FLATTEN_IDX,"9").
-define(LAYERS_TYPE_BOUNDING_IDX,"10").
-define(LAYERS_TYPE_BATCHNORMALIZATION_IDX,"6").
-define(LAYERS_TYPE_LSTM_IDX,"7").
-define(LAYERS_TYPE_RECCURRENT_IDX,"8").
-define(LAYERS_TYPE_UNSCALING_IDX,"9").
-define(LAYERS_TYPE_FLATTEN_IDX,"10").
-define(LAYERS_TYPE_BOUNDING_IDX,"11").
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
_ModelTypeCNN = "0",
_ModelArgsCNN = "",
_LayersSizesCNN = "28x28x1k5x5x1x6p0s1t1,28x28x6k2x2p0s2,14x14x6k4x4x6x12p0s1t0,1,32,10",
_LayersTypesCNN = "2,4,2,9,3,5",
_LayersTypesCNN = "2,4,2,10,3,5",
_LayersFunctionalityCodesCNN = "6,2,6,6,6,4", % change scaler functionality to 6 to check exception handling
_LearningRateCNN = "0.01",
_EpochsCNN = "50",
Expand All @@ -33,7 +33,7 @@
_ModelTypeAEC = "9",
_ModelArgsAEC = "",
_LayersSizesAEC = "32,16,8,4,8,16,32,32", % last layer (perceptron) should be the same as the input layer , followed by bounding layer
_LayersTypesAEC = "1,3,3,3,3,3,3,10",
_LayersTypesAEC = "1,3,3,3,3,3,3,11",
_LayersFunctionalityCodesAEC = "1,11,11,11,11,11,11,1",
_LearningRateAEC = "0.01",
_EpochsAEC = "50",
Expand All @@ -47,7 +47,7 @@
_ModelTypeAE = "8",
_ModelArgsAE = "",
_LayersSizesAE = "32,16,8,4,8,16,32,32", % last layer (perceptron) should be the same as the input layer , followed by bounding layer
_LayersTypesAE = "1,3,3,3,3,3,3,10",
_LayersTypesAE = "1,3,3,3,3,3,3,11",
_LayersFunctionalityCodesAE = "1,11,11,11,11,11,11,1",
_LearningRateAE = "0.01",
_EpochsAE = "50",
Expand Down
2 changes: 1 addition & 1 deletion src_erl/NerlnetApp/src/nerlnetApp.app.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{application, nerlnetApp,
[{description, "Nerlnet OTP Application"},
{vsn, "1.4.0"},
{vsn, "1.5.1"},
{registered, []},
{mod, {nerlnetApp_app, []}},
{applications,
Expand Down
4 changes: 2 additions & 2 deletions src_erl/NerlnetApp/src/nerlnetApp_app.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
-behaviour(application).
-include("nerl_tools.hrl").

-define(NERLNET_APP_VERSION, "1.5.0").
-define(NERLPLANNER_TESTED_VERSION,"1.0.2").
-define(NERLNET_APP_VERSION, "1.5.1").
-define(NERLPLANNER_TESTED_VERSION,"1.0.3").

-export([start/2, stop/1]).

Expand Down
4 changes: 2 additions & 2 deletions src_py/nerlPlanner/Definitions.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import subprocess
from logger import *

VERSION = "1.0.2"
NERLNET_VERSION_TESTED_WITH = "1.5.0"
VERSION = "1.0.3"
NERLNET_VERSION_TESTED_WITH = "1.5.1"
NERLNET_TMP_PATH = "/tmp/nerlnet"
NERLNET_GRAPHVIZ_OUTPUT_DIR = f"{NERLNET_TMP_PATH}/nerlplanner"
NERLNET_GLOBAL_PATH = "/usr/local/lib/nerlnet-lib/NErlNet"
Expand Down
11 changes: 6 additions & 5 deletions src_py/nerlPlanner/JsonElementWorkerDefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
("Perceptron" , "3"),
("Pooling" , "4"),
("Probabilistic" , "5"),
("LSTM" , "6"),
("Reccurrent" , "7"),
("Unscaling" , "8"),
("Flatten" , "9"),
("Bounding" , "10"),
("BatchNormalization" , "6"),
("LSTM" , "7"),
("Reccurrent" , "8"),
("Unscaling" , "9"),
("Flatten" , "10"),
("Bounding" , "11"),
]
)

Expand Down

0 comments on commit 96c140b

Please sign in to comment.