from fastai.gen_doc.nbdoc import * from fastai.callback import * from fastai import * show_doc(Callback) show_doc(Callback.on_train_begin) show_doc(Callback.on_epoch_begin) show_doc(Callback.on_batch_begin) show_doc(Callback.on_loss_begin) show_doc(Callback.on_backward_begin) show_doc(Callback.on_backward_end) show_doc(Callback.on_step_end) show_doc(Callback.on_batch_end) show_doc(Callback.on_epoch_end) show_doc(Callback.on_train_end) annealings = "NO LINEAR COS EXP POLY".split() fns = [annealing_no, annealing_linear, annealing_cos, annealing_exp, annealing_poly(0.8)] for fn, t in zip(fns, annealings): plt.plot(np.arange(0, 100), [fn(2, 1e-2, o) for o in np.linspace(0.01,1,100)], label=t) plt.legend(); show_doc(annealing_cos) show_doc(annealing_exp) show_doc(annealing_linear) show_doc(annealing_no) show_doc(annealing_poly) show_doc(CallbackHandler) show_doc(CallbackHandler.on_backward_begin) show_doc(CallbackHandler.on_backward_end) show_doc(CallbackHandler.on_batch_begin) show_doc(CallbackHandler.on_batch_end) show_doc(CallbackHandler.on_epoch_begin) show_doc(CallbackHandler.on_epoch_end) show_doc(CallbackHandler.on_loss_begin) show_doc(CallbackHandler.on_step_end) show_doc(CallbackHandler.on_train_begin) show_doc(CallbackHandler.on_train_end) show_doc(OptimWrapper) show_doc(OptimWrapper.create) show_doc(OptimWrapper.read_defaults) show_doc(OptimWrapper.read_val) show_doc(OptimWrapper.set_val) show_doc(OptimWrapper.step) show_doc(OptimWrapper.zero_grad) show_doc(SmoothenValue) show_doc(SmoothenValue.add_value) show_doc(Stepper) show_doc(Stepper.step) show_doc(AverageMetric) show_doc(do_annealing_poly) show_doc(AverageMetric.on_epoch_begin) show_doc(AverageMetric.on_batch_end) show_doc(AverageMetric.on_epoch_end)