def init_weights(self, layer): r"""Initialize the weights of the network. Weights are initialized with the :py:func:`torch.nn.init.xavier_uniform_` initializer, while biases are initalized with the :py:func:`torch.nn.init.normal_` initializer. """ if isinstance(layer, nn.Linear): xavier_init(layer.weight) normal_init(layer.bias)
def init_weights(self): r"""Initialize the weights of the network. Weights are initialized with the :py:func:`torch.nn.init.xavier_uniform_` initializer, while biases are initalized with the :py:func:`torch.nn.init.normal_` initializer. """ xavier_init(self.enc_layer.weight) normal_init(self.enc_layer.bias) xavier_init(self.dec_layer.weight) normal_init(self.dec_layer.bias)