In situ optical gradient measurement enables photonic chip training | HACKOBAR_