Changeset 6c39d11


Ignore:
Timestamp:
Dec 29, 2021, 5:51:48 PM (3 weeks ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe
Children:
3cbcc40
Parents:
b9616b0
git-author:
Paul Brossier <piem@piem.org> (01/08/19 00:05:26)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:51:48)
Message:

[maxpool1d] use first element to initialize output value, add a stride

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/maxpool1d.c

    rb9616b0 r6c39d11  
    9191  for (j = 0; j < output_tensor->shape[1]; j++) {
    9292    for (i = 0; i < output_tensor->shape[0]; i++) {
    93       smpl_t m = -FLT_MAX;
     93      uint_t stride_i = i * c->pool_size;
     94      smpl_t m = input_tensor->data[stride_i][j];
    9495      for (a = 0; a < c->pool_size; a++) {
    95         m = MAX(m, input_tensor->data[i * c->pool_size + a][j]);
     96        m = MAX(m, input_tensor->data[stride_i + a][j]);
    9697      }
    9798      output_tensor->data[i][j] = m;
Note: See TracChangeset for help on using the changeset viewer.