nlpmodels/models/text_cnn.py
def _init_weights(self, dim_model: int):
        """
        Initializes the weights of the embeddings vectors.

        Here we set the embeddings to be U(a,b) distribution.

        Args:
            dim_model (int): embedding space size.
        """

        self._embeddings.weight.data.uniform_(-0.5 / dim_model,
                                              0.5 / dim_model)

        # TODO: Add pre-loaded embeddings option.

        Initializes the weights of the embeddings vectors.

        Here we set the embeddings to be U(a,b) distribution.

        Args:
            dim_model (int): embedding space size.
        
Initializes the weights of the embeddings vectors.
Here we set the embeddings to be U(a,b) distribution.
Initializes the weights of the embeddings vectors . Here we set the embeddings to be U ( a b ) distribution .
def _init_weights(self, dim_model: int):
        self._embeddings.weight.data.uniform_(-0.5 / dim_model,
                                              0.5 / dim_model)
def _init_weights ( self , dim_model : int ) : self . _embeddings . weight . data . uniform_ ( - 0.5 / dim_model , 0.5 / dim_model )
Initializes the weights of the embeddings vectors.
Initializes the weights of the embeddings vectors .
"""
        Initializes the weights of the embeddings vectors.

        Here we set the embeddings to be U(a,b) distribution.

        Args:
            dim_model (int): embedding space size.
        """ # TODO: Add pre-loaded embeddings option.
self
dim_model
int
embedding space size.
embedding space size .