Skip to content

Commit

Permalink
Merge pull request #264 from leondavi/nerlplanner_cnn
Browse files Browse the repository at this point in the history
[NERLPLANNER] Add CNN support
  • Loading branch information
leondavi authored Nov 10, 2023
2 parents ddb84a3 + 7bdad82 commit fded6a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src_py/nerlPlanner/WinWorkerDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def WinWorkerDialog():
[sg.Text("*.json file name"),sg.InputText(key=KEY_JSON_FILE_NAME, enable_events=True),sg.Button("Export",key=KEY_BUTTON_EXPORT_WORKER), sg.Checkbox('with documentation', default=True, key=KEY_CHECKBOX_WORKER_WITH_DOCUMENTATION, enable_events=True)]]
WorkerFileFrame = sg.Frame("File",WorkerFileLayout)

WorkerDefinitionsLayout = [[sg.Text("Model Type: "), sg.Combo(list(ModelTypeMapping.keys()),enable_events=True, key=KEY_MODEL_TYPE_LIST_BOX), sg.Button("LSTM Opts",disabled=True), sg.Button("CNN Opts", disabled=True)],
WorkerDefinitionsLayout = [[sg.Text("Model Type: "), sg.Combo(list(ModelTypeMapping.keys()),enable_events=True, key=KEY_MODEL_TYPE_LIST_BOX), sg.Button("LSTM Opts",disabled=True), sg.Button("CNN Opts", enable_events=True, key=KEY_LAYER_CNN_OPT_HELP_BUTTON )],
[sg.Text("Layers Sizes: Comma separated list, # of neurons in a layer, E.g, 100,80,40,5,1")],
[sg.InputText(key=KEY_LAYER_SIZES_INPUT,enable_events=True), sg.Text("(0)",key=KEY_NUM_OF_LAYERS_SIZES)],
[sg.InputText(key=KEY_LAYER_SIZES_INPUT,enable_events=True, expand_x=True), sg.Text("(0)",key=KEY_NUM_OF_LAYERS_SIZES)],
[sg.Text("List of layers types:"), sg.Combo(list(LayerTypeMap.keys()),key=KEY_LAYER_TYPE_SELECTION), sg.Button("Add",key=KEY_LAYER_TYPE_SELECTION_ADD), sg.Button("Help",key=KEY_LAYER_TYPE_HELP),sg.Button("Clear",key=KEY_LAYER_TYPE_SELECTION_CLEAR)],
[sg.InputText(key=KEY_LAYER_TYPE_CODES_INPUT,enable_events=True), sg.Text("(0)",key=KEY_NUM_OF_LAYERS_TYPES,enable_events=True)],
[sg.InputText(key=KEY_LAYER_TYPE_CODES_INPUT,enable_events=True, expand_x=True), sg.Text("(0)",key=KEY_NUM_OF_LAYERS_TYPES,enable_events=True)],
[sg.Text("Layers Functionality-Codes"),sg.Button("Select Layer Method", enable_events=True, key=KEY_LAYER_METHODS_BUTTON_SELECT), sg.Button("Help",key="-ACTIVATION-LAYER-HELP-"), sg.Button("Clear",key=KEY_LAYER_FUNCTIONS_SELECTION_CLEAR)],
[sg.InputText(key=KEY_LAYER_FUNCTIONS_CODES_INPUT,enable_events=True), sg.Text("(0)",key=KEY_LAYERS_FUNCTIONS_CODES,enable_events=True), sg.Text("",enable_events=True, key=KEY_LAYER_METHODS_TEXT_SELECTION)]]
[sg.InputText(key=KEY_LAYER_FUNCTIONS_CODES_INPUT,enable_events=True, expand_x=True), sg.Text("(0)",key=KEY_LAYERS_FUNCTIONS_CODES,enable_events=True)]]
WorkerDefinitionsFrame = sg.Frame("Model Definitions",layout=WorkerDefinitionsLayout, expand_x=True)

OptimizerDefinitionsLayout = [[sg.Text("Learning Rate: "), sg.InputText(key=KEY_LEARNING_RATE_INPUT, size=(15), enable_events=True)],
Expand Down Expand Up @@ -99,6 +99,10 @@ def ui_update_all_values(WorkerWindow):
ModelTypeStr = values[event]
ModelType = ModelTypeMapping[ModelTypeStr]

if event == KEY_LAYER_CNN_OPT_HELP_BUTTON:
sg.popup_ok(f"{LAYER_CNN_OPTS_HELP_POPUP_STR}", keep_on_top=True, title="CNN Options Help")


# Layers Sizes List
if event == KEY_LAYER_SIZES_INPUT:
LayersSizesList = values[event]
Expand Down
6 changes: 4 additions & 2 deletions src_py/nerlPlanner/WinWorkerDialogDefnitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
KEY_NUM_OF_LAYERS_SIZES = '-NUM-OF-LAYERS-SIZES-'
KEY_LAYER_TYPE_SELECTION = '-LAYER-TYPE-SELECTION-'
KEY_LAYER_TYPE_SELECTION_ADD = '-LAYER-TYPE-SELECTION-ADD-'
KEY_LAYER_CNN_OPT_HELP_BUTTON = '-KEY-LAYER-CNN-OPT-HELP-BUTTON-'
KEY_LAYER_TYPE_HELP = '-LAYER-TYPE-HELP-'
KEY_LAYER_TYPE_SELECTION_CLEAR = '-LAYER-TYPE-SELECTION-CLEAR-'
KEY_LAYER_TYPE_CODES_INPUT = '-LAYER-TYPE-CODES-INPUT-'
KEY_NUM_OF_LAYERS_TYPES = '-NUM-OF-LAYERS-TYPES-'

KEY_LAYER_METHODS_BUTTON_SELECT = '-LAYER-METHODS-BUTTON-SELECT-'
KEY_LAYER_METHODS_TEXT_SELECTION = '-LAYER-METHODS-TEXT-SELECTION-'

KEY_ACTIVATION_LAYER_SELECTION = '-ACTIVATION-LAYER-SELECTION-'
KEY_ACTIVATION_LAYER_SELECTION_ADD = '-ACTIVATION-LAYER-SELECTION-ADD-'
Expand Down Expand Up @@ -45,4 +45,6 @@
KEY_LAYER_METHOD_SELECTION_DIALOG_LISTBOX_SCALER = '-LAYER-METHOD-SELECTION-DIALOG-LISTBOX-SCALER-'
KEY_LAYER_METHOD_SELECTION_DIALOG_LISTBOX_PROBABILISTIC = '-LAYER-METHOD-SELECTION-DIALOG-LISTBOX-PROBABILISTIC-'
KEY_LAYER_METHOD_SELECTION_TEXT = '-LAYER-METHOD-SELECTION-TEXT-'
KEY_LAYER_METHOD_SELECTION_BUTTON = '-LAYER-METHOD-SELECTION-BUTTON-'
KEY_LAYER_METHOD_SELECTION_BUTTON = '-LAYER-METHOD-SELECTION-BUTTON-'

LAYER_CNN_OPTS_HELP_POPUP_STR = 'CNN Layer definition: <W>x<H>k<K>s<S>\n\nShould be defined only with CNN layer type code\nW - Width\nH - Height\nK - Kernel size <K>x<K>\nS - Stride\n\nExample:\n128x128k3s2 represents a CNN layer\ninput size is 128x128\nkernel size 3x3 and stride of 2'

0 comments on commit fded6a3

Please sign in to comment.