Skip to content

params

get_activation_fn(activation_fn)

Returns the requested activation function as a nn.Module class.

PARAMETER DESCRIPTION
activation_fn

The activation function to fetch. Can be a string or a nn.Module class.

TYPE: Union[str, Callable]

RETURNS DESCRIPTION
Callable

The class of the requested activation function.

get_init_fn(init_fn)

Returns the requested init function.

PARAMETER DESCRIPTION
init_fn

The init function to fetch. Must be one of ["xavier_uniform", "uniform", "kaiming_uniform"].

RETURNS DESCRIPTION
Callable

The class of the requested activation function.

get_loss_fn(loss_fn)

Returns the requested loss function as a function.

PARAMETER DESCRIPTION
loss_fn

The loss function to fetch. Can be a string or a function.

TYPE: Union[str, Callable]

RETURNS DESCRIPTION
Callable

The function of the requested loss function.

get_optim_fn(optim_fn)

Returns the requested optimizer as a nn.Module class.

PARAMETER DESCRIPTION
optim_fn

The optimizer to fetch. Can be a string or a nn.Module class.

TYPE: Union[str, Callable]

RETURNS DESCRIPTION
Callable

The class of the requested optimizer.