From 6133e2f497b55fd1d0e561869d38ec37be78aff9 Mon Sep 17 00:00:00 2001 From: "Eric V. Strobl" Date: Tue, 4 Mar 2014 16:52:13 -0500 Subject: [PATCH] Update nnbp.m added rectified linear and softplus activation functions --- NN/nnbp.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NN/nnbp.m b/NN/nnbp.m index 1217719..673115f 100644 --- a/NN/nnbp.m +++ b/NN/nnbp.m @@ -17,6 +17,11 @@ d_act = nn.a{i} .* (1 - nn.a{i}); case 'tanh_opt' d_act = 1.7159 * 2/3 * (1 - 1/(1.7159)^2 * nn.a{i}.^2); + case 'relu' + d_act = nn.a{i}; + d_act(find(d_act>0))=1; d_act(find(d_act<=0))=0; + case 'softp' + d_act = 1./(1+exp(-nn.a{i})); end if(nn.nonSparsityPenalty>0)