Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'generic/SoftMax.c')
-rw-r--r--generic/SoftMax.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/SoftMax.c b/generic/SoftMax.c
index fd73b3e..bddb70d 100644
--- a/generic/SoftMax.c
+++ b/generic/SoftMax.c
@@ -31,11 +31,13 @@ static int nn_(SoftMax_updateOutput)(lua_State *L)
for(t = 0; t < nframe; t++)
{
real inputMax = -THInf;
+ accreal sum;
+
for(d = 0; d < dim; d++) {
if (input_data[d] >= inputMax) inputMax = input_data[d];
}
- accreal sum = 0;
+ sum = 0;
for(d = 0; d < dim; d++) {
real z = THExpMinusApprox(inputMax - input_data[d]);
output_data[d] = z;