from abc import abstractmethod from matplotlib.figure import Figure from neural_net.epoch import Epoch class Plotter: def __init__(self, figure: Figure): self.figure = figure def initialize_plots(self): self.figure.show() @abstractmethod def update_plot(self, data): self.reset_plot() self.plot(data) self.figure.canvas.draw() self.figure.canvas.flush_events() @abstractmethod def reset_plot(self): pass @abstractmethod def plot(self, current_epoch: Epoch): pass