Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic Pool Ops are zero #221

Open
victorromeo opened this issue Jan 18, 2021 · 0 comments
Open

Generic Pool Ops are zero #221

victorromeo opened this issue Jan 18, 2021 · 0 comments

Comments

@victorromeo
Copy link
Contributor

victorromeo commented Jan 18, 2021

When using a Generic Pool Operation, MaxPoolOperator, MinPoolOperator or AvgPoolOperator, are influenced by the following kernel code

 filter.reset();
          for (int filter_y = 0; filter_y < filter_rows; ++filter_y) {
            for (int filter_x = 0; filter_x < filter_cols; ++filter_x) {
              // for (int in_channel = 0; in_channel < input_depth;
              // ++in_channel) {
              const int in_x = in_x_origin + filter_x;
              const int in_y = in_y_origin + filter_y;
              T input_value;
              if ((in_x >= 0) && (in_x < input_cols) && (in_y >= 0) &&
                  (in_y < input_rows)) {
                // Commenting out since these indices might be useful later
                /*
                  size_t input_index = batch * input_rows * input_cols *
                  input_depth + in_y * input_cols * input_depth + in_x *
                  input_depth + in_channel; input_value =
                  in((uint32_t)input_index);
                 */
                input_value = in(batch, in_y, in_x, out_channel);
              } else {
                input_value = 0;   <=  ZERO value here messes with the result
              }
              // size_t filter_index = filter_y * filter_cols * input_depth *
              // filter_count +
              //    filter_x * input_depth * filter_count +
              //    in_channel * filter_count + out_channel;
              // const T filter_value = filter(filter_index);
              filter.PartialCompute(input_value, filter_y, filter_x,
                                    out_channel, out_channel);
              //}
            }
          }

I believe the PartialCompute is incorrectly calculated due to the zero value. If 0 is less than a MinFilter tmp result, or 0 is greater than the MaxFilter tmp result, the value will be 0, in the output tensor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant