Real-time elastic partial shape matching using a neural network-based adjoint method