diff options
author | Qi Liu <liuq901@163.com> | 2016-06-21 15:49:07 +0800 |
---|---|---|
committer | Qi Liu <liuq901@163.com> | 2016-06-21 15:49:07 +0800 |
commit | 3622d8315aad9f8438b1cfcb734165de459725a9 (patch) | |
tree | ed20795f95854c72137bd7537a4097582e997fb3 /nerv/matrix/generic/matrix.c | |
parent | bc49910f6f55620a4fb4e7038e751bab52fdafa6 (diff) | |
parent | 3856e63dab1b28aaec4133b6b0ec2a44ebf8cf46 (diff) |
Master
add back propagation function for softmax
See merge request !6
Diffstat (limited to 'nerv/matrix/generic/matrix.c')
-rw-r--r-- | nerv/matrix/generic/matrix.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nerv/matrix/generic/matrix.c b/nerv/matrix/generic/matrix.c index 9f31b4b..c679731 100644 --- a/nerv/matrix/generic/matrix.c +++ b/nerv/matrix/generic/matrix.c @@ -270,6 +270,18 @@ static int nerv_matrix_(lua_add_row)(lua_State *L) { return 0; } +static int nerv_matrix_(lua_add_col)(lua_State *L) { + Status status; + MATRIX_CONTEXT *context; + MATRIX_GET_CONTEXT(L, 4); + const Matrix *a = luaT_checkudata(L, 2, nerv_matrix_(tname)); + Matrix *b = luaT_checkudata(L, 1, nerv_matrix_(tname)); + double beta = luaL_checknumber(L, 3); + nerv_matrix_(add_col)(b, a, beta, context, &status); + NERV_LUA_CHECK_STATUS(L, status); + return 0; +} + static int nerv_matrix_(lua_fill)(lua_State *L) { Status status; MATRIX_CONTEXT *context; |