optimize to obtain the maximum of a well trained neural network output

Obtain the maximum of the output of a well trained neural network in the domain.

I trained a neural network and tested it with good accuracy.
Based on the built neural network, how to obtain the maximum of the output of it in the domain?

Is there any such example?
Could you please provide a minimal code example?