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/lib/matrix/generic/cumatrix.c | |
parent | bc49910f6f55620a4fb4e7038e751bab52fdafa6 (diff) | |
parent | 3856e63dab1b28aaec4133b6b0ec2a44ebf8cf46 (diff) |
Master
add back propagation function for softmax
See merge request !6
Diffstat (limited to 'nerv/lib/matrix/generic/cumatrix.c')
-rw-r--r-- | nerv/lib/matrix/generic/cumatrix.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/nerv/lib/matrix/generic/cumatrix.c b/nerv/lib/matrix/generic/cumatrix.c index 432222a..52cfe50 100644 --- a/nerv/lib/matrix/generic/cumatrix.c +++ b/nerv/lib/matrix/generic/cumatrix.c @@ -244,6 +244,18 @@ void nerv_matrix_(add_row)(Matrix *b, const Matrix *a, double beta, NERV_SET_STATUS(status, NERV_NORMAL, 0); } +void nerv_matrix_(add_col)(Matrix *b, const Matrix *a, double beta, + CuContext *context, Status *status) { + if (a->nrow != b->nrow) + NERV_EXIT_STATUS(status, MAT_MISMATCH_DIM, 0); + if (a->ncol != 1) + NERV_EXIT_STATUS(status, MAT_COL_VECTOR_EXP, 0); + PROFILE_START + cudak_(cuda_add_col)(a, b, beta); + PROFILE_STOP + NERV_SET_STATUS(status, NERV_NORMAL, 0); +} + void nerv_matrix_(fill)(Matrix *self, double val, CuContext *context, Status *status) { PROFILE_START |