Skip to content
Snippets Groups Projects
Commit c0ff642c authored by Bas Nijholt's avatar Bas Nijholt
Browse files

add a save and reset state to the 2D learner

parent c9555ef9
No related branches found
No related tags found
1 merge request!7implement 2D learner
......@@ -832,3 +832,17 @@ class Learner2D(BaseLearner):
self.values_real)
z = ip(x[:, None], y[None, :])
return hv.Image(z)
def save_state(self):
self._values_copy = self._values.copy()
self._points_copy = self._points.copy()
self._interp_copy = copy(self._interp)
self._stack_copy = copy(self._stack)
self.n_copy = self.n
def reset_state(self):
self._values = self._values_copy.copy()
self._points = self._points_copy.copy()
self._interp = copy(self._interp_copy)
self._stack = copy(self._stack_copy)
self.n = self.n_copy
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment