Modeling of SMA materials: training and two way memory effects