Removed a few places were the % operator was applied to the dx component (that should basically never happen, afaict)
Set dx to 0 in a few cases (floor, ceil, round, etc). These functions are flat everywhere they're differentiable, epsilon perturbations will always leave the value unchanged, so the dx component should be wiped out by them, unless I'm mistaken.
I considered adding tests but simple tests would just repeat my assumptions about how the math should work (e.g. asserting dx == 0 in some cases). It would be nice to add tests that perturb values by EPSILON, and verify that the empirical and theoretical gradients match. I'm open to trying that out, but maybe as a follow-on PR, as ≈all of the operations warrant that, not just the ones I've touched here.
I could be wrong about these, but:
%
operator was applied to thedx
component (that should basically never happen, afaict)dx
to 0 in a few cases (floor
,ceil
,round
, etc). These functions are flat everywhere they're differentiable, epsilon perturbations will always leave the value unchanged, so thedx
component should be wiped out by them, unless I'm mistaken.I considered adding tests but simple tests would just repeat my assumptions about how the math should work (e.g. asserting
dx == 0
in some cases). It would be nice to add tests that perturb values byEPSILON
, and verify that the empirical and theoretical gradients match. I'm open to trying that out, but maybe as a follow-on PR, as ≈all of the operations warrant that, not just the ones I've touched here.