ResNetModel

class lightautoml.ml_algo.torch_based.nn_models.ResNetModel(n_in, n_out=1, hid_factor=[2, 2], drop_rate=0.1, noise_std=0.05, act_fun=torch.nn.ReLU, num_init_features=None, use_bn=True, use_noise=False, device=torch.device, **kwargs)[source]

Bases: Module

The ResNet model from https://github.com/Yura52/rtdl.

Parameters:
  • n_in (int) – Input dim.

  • n_out (int) – Output dim.

  • hid_factor (List[float]) – Dim of intermediate fc is increased times this factor in ResnetModel layer.

  • drop_rate (Union[float, List[float], List[List[float]]]) – Dropout rate for each layer separately or altogether.

  • noise_std (float) – Std of noise.

  • act_fun (Module) – Activation function.

  • num_init_features (Optional[int]) – If not none add fc layer before model with certain dim.

  • use_bn (bool) – Use BatchNorm.

  • use_noise (bool) – Use noise.

  • device (device) – Device to compute on.

forward(x)[source]

Forward-pass.

Return type:

Tensor