instar-robotics / alexandria

Alexandria is a collection of functions for the Neural Networks Simulator Kheops.
GNU General Public License v3.0
1 stars 0 forks source link

Changing the rounding rule to solve dirac offset on 0 for odd number of neurons. #38

Closed adrienjauffret closed 5 years ago

adrienjauffret commented 5 years ago

When setting an odd number of neurons for the field, the dirac was not centered for x=0. This was due to the default FE_TONEAREST rounding method used by nearbyint() function.

Setting FE_DOWNWARD method allows to get the floor int rather than ceiling for exact midway (.5) between 2 int