← Back to context

Comment by pascahousut

20 hours ago

Is the linear algebra of machine learning more complicated than that of graphics?

Both are large fields with many varied applications of linear algebra (and non-linear math too), and many people trying a lot of interesting & complicated ideas. The question is way too vague to answer meaningfully, it depends on what you mean by ‘graphics’ and by ‘machine learning’ and by ‘linear algebra’ and by ‘more complicated’. ;)

The linear algebra used in the basic raster pipeline to manage drawing a 3d unshaded mesh is pretty simple, and you can get by knowing just a little bit of linear algebra, like dot products and how to multiply matrices, and maybe what homogeneous coordinates are. But that is by no means the extent of linear algebra in all of graphics.

The linear algebra used in a basic neural network is also pretty simple, and you can get by knowing dot products and matrix multiply if you’re writing your own inference, and maybe just a tiny bit of derivative calculus if you’re writing your own backprop, but otherwise you don’t need anything else.

Students in both fields have to learn some basic linear algebra, but most people working in ML & graphics generally don’t use any linear algebra day to day, because most people aren’t writing inference/backprop and most people aren’t writing the graphics pipeline.

BTW, matrices and linear algebra are pure convenience for neural networks, and maybe for the graphics raster pipeline too. You can do both of these things without using matrices per se (though you might re-invent something equivalent and/or less efficient by avoiding matrices).

I'm a data scientist and not a graphics programmer, but my guess is that it's just abstracted away more. If you're using ML/DL libraries, you're mostly just calling APIs that handle the linear algebra and calculus for you. Unless you're actively contributing to those libraries, you likely don't ever need to "touch" any of the underlying operations. Up to a point, it's useful to understand how things work under the hood, but where that point is kinda depends on your job. For instance, I could write code to do 'naive' matrix multiplication, but I couldn't, like, contribute to BLAS.