From 6785bd57a1f75a1984b2bac5da69dcbcb05c1bc2 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sun, 15 May 2022 18:22:41 -0700 Subject: Optimize away weights_T during training. Mnist-1000: 18s -> 15s. --- src/lib/include/neuralnet/matrix.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lib/include') diff --git a/src/lib/include/neuralnet/matrix.h b/src/lib/include/neuralnet/matrix.h index 9816b81..0cb40cf 100644 --- a/src/lib/include/neuralnet/matrix.h +++ b/src/lib/include/neuralnet/matrix.h @@ -52,6 +52,12 @@ void nnMatrixInitConstant(nnMatrix*, R value); /// Multiply two matrices. void nnMatrixMul(const nnMatrix* left, const nnMatrix* right, nnMatrix* out); +/// Multiply two matrices, row variant. +/// +/// This function multiples two matrices row-by-row instead of row-by-column. +/// nnMatrixMul(A, B, O) == nnMatrixMulRows(A, B^T, O). +void nnMatrixMulRows(const nnMatrix* left, const nnMatrix* right, nnMatrix* out); + /// Matrix multiply-add. /// /// out = left + (right * scale) -- cgit v1.2.3