Fortunately, many tools exist that allow such automatic parameter optimization. Talos (https://github.com/autonomio/talos) is one such tool built on top of the Keras library, made available as open source on GitHub. It allows you to predefine a set of hyperparameters (such as different number of layers, neurons per layer, and activation functions), after which the tool will automatically train and compare those Keras models to assess which one performs better.
Other solutions such as Hyperas (https://github.com/maxpumperla/hyperas ) or auto_ML (https://auto-ml.readthedocs.io/en/latest/) allow similar functionalities and can help drastically reduce development time, allowing you to discover what hyperparameters work best for your task. In fact, you can use such tools and make your own genetic algorithms that help you select from...