max pooling in c 2b 2b

Solutions on MaxInterview for max pooling in c 2b 2b by the best coders in the world

showing results for - "max pooling in c 2b 2b"
Elvis
31 Jan 2019
1for (size_t y = 0; y < out_height; ++y) {
2    for (size_t x = 0; x < out_width; ++x) {
3        for (size_t i = 0; i < pool_y; ++i) {
4            for (size_t j = 0; j < pool_x; ++j) {
5                for (size_t c = 0; c < depth; ++c) {
6                    float value = in[y * pool_y + i][x * pool_x + j][c];
7                    out[y][x][c] = max(out[y][x][c], value);
8                }
9            }
10        }
11    }
12}
13