PILCO icon indicating copy to clipboard operation
PILCO copied to clipboard

How do you save your trained model?

Open emsal0 opened this issue 4 years ago • 2 comments

I've tried using pickle but it's unable to serialize the PILCO object after training.

Is there a builtin save method? Or does another kind of serialization work? Thanks.

emsal0 avatar Dec 03 '20 21:12 emsal0

I've tried using pickle but it's unable to serialize the PILCO object after training.

Is there a builtin save method? Or does another kind of serialization work? Thanks.

Hi, there was function to save and load model in pull requests Utils pr #17 when pilco using TF1 and GP1, but now no attribute 'read_values' in GP2. Have you any solutions now?

Pengxiao-Gao avatar Feb 09 '21 09:02 Pengxiao-Gao

Hello, We can save controller parameters (best_parameters variable in pilco) by using pickle and recreating the controller based on these parameters. Procedure :

  1. Save best_parameters of controller in pickle file during each iteration.
  2. Recreate controller using controller.py and these parameters.
  3. Use this controller on environment.

Example: For RBF controller best_parameters contains: DataX, DataY, and Lengthscales. With these parameters, we can recreate RBF controller.

Shubham831831 avatar May 30 '22 12:05 Shubham831831