graphinvent/gnn/modules.py
def _linear_block(self, in_f : int, out_f : int, activation : torch.nn.Module,
                      dropout_p : float) -> torch.nn.Sequential:
        """
        Returns a linear block consisting of a linear layer, an activation function
        (SELU), and dropout (optional) stack.

        Args:
        ----
            in_f (int)                   : Size of each input sample.
            out_f (int)                  : Size of each output sample.
            activation (torch.nn.Module) : Activation function.
            dropout_p (float)            : Probability of dropping a weight.

        Returns:
        -------
            torch.nn.Sequential : The linear block.
        """
        # bias must be used in most MLPs in our models to learn from empty graphs
        linear = torch.nn.Linear(in_f, out_f, bias=True)
        torch.nn.init.xavier_uniform_(linear.weight)
        return torch.nn.Sequential(linear, activation(), torch.nn.AlphaDropout(dropout_p))

        Returns a linear block consisting of a linear layer, an activation function
        (SELU), and dropout (optional) stack.

        Args:
        ----
            in_f (int)                   : Size of each input sample.
            out_f (int)                  : Size of each output sample.
            activation (torch.nn.Module) : Activation function.
            dropout_p (float)            : Probability of dropping a weight.

        Returns:
        -------
            torch.nn.Sequential : The linear block.
        
Returns a linear block consisting of a linear layer, an activation function
(SELU), and dropout (optional) stack.
Returns a linear block consisting of a linear layer an activation function ( SELU ) and dropout ( optional ) stack .
def _linear_block(self, in_f : int, out_f : int, activation : torch.nn.Module,
                      dropout_p : float) -> torch.nn.Sequential:
        linear = torch.nn.Linear(in_f, out_f, bias=True)
        torch.nn.init.xavier_uniform_(linear.weight)
        return torch.nn.Sequential(linear, activation(), torch.nn.AlphaDropout(dropout_p))
def _linear_block ( self , in_f : int , out_f : int , activation : torch . nn . Module , dropout_p : float ) -> torch . nn . Sequential : linear = torch . nn . Linear ( in_f , out_f , bias = True ) torch . nn . init . xavier_uniform_ ( linear . weight ) return torch . nn . Sequential ( linear , activation ( ) , torch . nn . AlphaDropout ( dropout_p ) )
Returns a linear block consisting of a linear layer, an activation function
(SELU), and dropout (optional) stack.
Returns a linear block consisting of a linear layer an activation function ( SELU ) and dropout ( optional ) stack .
"""
        Returns a linear block consisting of a linear layer, an activation function
        (SELU), and dropout (optional) stack.

        Args:
        ----
            in_f (int)                   : Size of each input sample.
            out_f (int)                  : Size of each output sample.
            activation (torch.nn.Module) : Activation function.
            dropout_p (float)            : Probability of dropping a weight.

        Returns:
        -------
            torch.nn.Sequential : The linear block.
        """ # bias must be used in most MLPs in our models to learn from empty graphs
torch.nn.Sequential : The linear block.
torch . nn . Sequential : The linear block .
self
in_f
int
Size of each input sample.
Size of each input sample .
out_f
int
Size of each output sample.
Size of each output sample .
activation
torch.nn.Module
None
dropout_p
float
Probability of dropping a weight.
Probability of dropping a weight .