write hessian and parameters to file on model end