[791b436] | 1 | /* |
---|
| 2 | Copyright (C) 2018 Paul Brossier <piem@aubio.org> |
---|
| 3 | |
---|
| 4 | This file is part of aubio. |
---|
| 5 | |
---|
| 6 | aubio is free software: you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation, either version 3 of the License, or |
---|
| 9 | (at your option) any later version. |
---|
| 10 | |
---|
| 11 | aubio is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
| 15 | |
---|
| 16 | You should have received a copy of the GNU General Public License |
---|
| 17 | along with aubio. If not, see <http://www.gnu.org/licenses/>. |
---|
| 18 | |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | #ifndef AUBIO_MAXPOOL2D_H |
---|
| 22 | #define AUBIO_MAXPOOL2D_H |
---|
| 23 | |
---|
[217ca89] | 24 | /** \file |
---|
| 25 | |
---|
| 26 | Max pooling layer (2D) |
---|
| 27 | |
---|
| 28 | */ |
---|
| 29 | |
---|
[791b436] | 30 | #ifdef __cplusplus |
---|
| 31 | extern "C" { |
---|
| 32 | #endif |
---|
| 33 | |
---|
[217ca89] | 34 | /** maxpool2d layer */ |
---|
[791b436] | 35 | typedef struct _aubio_maxpool2d_t aubio_maxpool2d_t; |
---|
| 36 | |
---|
[217ca89] | 37 | /** create a new maxpool2d layer |
---|
| 38 | |
---|
| 39 | \param pool_size size of the pooling windows |
---|
| 40 | |
---|
| 41 | \return new ::aubio_maxpool2d_t layer |
---|
| 42 | |
---|
| 43 | */ |
---|
[791b436] | 44 | aubio_maxpool2d_t *new_aubio_maxpool2d(uint_t pool_size[2]); |
---|
| 45 | |
---|
[217ca89] | 46 | /** get output shape |
---|
[791b436] | 47 | |
---|
[217ca89] | 48 | \param t layer |
---|
| 49 | \param input input tensor |
---|
| 50 | \param shape output shape |
---|
[791b436] | 51 | |
---|
[217ca89] | 52 | \return 0 on success, non-zero otherwise |
---|
[791b436] | 53 | |
---|
[217ca89] | 54 | */ |
---|
[791b436] | 55 | uint_t aubio_maxpool2d_get_output_shape(aubio_maxpool2d_t *t, |
---|
| 56 | aubio_tensor_t *input, uint_t *shape); |
---|
| 57 | |
---|
[217ca89] | 58 | /** compute layer output |
---|
| 59 | |
---|
| 60 | \param t layer |
---|
| 61 | \param input_tensor input tensor |
---|
| 62 | \param output_tensor output tensor |
---|
| 63 | |
---|
| 64 | */ |
---|
| 65 | void aubio_maxpool2d_do(aubio_maxpool2d_t *t, |
---|
| 66 | aubio_tensor_t *input_tensor, |
---|
| 67 | aubio_tensor_t *output_tensor); |
---|
| 68 | |
---|
| 69 | /** destroy layer |
---|
| 70 | |
---|
| 71 | \param t layer to destroy |
---|
| 72 | |
---|
| 73 | */ |
---|
[791b436] | 74 | void del_aubio_maxpool2d(aubio_maxpool2d_t *t); |
---|
| 75 | |
---|
| 76 | #ifdef __cplusplus |
---|
| 77 | } |
---|
| 78 | #endif |
---|
| 79 | |
---|
| 80 | #endif /* AUBIO_MAXPOOL2D_H */ |
---|