Browse Source

fix lrn within channel

tags/20171225
nihui 8 years ago
parent
commit
20b1330cdb
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      src/layer/arm/lrn_arm.cpp
  2. +2
    -2
      src/layer/lrn.cpp

+ 1
- 1
src/layer/arm/lrn_arm.cpp View File

@@ -84,7 +84,7 @@ int LRN_arm::forward_inplace(Mat& bottom_top_blob) const
for (int q=0; q<channels; q++)
{
// square sum
for (int p=q - local_size / 2; p<q + local_size; p++)
for (int p=q - local_size / 2; p<=q + local_size / 2; p++)
{
if (p < 0 || p >= channels)
continue;


+ 2
- 2
src/layer/lrn.cpp View File

@@ -75,7 +75,7 @@ int LRN::forward(const Mat& bottom_blob, Mat& top_blob) const
{
// square sum
float* outptr = top_blob.channel(q);
for (int p=q - local_size / 2; p<q + local_size; p++)
for (int p=q - local_size / 2; p<=q + local_size / 2; p++)
{
if (p < 0 || p >= channels)
continue;
@@ -207,7 +207,7 @@ int LRN::forward_inplace(Mat& bottom_top_blob) const
{
// square sum
float* ssptr = square_sum.channel(q);
for (int p=q - local_size / 2; p<q + local_size; p++)
for (int p=q - local_size / 2; p<=q + local_size / 2; p++)
{
if (p < 0 || p >= channels)
continue;


Loading…
Cancel
Save