Commit ce42c2c8 authored by Joseph Weston's avatar Joseph Weston
Browse files

change uses of 'Learner.tell' to 'Learner._tell' where appropriate

All occurances of 'add_point' before commit 58a30fe1 should be
'_tell' now, and 'add_data' should be 'tell'.

Fixes #58.
parent 958c0dfe
Pipeline #9721 failed with stage
in 2 minutes and 20 seconds
......@@ -62,7 +62,7 @@ class BalancingLearner(BaseLearner):
pairs.append((index, point[0]))
x, _ = max(zip(pairs, loss_improvements), key=itemgetter(1))
points.append(x)
self.tell(x, None)
self._tell(x, None)
return points, None
......@@ -78,7 +78,7 @@ class BalancingLearner(BaseLearner):
index, x = x
self._points.pop(index, None)
self._loss.pop(index, None)
self.learners[index].tell(x, y)
self.learners[index]._tell(x, y)
def loss(self, real=True):
losses = []
......
......@@ -40,4 +40,4 @@ class DataSaver:
def _tell(self, x, result):
y = self.arg_picker(result) if result is not None else None
self.extra_data[x] = result
self.learner.tell(x, y)
self.learner._tell(x, y)
......@@ -408,7 +408,7 @@ class IntegratorLearner(BaseLearner):
# Update the mappings
self.x_mapping[x].add(ival)
if x in self.done_points:
self.tell(x, self.done_points[x])
self._tell(x, self.done_points[x])
elif x not in self.pending_points:
self.pending_points.add(x)
self._stack.append(x)
......
......@@ -186,7 +186,7 @@ class BlockingRunner(BaseRunner):
) from e
if do_log:
self.log.append(('tell', x, y))
self.learner.tell(x, y)
self.learner._tell(x, y)
finally:
# remove points with 'None' values from the learner
......@@ -390,7 +390,7 @@ class AsyncRunner(BaseRunner):
) from e
if do_log:
self.log.append(('tell', x, y))
self.learner.tell(x, y)
self.learner._tell(x, y)
finally:
# remove points with 'None' values from the learner
self.learner.remove_unfinished()
......@@ -432,7 +432,7 @@ def simple(learner, goal):
xs, _ = learner.ask(1)
for x in xs:
y = learner.function(x)
learner.tell(x, y)
learner._tell(x, y)
def replay_log(learner, log):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment