Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you save your trained model? #54

Open
emsal0 opened this issue Dec 3, 2020 · 2 comments
Open

How do you save your trained model? #54

emsal0 opened this issue Dec 3, 2020 · 2 comments

Comments

@emsal0
Copy link
Contributor

emsal0 commented Dec 3, 2020

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.

@Pengxiao-Gao
Copy link

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?

@Shubham831831
Copy link

Shubham831831 commented May 30, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants