3 ms·
I don't understand the naming and notation of this article because the author is assuming context that I don't have. Section baseline: What are N, M, K? 3 matr
by bruce343434 5y ago
I don't understand the naming and notation of this article because the author is assuming context that I don't have.
Section baseline:
What are N, M, K? 3 matrices or? Laid out as a flat array, or what? `c[m * N + n] += a[m * K + k] * b[k * N + n];`, ah, apparently a b and c are the matrices? How does this work?
Section body:
What is the mathy "C′=αC+A⋅B"? derivative of a constant is the angle times the constant plus the dot product of A and B???
- conradludgate 5y agoThere are 3 matrices in question: A, B and C. They have dimensions (M * K), (K * N) and (M * N) respectively. They are laid out, rather than nested arrays, as a single continuous collection of bytes that can be interpreted as having a matrix shape. That's where the `m * N + n` comes from (m rows down and n cols in) C' = alpha C + A.B This is the 'generalised matrix-matrix multiplication' (GEMM) operation. It's multiplying the matrices A and B, adding it to a scales version of C and inserting it back into C. Setting alpha to 0 gets you basic matmul
- wheelerof4te 5y agoThank you for this detailed explanation. Making the matrix one-dimensional makes sense from the performance standpoint.