I need a simple implementation (in Matlab) of the most basic SPSA algorithm for a friend of mine. I have found this code from J.C. Spall but I don't know where to find an implementation of an appropriate loss function.
I don't know much about the subject, so pointing me out on any direction would be really helpful.
As I understand the algorithm, the loss function is the objective function that you wish to optimize, so at each iteration you compute your function at the proposed thetas and approximate the gradient.