INNER CODE UNIT · Python

__repr__

timeseriesAI/tsai · tsai/callback/core.py:56

    def __repr__(self):
        return f'{self.__class__.__name__}({self.schedule_func})'

# %% ../../nbs/024_callback.core.ipynb #3d292bcc
class ShowGraph(Callback):
    "(Modified) Update a graph of training and validation loss"
    order,run_valid=65,False
    names = ['train', 'valid']
    def __init__(self, plot_metrics:bool=True, final_losses:bool=True, perc:float=.5):
        store_attr()

    def before_fit(self):
        self.run = not hasattr(self.learn, 'lr_finder') and not hasattr(self, "gather_preds")
        if not(self.run): return
        self.nb_batches = []
        self.learn.recorder.loss_idxs = [i for i,n in enumerate(self.learn.recorder.metric_names[1:-1]) if 'loss' in n]
        _metrics_info = [(i,n) for i,n in enumerate(self.learn.recorder.metric_names[1:-1]) if 'loss' not in n]
        if len(_metrics_info) > 0: 

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…