# Synthetic Learner


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/test_utils.py#L21"
target="_blank" style="float:right; font-size:smaller">source</a>

### synth_dbunch

``` python

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

```

*Call self as a function.*

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/test_utils.py#L33"
target="_blank" style="float:right; font-size:smaller">source</a>

### RegModel

``` python

def RegModel(
    
):

```

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

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/test_utils.py#L39"
target="_blank" style="float:right; font-size:smaller">source</a>

### synth_learner

``` python

def synth_learner(
    n_trn:int=10, n_val:int=2, cuda:bool=False, lr:float=0.001, # Default learning rate
    data:NoneType=None, model:NoneType=None, loss_func:Optional=None, # Loss function. Defaults to `dls` loss
    opt_func:fastai.optimizer.Optimizer | fastai.optimizer.OptimWrapper=Adam, # Optimization function for training
    splitter:Callable=trainable_params, # Split model into parameter groups. Defaults to one parameter group
    cbs:fastai.callback.core.Callback | collections.abc.MutableSequence | None=None, # [`Callback`](https://docs.fast.ai/callback.core.html#callback)s to add to [`Learner`](https://docs.fast.ai/learner.html#learner)
    metrics:Union=None, # [`Metric`](https://docs.fast.ai/learner.html#metric)s to calculate on validation set
    path:str | pathlib.Path | None=None, # Parent directory to save, load, and export models. Defaults to `dls` `path`
    model_dir:str | pathlib.Path='models', # Subdirectory to save and load models
    wd:float | int | 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=(0.95, 0.85, 0.95), # Default momentum for schedulers
    default_cbs:bool=True, # Include default [`Callback`](https://docs.fast.ai/callback.core.html#callback)s
):

```

*Call self as a function.*

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/test_utils.py#L46"
target="_blank" style="float:right; font-size:smaller">source</a>

### VerboseCallback

``` python

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

```

*Callback that prints the name of each event called*

## Install Utils

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/test_utils.py#L53"
target="_blank" style="float:right; font-size:smaller">source</a>

### get_env

``` python

def get_env(
    name
):

```

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

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/test_utils.py#L59"
target="_blank" style="float:right; font-size:smaller">source</a>

### try_import

``` python

def try_import(
    module
):

```

*Try to import [`module`](https://docs.fast.ai/layers.html#module).
Returns module’s object on success, None on failure*

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/test_utils.py#L65"
target="_blank" style="float:right; font-size:smaller">source</a>

### nvidia_smi

``` python

def nvidia_smi(
    cmd:str='nvidia-smi'
):

```

*Call self as a function.*

``` python
res = nvidia_smi()
```

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/test_utils.py#L71"
target="_blank" style="float:right; font-size:smaller">source</a>

### nvidia_mem

``` python

def nvidia_mem(
    
):

```

*Call self as a function.*

``` python
nvidia_mem()
```

    ['48600', '7982']

------------------------------------------------------------------------

<a
href="https://github.com/fastai/fastai/blob/main/fastai/test_utils.py#L77"
target="_blank" style="float:right; font-size:smaller">source</a>

### show_install

``` python

def show_install(
    show_nvidia_smi:bool=False
):

```

*Print user’s setup information*

## - Export
