Changeset f9f03ff for src


Ignore:
Timestamp:
Jan 8, 2019, 12:05:26 AM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn_org, feature/crepe_org
Children:
7420c40
Parents:
1768cdb
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ai/maxpool1d.c

    r1768cdb rf9f03ff  
    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.