4 ms·
This raises a question that I'm still wondering about. Matrix operations are useful for high-performance computing because a lot of useful operations can be tr
by Athas 9y ago
This raises a question that I'm still wondering about. Matrix operations are useful for high-performance computing because a lot of useful operations can be transformed (with varying effort) into matrix operations. Hence, with access to a relatively small library of high-performance implementations of these operations, one can obtain good computational performance. This is certainly practical.
However, is the matrix formulation the best one, if we have access to a programming language (like CUDA) where we have more flexibility in how we perform computation? For example, while we might be able to express k-means clustering as a matrix operation, we might express it more efficiently by programming it directly.
- srean 9y agoI think this will be an even more meaningful discussion if you can identify an overhead or a redundant computation in the reduction of k-means to matrix and linear algebraic operations. BTW specific APIs are a different matter, they can and do entail overheads unless compiler optimization and runtime JIT can remove them. If there aren't any redundant operation, matrices give a good abstraction that does not leak much. Libraries take care of the best use of cache. If you have to build castles out of individual grains of sand and burnt clay, it will limit how many of them you can build. That's why building blocks are useful. Where the building blocks don't quite fit, there is always sand, clay and mortar to fill the gaps.