Can the gradient of rounding operation be calculated?

945 Views Asked by At

I want to integrate a rounding operation in one of my optimization problem. Since in the rest parts of my algorithm, the gradient (or subgradient) can be easily calculated (basically neural network). Now I want to add the integer constraints on the output of the algorithm, is there anyway I can do that even without the rounding operation? I don't mean to post process my output with rounding operation, I simply want to integrate the rounding operation in the whole back-propagation setting.