commit 545dead: [Project] Neural: Fix matrix gemm

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Aug 28 16:42:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-08-28 17:37:38 +0100
URL: https://github.com/rspamd/rspamd/commit/545deadb7e1f392478e1537aee5d3b1c39b358f9

[Project] Neural: Fix matrix gemm

---
 src/lua/lua_kann.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/lua/lua_kann.c b/src/lua/lua_kann.c
index 30bff538a..b5ddc55f2 100644
--- a/src/lua/lua_kann.c
+++ b/src/lua/lua_kann.c
@@ -1140,9 +1140,9 @@ lua_kann_train1 (lua_State *L)
 					lua_pop (L, 1);
 				}
 
-				kad_sgemm_simple (0, 0, pca->dim[0], 1,
-						pca->dim[1], pca->data,
-						tmp_row, x[s]);
+				kad_sgemm_simple (0, 1, 1, n_in,
+						pca->dim[1], tmp_row, pca->data,
+						x[s]);
 			}
 
 			lua_pop (L, 1);
@@ -1267,9 +1267,9 @@ lua_kann_apply1 (lua_State *L)
 			if (pca) {
 				pca_out = g_malloc (sizeof (float) * n_in);
 
-				kad_sgemm_simple (0, 0, pca->dim[0], 1,
-						pca->dim[1], pca->data,
-						vec, pca_out);
+				kad_sgemm_simple (0, 1, 1, n_in,
+						vec_len, vec, pca->data,
+						pca_out);
 
 				kann_feed_bind (k, KANN_F_IN, 0, &pca_out);
 			}


More information about the Commits mailing list