Skip to content

Commit

Permalink
fix reset of Plot
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesqiao committed Mar 31, 2017
1 parent 55bf200 commit 75cbdf9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/paddle/v2/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def plot(self):
self.plt.gcf().clear()

def reset(self):
self.__plot_data__ = []
for key in self.__plot_data__:
data = self.__plot_data__[key]
assert isinstance(data, PlotData)
data.reset()

if __name__ == '__main__':
title = "cost"
Expand All @@ -63,3 +66,7 @@ def reset(self):
plot_test.append(title, 2, 2)
for k, v in plot_test.__plot_data__.iteritems():
print k, v.step, v.value
plot_test.reset()
for k, v in plot_test.__plot_data__.iteritems():
print k, v.step, v.value
gg

0 comments on commit 75cbdf9

Please sign in to comment.