Skip to content
Discussion options

You must be logged in to vote

Right: you can’t have a successful warm start without raw_julia_state_, and that is cleared from the state when the PySRRegressor is saved to a pickle file.

However you could try to save this object using the Serialization library in Julia: https://docs.julialang.org/en/v1/stdlib/Serialization/. You will need to access this with PyJulia,
for example:

from julia import Serialization

Serialization.serialize(
    "checkpoint.pt",
    model.raw_julia_state_  # This is the trained model
)

Then, in a new process:

from pysr import PySRRegressor

model = PySRRegressor.from_file("hall_of_fame...pkl")
model.warm_start = True

from pysr.julia_helpers import init_julia

init_julia()

from julia import 

Replies: 5 comments 14 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@MilesCranmer
Comment options

@MilesCranmer
Comment options

Answer selected by MilesCranmer
Comment options

You must be logged in to vote
7 replies
@Pulpas
Comment options

@MilesCranmer
Comment options

@Pulpas
Comment options

@MilesCranmer
Comment options

@Pulpas
Comment options

Comment options

You must be logged in to vote
5 replies
@MilesCranmer
Comment options

@lhabersbrunner
Comment options

@MilesCranmer
Comment options

@lhabersbrunner
Comment options

@gm89uk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
PySR PySR-related discussion
5 participants