Learning function

The SM2-similar learning function is implemented