Half-Inverse Gradients for Physical Deep Learning