Cartpole - Number of layers and neurons - model hyperparameters

Can anyone please suggest me how to arrive to the best optimal values for number of layers, number of neurons parameters of the deep learning model in DDQN algorithm for cartpole problem. As input and output neurons are 4 and 2 respectively for cartpole, are there any scientific reasons or maths behind choosing number of hidden layers and neurons in them.

I have followed this link to build reinforcement learning algorithm https://pylessons.com/CartPole-reinforcement-learning/

Topic dqn reinforcement-learning deep-learning

Category Data Science


The one of the best methods to find hyperparameter values is cross-validation. Empirically try different different number of layers and different number of neurons and see which set of values has best performance on hold-out dataset.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.