Modeling of SMA materials: training and two way shape memory effects