def plot_loss(self, skip_start=5, with_valid=True):
    plt.plot(list(range(skip_start, len(self.losses))), self.losses[skip_start:], label='train')
    if with_valid:
        idx = (np.array(self.iters) < skip_start).sum()
        plt.plot(self.iters[idx:], L(self.values[idx:]).itemgot(1), label='valid')
        plt.legend()
def plot_loss(self, skip_start=5, with_valid=True):
    plt.plot(list(range(skip_start, len(self.losses))), self.losses[skip_start:], label='train')
    if with_valid:
        idx = (np.array(self.iters) < skip_start).sum()
        plt.plot(self.iters[idx:], L(self.values[idx:]).itemgot(1), label='valid')
        plt.legend()