Skip to content

Commit

Permalink
[NERLPLANNER] AG update
Browse files Browse the repository at this point in the history
  • Loading branch information
leondavi committed Aug 7, 2024
1 parent a7b77d5 commit e52f44f
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src_cpp/common/worker_definitions_ag.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

// This file was auto generated
// Generated by Nerlplanner version: 1.0.3
// Generated by Nerlplanner version: 1.0.4

namespace nerlnet {

Expand Down
2 changes: 1 addition & 1 deletion src_erl/NerlnetApp/src/Bridge/layers_types_ag.hrl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% This is an auto generated .hrl file
% DC Fields Generated by Nerlplanner version: 1.0.3
% DC Fields Generated by Nerlplanner version: 1.0.4

-define(LAYERS_TYPE_DEFAULT_IDX,"0").
-define(LAYERS_TYPE_SCALING_IDX,"1").
Expand Down
2 changes: 1 addition & 1 deletion src_erl/NerlnetApp/src/Bridge/models_types_ag.hrl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% This is an auto generated .hrl file
% DC Fields Generated by Nerlplanner version: 1.0.3
% DC Fields Generated by Nerlplanner version: 1.0.4

-define(MODEL_TYPE_NN_IDX,"0").
-define(MODEL_TYPE_APPROXIMATION_IDX,"1").
Expand Down
3 changes: 2 additions & 1 deletion src_erl/NerlnetApp/src/Bridge/onnWorkers/workerGeneric.erl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ init({WorkerName , WorkerArgs , DistributedBehaviorFunc , DistributedWorkerData
nerl_tools:setup_logger(?MODULE),
{ModelID , ModelType , ModelArgs , LayersSizes,
LayersTypes, LayersFunctionalityCodes, LearningRate , Epochs,
OptimizerType, OptimizerArgs , LossMethod , DistributedSystemType ,
OptimizerType, OptimizerArgs , LossMethod , LossArgs, DistributedSystemType ,
DistributedSystemToken, DistributedSystemArgs} = WorkerArgs,
GenWorkerEts = ets:new(generic_worker,[set, public]),
put(generic_worker_ets, GenWorkerEts),
Expand All @@ -70,6 +70,7 @@ init({WorkerName , WorkerArgs , DistributedBehaviorFunc , DistributedWorkerData
ets:insert(GenWorkerEts,{layers_sizes, LayersSizes}),
ets:insert(GenWorkerEts,{layers_functionality_codes, LayersFunctionalityCodes}),
ets:insert(GenWorkerEts,{loss_method, LossMethod}),
ets:insert(GenWorkerEts,{loss_args, LossArgs}),
ets:insert(GenWorkerEts,{learning_rate, LearningRate}),
ets:insert(GenWorkerEts,{epochs, Epochs}),
ets:insert(GenWorkerEts,{optimizer, OptimizerType}),
Expand Down
1 change: 1 addition & 0 deletions src_erl/NerlnetApp/src/Init/jsonParser.erl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ get_models(ShaToModelMaps) ->
LayersTypes = binary_to_list(maps:get(?WORKER_FIELD_KEY_LAYER_TYPES_LIST_BIN,ModelParams)),
LayersFunctions = binary_to_list(maps:get(?WORKER_FIELD_KEY_LAYERS_FUNCTIONS_BIN,ModelParams)),
LossMethod = binary_to_list(maps:get(?WORKER_FIELD_KEY_LOSS_METHOD_BIN,ModelParams)),
LossArgs = binary_to_list(maps:get(?WORKER_FIELD_KEY_LOSS_ARGS_BIN,ModelParams)),
LearningRate = binary_to_list(maps:get(?WORKER_FIELD_KEY_LEARNING_RATE_BIN,ModelParams)),
Epochs = binary_to_list(maps:get(?WORKER_FIELD_KEY_EPOCHS_BIN,ModelParams)),
Optimizer = binary_to_list(maps:get(?WORKER_FIELD_KEY_OPTIMIZER_TYPE_BIN,ModelParams)),
Expand Down
2 changes: 1 addition & 1 deletion src_erl/NerlnetApp/src/dc_definitions_ag.hrl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% This is an auto generated .hrl file
% DC Fields Generated by Nerlplanner version: 1.0.3
% DC Fields Generated by Nerlplanner version: 1.0.4

-define(DC_KEY_NERLNET_SETTINGS_ATOM,nerlnetSettings).
-define(DC_KEY_FREQUENCY_ATOM,frequency).
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.2").
-define(NERLPLANNER_TESTED_VERSION,"1.0.3").
-define(NERLNET_APP_VERSION, "1.5.3").
-define(NERLPLANNER_TESTED_VERSION,"1.0.4").

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

Expand Down
2 changes: 1 addition & 1 deletion src_erl/NerlnetApp/src/router_definitions_ag.hrl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% This is an auto generated .hrl file
% Source Fields Generated by Nerlplanner version: 1.0.3
% Source Fields Generated by Nerlplanner version: 1.0.4

-define(ROUTER_POLICY_ROUTINGTABLE_IDX,"0").

Expand Down
2 changes: 1 addition & 1 deletion src_erl/NerlnetApp/src/source_definitions_ag.hrl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% This is an auto generated .hrl file
% Source Fields Generated by Nerlplanner version: 1.0.3
% Source Fields Generated by Nerlplanner version: 1.0.4

-define(SOURCE_POLICY_CASTING_IDX,"0").
-define(SOURCE_POLICY_ROUNDROBIN_IDX,"1").
Expand Down
4 changes: 3 additions & 1 deletion src_erl/NerlnetApp/src/worker_definitions_ag.hrl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
% This is an auto generated .hrl file
% Worker Fields Generated by Nerlplanner version: 1.0.3
% Worker Fields Generated by Nerlplanner version: 1.0.4

-define(WORKER_FIELD_KEY_MODEL_TYPE,modelType).
-define(WORKER_FIELD_KEY_MODEL_ARGS,modelArgs).
-define(WORKER_FIELD_KEY_LAYER_SIZES_LIST,layersSizes).
-define(WORKER_FIELD_KEY_LAYER_TYPES_LIST,layerTypesList).
-define(WORKER_FIELD_KEY_LAYERS_FUNCTIONS,layers_functions).
-define(WORKER_FIELD_KEY_LOSS_METHOD,lossMethod).
-define(WORKER_FIELD_KEY_LOSS_ARGS,lossArgs).
-define(WORKER_FIELD_KEY_LEARNING_RATE,lr).
-define(WORKER_FIELD_KEY_EPOCHS,epochs).
-define(WORKER_FIELD_KEY_OPTIMIZER_TYPE,optimizer).
Expand All @@ -22,6 +23,7 @@
-define(WORKER_FIELD_KEY_LAYER_TYPES_LIST_BIN,<<"layerTypesList">>).
-define(WORKER_FIELD_KEY_LAYERS_FUNCTIONS_BIN,<<"layers_functions">>).
-define(WORKER_FIELD_KEY_LOSS_METHOD_BIN,<<"lossMethod">>).
-define(WORKER_FIELD_KEY_LOSS_ARGS_BIN,<<"lossArgs">>).
-define(WORKER_FIELD_KEY_LEARNING_RATE_BIN,<<"lr">>).
-define(WORKER_FIELD_KEY_EPOCHS_BIN,<<"epochs">>).
-define(WORKER_FIELD_KEY_OPTIMIZER_TYPE_BIN,<<"optimizer">>).
Expand Down
2 changes: 1 addition & 1 deletion src_py/nerlPlanner/Definitions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import subprocess
from logger import *

VERSION = "1.0.3"
VERSION = "1.0.4"
NERLNET_VERSION_TESTED_WITH = "1.5.2"
NERLNET_TMP_PATH = "/tmp/nerlnet"
NERLNET_GRAPHVIZ_OUTPUT_DIR = f"{NERLNET_TMP_PATH}/nerlplanner"
Expand Down
4 changes: 2 additions & 2 deletions src_py/nerlPlanner/ErlHeadersExporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ def gen_worker_fields_hrl(header_path : str, debug : bool = False):

fields_list_vals = [KEY_MODEL_TYPE, KEY_MODEL_ARGS , KEY_LAYER_SIZES_LIST,
KEY_LAYER_TYPES_LIST, KEY_LAYERS_FUNCTIONS,
KEY_LOSS_METHOD, KEY_LEARNING_RATE,
KEY_LOSS_METHOD, KEY_LOSS_ARGS, KEY_LEARNING_RATE,
KEY_EPOCHS, KEY_OPTIMIZER_TYPE, KEY_OPTIMIZER_ARGS, KEY_INFRA_TYPE,
KEY_DISTRIBUTED_SYSTEM_TYPE, KEY_DISTRIBUTED_SYSTEM_TOKEN, KEY_DISTRIBUTED_SYSTEM_ARGS]
fields_list_strs = ['KEY_MODEL_TYPE', 'KEY_MODEL_ARGS', 'KEY_LAYER_SIZES_LIST',
'KEY_LAYER_TYPES_LIST', 'KEY_LAYERS_FUNCTIONS',
'KEY_LOSS_METHOD', 'KEY_LEARNING_RATE',
'KEY_LOSS_METHOD', 'KEY_LOSS_ARGS', 'KEY_LEARNING_RATE',
'KEY_EPOCHS', 'KEY_OPTIMIZER_TYPE', 'KEY_OPTIMIZER_ARGS', 'KEY_INFRA_TYPE',
'KEY_DISTRIBUTED_SYSTEM_TYPE', 'KEY_DISTRIBUTED_SYSTEM_TOKEN', 'KEY_DISTRIBUTED_SYSTEM_ARGS']
fields_list_strs = [f'WORKER_FIELD_{x}' for x in fields_list_strs]
Expand Down

0 comments on commit e52f44f

Please sign in to comment.