I need to integrate a root finding algorithm in a neural network. For that, and in order to be able to perform backpropgation I need the algortihm to be differentiable. Is there any method/ algorithm to get a root finding that is compatible with a neural network, i.e is differentiable? I want to use a learned function that based on an equation will perform a root finding algorithm to provide the target for the cost function. So for this I a root finding algorithm (if there is any) that is compatible with automatic differentiation during the backpropagation i.e is differentiable.
The root of the following equation would be the target and L would be the learned function:
D_1L(q(k-1), q(k)) + D_2L(q(k),q(k+1)) = 0
Where D1 and D2 are derivatives with respect to ith argument of L.
Another way would maybe try to use unsupervised learning to learn L based on the previous equation. Any hint? Thank you