4 ms·
I have often found myself closer to the opposite end of the spectrum. Many machine learning algorithms and applications (certainly not all) can tolerate a fair
by srean 12y ago
I have often found myself closer to the opposite end of the spectrum. Many machine learning algorithms and applications (certainly not all) can tolerate a fair degree of inaccuracy. This is often justified by the fact that the training data is typically noisy to begin with and is a random sample from the space it lives in. If your algorithm can be stable under those conditions it ought to be stable under floating point jitter.
This usually means you need regularization, or smoothing, or low pass filter, or averaging in some guise or the other (in some abstract way they are the same thing). There are some frequently used operations in ML that are very unstable under inaccuracies, numeric differentiation is one, just dont do it without smoothening. Inverting matrices is another, but you better have a real solid reason to ever invert a matrix, yes there are reasons when you do really want the inverse.
In any case the final point is that I have had to baby talk the compilers into, "yes, please please dont worry about it, just do these commutative (for real numbers) operations in any order that you want". This exposes more parallelism and other compiler optimizations. Often I would gladly take the hit over some precision in higher order decimal places to gain speed. But this should not be done blindly, and a smattering of numerical analysis helps gauging when it would be safe to do so. I doubt whether numerical analysis figures prominently in the trajectory of a graduating machine learner, although I think it ought to.
- TheLoneWolfling 12y agoOne of the advantages of languages with N-ary operators. * (a,b,c) can take advantage of those tricks, whereas the programmer can still be explicit and go * (a, * (b, c)), for example.
- srean 12y agoIndeed. Do you have some specific examples in mind, I would love knowing more. The usual suspects, for example fold_left, fold_right would typically adhere to fixed order for floating point operations. A reason Java is a FLOPs killer is that its standard is too strictly specified, it does not leave much room for the runtime to take advantage of these features. Even order of argument evaluation for functions are specified to be left to right.