add training sample code