MilesCranmer commited on
Commit
8775039
1 Parent(s): 1099283

Add notes about model loading to options page

Browse files
Files changed (1) hide show
  1. docs/options.md +18 -0
docs/options.md CHANGED
@@ -16,6 +16,7 @@ may find useful include:
16
  - LaTeX, SymPy
17
  - Callable exports: numpy, pytorch, jax
18
  - `loss`
 
19
 
20
  These are described below
21
 
@@ -252,3 +253,20 @@ Can also uses these losses for weighted (weighted-average):
252
  model = PySRRegressor(..., weights=weights, loss="LPDistLoss{3}()")
253
  model.fit(..., weights=weights)
254
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  - LaTeX, SymPy
17
  - Callable exports: numpy, pytorch, jax
18
  - `loss`
19
+ - Model loading
20
 
21
  These are described below
22
 
 
253
  model = PySRRegressor(..., weights=weights, loss="LPDistLoss{3}()")
254
  model.fit(..., weights=weights)
255
  ```
256
+
257
+ ## Model loading
258
+
259
+ PySR will automatically save a pickle file of the model state
260
+ when you call `model.fit`, once before the search starts,
261
+ and again after the search finishes. The filename will
262
+ have the same base name as the input file, but with a `.pkl` extension.
263
+ You can load the saved model state with:
264
+ ```python
265
+ model = PySRRegressor.from_file(pickle_filename)
266
+ ```
267
+ If you have a long-running job and would like to load the model
268
+ before completion, you can also do this. In this case, the model
269
+ loading will use the `csv` file to load the equations, since the
270
+ `csv` file is continually updated during the search. Once
271
+ the search completes, the model including its equations will
272
+ be saved to the pickle file, overwriting the existing version.