modifying training method for supporting params