Magnetic Learning