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)