Hi,
First you need to define your weight initializer function regarding one layer.
Here is an example:
def init_weights(m):
    """
    Initialize weights of layers using Kaiming Normal (He et al.) as argument of "Apply" function of
    "nn.Module"

    :param m: Layer to initialize
    :return: None
    """

    if isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspose2d):
        torch.nn.init.kaiming_normal_(m.weight, mode='fan_out')
        nn.init.constant_(m.bias, 0)
    elif isinstance(m, nn.BatchNorm2d):
        nn.init.constant_(m.weight, 1)
        nn.init.constant_(m.bias, 0)

You just need to include different type of layers using if/else code.
Then after initializing your model, you call .apply and it will recursively initialize all of your model’s nested layers.
Here is example:

model = ModelNet()
model.apply(init_weights)