MLP
- class dhg.nn.MLP(*args, **kwargs)[source]
Bases:
torch.nn.ModuleA Multi-Layer Perception (MLP) model.
- Parameters
channel_list (
List[int]) – The list of channels of each layer.act_name (
str) – The name of activation function can be any activation layer in Pytorch.act_kwargs (
dict, optional) – The keyword arguments of activation function. Defaults toNone.use_bn (
bool) – Whether to use batch normalization.drop_rate (
float) – Dropout ratio. Defaults to0.5.is_last (
bool) – If set to True, the last layer will not use activation, batch normalization, and dropout.