automated change of number of neurons in a neural network

4 次查看(过去 30 天)
Hello,
i am trying to train a DDPG agent for a multiple number of nodes pro hidden layer, and i wanna know what is the best number of neurons to take. i know that i have to do through trail and fail. and i wanna know is there a function where i can automate it. i mean if i can do the training for different number of neurons pro hidden layer like create an array x = [16 32 64 128 256] and train the network for each number in the array (number of nodes pro hidden layer) in a for loop ?

回答(1 个)

Shubh Dhyani
Shubh Dhyani 2022-11-4
I understand that you are trying to train a DDPG agent for multiple numbers of nodes for hidden layers and want to know what is the best number of neurons that you can take. I am assuming that the word "best" signifies the most optimized value (having the least loss) of the number of neurons.
The number of neurons can be considered as a hyperparameter of the neural network. For finding the most optimal value of the number of neurons (layer size), you can use hyperparameter tuning methods. Although MATLAB has no specific hyperparameter tuning function, you can make use of Bayesian Optimization method for hyperparameter tuning.
You can refer to the following link for more information about the same :

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

产品


版本

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by