JeffersonLab / SciOptControlToolkit

6 stars 2 forks source link

Error reporting bug in actor and critic models config check #3

Closed Kishanrajput closed 4 months ago

Kishanrajput commented 5 months ago

Both actor fcnn and critic fcnn has this condition

if hidden_layers != len(nodes_per_layer) or hidden_layers != len(activation_functions)+1: if hidden_layers != len(nodes_per_layer): act_log.error("Number of nodes per layer does not match the number of hidden layers in the config.") else: # hidden_layers != len(activation_functions)+1 act_log.error("Number of activation functions (+1 for output layer) does not match the number of hidden layers in the config.")

The second condition in the if statement will always be true unless you provide activation_function list one short of number of hidden layers which will eventually throw error later in the model building. I believe it was meant to be something like below? hidden_layers != len(activation_functions)-1

Sorry for missing this in review.

armenkasp commented 5 months ago

Made a branch with the fix and into a PR, sorry about that!

armenkasp commented 4 months ago

Will be fixed in next release with removal of final layer configuration change