Matrix.lua • Deluxe & Certified
: Allows you to pass any anonymous function, such as function(val) return math.max(0, val) end (ReLU activation).
While the existing library supports basic arithmetic, a dedicated mapping function fills the gap for non-linear operations. matrix.lua
: It prevents users from writing repetitive nested for loops, making the code cleaner and less error-prone. : Allows you to pass any anonymous function,
: Extend it to accept multiple matrices of the same size, allowing for element-wise operations between them (like c[i][j] = f(a[i][j], b[i][j]) ). Implementation Concept such as function(val) return math.max(0
This feature applies a given function to every element in a matrix, returning a new matrix with the results.