From 3856e63dab1b28aaec4133b6b0ec2a44ebf8cf46 Mon Sep 17 00:00:00 2001 From: Qi Liu Date: Tue, 21 Jun 2016 15:42:22 +0800 Subject: complete bp of softmax layer --- nerv/lib/matrix/generic/cumatrix.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'nerv/lib/matrix/generic/cumatrix.c') 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 -- cgit v1.2.3