Implicit bias as a Gauge correction: Theory and Inverse Design