from fastai.vision import * from fastai.gen_doc.nbdoc import * from fastai.callbacks import * show_doc(CSVLogger) path = untar_data(URLs.MNIST_TINY) data = ImageDataBunch.from_folder(path) learn = Learner(data, simple_cnn((3, 16, 16, 2)), metrics=[accuracy, error_rate], callback_fns=[CSVLogger]) learn.fit(3) learn.path.ls() show_doc(CSVLogger.read_logged_file) learn.csv_logger.read_logged_file() # don't forget to remove the old file if learn.csv_logger.path.exists(): os.remove(learn.csv_logger.path) learn = Learner(data, simple_cnn((3, 16, 16, 2)), metrics=[accuracy, error_rate], callback_fns=[partial(CSVLogger, append=True)]) # stage-1 learn.fit(3) # stage-2 learn.fit(3) learn.csv_logger.read_logged_file() show_doc(CSVLogger.on_train_begin) show_doc(CSVLogger.on_epoch_end) show_doc(CSVLogger.on_train_end)