The impletation of LM algorithm in python