source code of training sample on server side