Why there are so many optimizer algorithms?

Hi @Muhammad_John_Abbas

thanks for your message and welcome to the community!

As addition:

Not only when gradients are difficult to compute but also if you have a highly non-convex optimization resp. if you face many local minima but many of them are not sufficient to solve your business problem, gradient-free methods can help, even though they can (in general) be worse performance-wise than gradient-based ones.
Some popular examples for gradient-free optimizers are:

By the way: in this paper also a nice overview on gradient-free and gradient-based optimizers are outlined in the introduction: https://www.sciencedirect.com/science/article/pii/S0021999121006835

Best regards