Audio Learner

Learner which stacks tuples of TensorSpec or TensorMelSpec

source

StackSpecCallback

 StackSpecCallback (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)

Stacks tuples of TensorSpec or TensorMelSpec. ToDo: add resizing


source

audio_learner

 audio_learner (dls:fastai.data.core.DataLoaders,
                model:torch.nn.modules.module.Module, loss_func:Union[torc
                h.nn.modules.module.Module,Callable[...,torch.Tensor],None
                Type]=None, opt_func:Union[fastai.optimizer.Optimizer,fast
                ai.optimizer.OptimWrapper]=<function Adam>,
                lr:Union[float,slice]=0.001, splitter:Callable[[torch.nn.m
                odules.module.Module],list[torch.Tensor]]=<function
                trainable_params>, cbs:Union[fastai.callback.core.Callback
                ,Iterable[fastai.callback.core.Callback],MutableSequence[f
                astai.callback.core.Callback],fastcore.foundation.L,fastco
                re.basics.fastuple,NoneType]=None, metrics:Union[fastai.le
                arner.Metric,Iterable[fastai.learner.Metric],MutableSequen
                ce[fastai.learner.Metric],fastcore.foundation.L,fastcore.b
                asics.fastuple,NoneType]=None,
                path:Union[str,pathlib.Path,NoneType]=None,
                model_dir:Union[str,pathlib.Path]='models',
                wd:Optional[float]=None, wd_bn_bias:bool=False,
                train_bn:bool=True, moms:tuple[float,float,float]=(0.95,
                0.85, 0.95), default_cbs:bool=True)

An Audio specific Learner that stacks tuples of TensorSpec or TensorMelSpec

Type Default Details
dls DataLoaders DataLoaders containing fastai or PyTorch DataLoaders
model nn.Module PyTorch model for training or inference
loss_func nn.Module | Callable[…, Tensor] | None None Loss function. Defaults to dls loss
opt_func Optimizer | OptimWrapper Adam Optimization function for training
lr float | slice 0.001 Default learning rate
splitter Callable[[nn.Module], list[Tensor]] trainable_params Split model into parameter groups. Defaults to one parameter group
cbs Listified[Callback] | None None Callbacks to add to Learner
metrics Listified[Metric] | None None Metrics to calculate on validation set
path str | Path | None None Parent directory to save, load, and export models. Defaults to dls path
model_dir str | Path models Subdirectory to save and load models
wd float | None None Default weight decay
wd_bn_bias bool False Apply weight decay to normalization and bias parameters
train_bn bool True Train frozen normalization layers
moms tuple[float, float, float] (0.95, 0.85, 0.95) Default momentum for schedulers
default_cbs bool True Include default Callbacks
Returns Learner