| 35 | #include "operator/region.hpp" |
| 36 | |
| 37 | int entry_index(int batch, int location, int entry, int hw, int chw, int classes) |
| 38 | { |
| 39 | int coords = 4; |
| 40 | int n = location / hw; |
| 41 | int loc = location % hw; |
| 42 | return batch * chw + n * hw * (coords + classes + 1) + entry * hw + loc; |
| 43 | } |
| 44 | static inline float logistic_activate(float x) |
| 45 | { |
| 46 | return 1. / (1. + exp(-x)); |