Develop a lightweight library that implements the 'Artificial Special Intelligence' training loop for MedMNIST, specifically targeting error-free convergence on medical imaging tasks.