-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
Consider a problem, where one would like to save an intermediate learning result and continue later. i.e. to increase accuracy.
Saving and loading Learner2D works like charm and I can continue where I left off, but loading a LearnerND throws an error: learner.function cannot be pickled
.
Here is a reproducible example for a notebook:
from adaptive import LearnerND, Runner, notebook_extension
notebook_extension()
def sphere(xyz):
x, y, z = xyz
return x**2 + y**2 + z**2
fname = r'sphere_learned.pkl'
learner = LearnerND(sphere, bounds=[(-3, 3), (-3, 3), (-3, 3)])
runner = Runner(learner, loss_goal=0.01, ntasks=4)
runner.live_info()
runner.start_periodic_saving(save_kwargs=dict(fname=fname), interval=10)
learner = LearnerND(sphere, bounds=[(-3, 3), (-3, 3), (-3, 3)])
learner.load(fname)
runner = Runner(learner, loss_goal=0.001)
Metadata
Metadata
Assignees
Labels
No labels