Synthetic Learner

For quick testing of the training loop and Callbacks

source

synth_dbunch

 synth_dbunch (a=2, b=3, bs=16, n_train=10, n_valid=2, cuda=False)

source

RegModel

 RegModel ()

Same as nn.Module, but no need for subclasses to call super().__init__


source

synth_learner

 synth_learner (n_trn=10, n_val=2, cuda=False, lr=0.001, data=None,
                model=None, loss_func:callable|None=None,
                opt_func:Optimizer|OptimWrapper=<function Adam>,
                splitter:callable=<function trainable_params>,
                cbs:Callback|MutableSequence|None=None,
                metrics:callable|MutableSequence|None=None,
                path:str|Path|None=None, model_dir:str|Path='models',
                wd:float|int|None=None, wd_bn_bias:bool=False,
                train_bn:bool=True, moms:tuple=(0.95, 0.85, 0.95),
                default_cbs:bool=True)

source

VerboseCallback

 VerboseCallback (after_create=None, before_fit=None, before_epoch=None,
                  before_train=None, before_batch=None, after_pred=None,
                  after_loss=None, before_backward=None,
                  after_cancel_backward=None, after_backward=None,
                  before_step=None, after_cancel_step=None,
                  after_step=None, after_cancel_batch=None,
                  after_batch=None, after_cancel_train=None,
                  after_train=None, before_validate=None,
                  after_cancel_validate=None, after_validate=None,
                  after_cancel_epoch=None, after_epoch=None,
                  after_cancel_fit=None, after_fit=None)

Callback that prints the name of each event called

Install Utils


source

get_env

 get_env (name)

Return env var value if it’s defined and not an empty string, or return Unknown


source

try_import

 try_import (module)

Try to import module. Returns module’s object on success, None on failure


source

nvidia_smi

 nvidia_smi (cmd='nvidia-smi')
res = nvidia_smi()

source

nvidia_mem

 nvidia_mem ()
nvidia_mem()
['48600', '7982']

source

show_install

 show_install (show_nvidia_smi:bool=False)

Print user’s setup information

- Export