Beyond backpropagation: bilevel optimization through implicit differentiation and equilibrium propagation