News for hackers. Stuff that matters.
Re:Optimization Without Derivatives: Prima Fortran Version a... by efavdb on Tuesday May 16, 2023 @08:39AM (#35961028)
Yes sometimes it’s hard to measure a derivative. Eg when doing hyperparameter tuning in ML, you can read out a metric at a given choice of parameters, but it’s generally not easy to get a gradient.

Shameless plug: I happen to have recently written a package for the opposite limit! It finds roots when you can only measure the derivative.

https://github.com/EFavDB/inchwormrf

Re:Optimization Without Derivatives: Prima Fortran Version a... by quickthrower2 on Tuesday May 16, 2023 @08:42AM (#35961065)
I assume backprop is still most efficient for the neural net itself, rather than one of these algorithms? I am doing a course and I am aware that there are other algorithms than gradient descent but haven’t seen the details yet on that.

I know things like cross entropy loss are designed to be easy to differentiate and probably more efficient to do that than something that approximates it.

Re:Optimization Without Derivatives: Prima Fortran Version a... by efavdb on Tuesday May 16, 2023 @08:45AM (#35961096)
Yeah, backprop gives efficient gradient calcs to train at a given net architecture. To find the best architecture though people try various other methods, eg random search or Gaussian processes, which don’t evaluate derivatives wrt architecture Params.
Re:Optimization Without Derivatives: Prima Fortran Version a... by imurray on Tuesday May 16, 2023 @09:26AM (#35961569)
You might be interested in David MacKay's old conjugate gradient implementation in C that also only uses derivatives: https://www.inference.org.uk/mackay/c/macopt.html

(It was written in another time, don't expect it to be nice. My Octave/Matlab wrappers on that page have almost certainly bit-rotted, don't expect them to work.)

Re:Optimization Without Derivatives: Prima Fortran Version a... by efavdb on Tuesday May 16, 2023 @10:05AM (#35962081)
Thank you! I’ll definitely check this out.
Re:Optimization Without Derivatives: Prima Fortran Version a... by enriquto on Tuesday May 16, 2023 @01:15PM (#35964845)
> It finds roots when you can only measure the derivative.

How is that even possible? The function f(x)=x-7 has a single root at x=7. Its derivative is f'(x)=1. How do you recover 7 from 1 ?

Re:Optimization Without Derivatives: Prima Fortran Version a... by CorrectHorseBat on Tuesday May 16, 2023 @02:58PM (#35966117)
You need one initial value to start from