original_docstring: 
          Helper function to create the elemental blocks for the encoder. Creates a gated convnet encoder.
          the encoder expects data as input of shape (batch_size, num_channels, width, height).
          
docstring: Helper function to create the elemental blocks for the encoder. Creates a gated convnet encoder.
  the encoder expects data as input of shape (batch_size, num_channels, width, height).
docstring_tokens: Helper function to create the elemental blocks for the encoder . Creates a gated convnet encoder . the encoder expects data as input of shape ( batch_size num_channels width height ) .
code: def create_encoder(self):
          """
          Helper function to create the elemental blocks for the encoder. Creates a gated convnet encoder.
          the encoder expects data as input of shape (batch_size, num_channels, width, height).
          """
  
          if self.input_type == 'binary':
              q_z_nn = nn.Sequential(
                  GatedConv2d(self.input_size[0], 32, 5, 1, 2),
                  GatedConv2d(32, 32, 5, 2, 2),
                  GatedConv2d(32, 64, 5, 1, 2),
                  GatedConv2d(64, 64, 5, 2, 2),
                  GatedConv2d(64, 64, 5, 1, 2),
                  GatedConv2d(64, 256, self.last_kernel_size, 1, 0),
  
              )
              q_z_mean = nn.Linear(256, self.z_size)
              q_z_var = nn.Sequential(
                  nn.Linear(256, self.z_size),
                  nn.Softplus(),
              )
              return q_z_nn, q_z_mean, q_z_var
  
          elif self.input_type == 'multinomial':
              act = None
  
              q_z_nn = nn.Sequential(
                  GatedConv2d(self.input_size[0], 32, 5, 1, 2, activation=act),
                  GatedConv2d(32, 32, 5, 2, 2, activation=act),
                  GatedConv2d(32, 64, 5, 1, 2, activation=act),
                  GatedConv2d(64, 64, 5, 2, 2, activation=act),
                  GatedConv2d(64, 64, 5, 1, 2, activation=act),
                  GatedConv2d(64, 256, self.last_kernel_size, 1, 0, activation=act)
              )
              q_z_mean = nn.Linear(256, self.z_size)
              q_z_var = nn.Sequential(
                  nn.Linear(256, self.z_size),
                  nn.Softplus(),
                  nn.Hardtanh(min_val=0.01, max_val=7.)
  
              )
              return q_z_nn, q_z_mean, q_z_var
code_tokens: def create_encoder ( self ) : if self . input_type == 'binary' : q_z_nn = nn . Sequential ( GatedConv2d ( self . input_size [ 0 ] , 32 , 5 , 1 , 2 ) , GatedConv2d ( 32 , 32 , 5 , 2 , 2 ) , GatedConv2d ( 32 , 64 , 5 , 1 , 2 ) , GatedConv2d ( 64 , 64 , 5 , 2 , 2 ) , GatedConv2d ( 64 , 64 , 5 , 1 , 2 ) , GatedConv2d ( 64 , 256 , self . last_kernel_size , 1 , 0 ) , ) q_z_mean = nn . Linear ( 256 , self . z_size ) q_z_var = nn . Sequential ( nn . Linear ( 256 , self . z_size ) , nn . Softplus ( ) , ) return q_z_nn , q_z_mean , q_z_var elif self . input_type == 'multinomial' : act = None q_z_nn = nn . Sequential ( GatedConv2d ( self . input_size [ 0 ] , 32 , 5 , 1 , 2 , activation = act ) , GatedConv2d ( 32 , 32 , 5 , 2 , 2 , activation = act ) , GatedConv2d ( 32 , 64 , 5 , 1 , 2 , activation = act ) , GatedConv2d ( 64 , 64 , 5 , 2 , 2 , activation = act ) , GatedConv2d ( 64 , 64 , 5 , 1 , 2 , activation = act ) , GatedConv2d ( 64 , 256 , self . last_kernel_size , 1 , 0 , activation = act ) ) q_z_mean = nn . Linear ( 256 , self . z_size ) q_z_var = nn . Sequential ( nn . Linear ( 256 , self . z_size ) , nn . Softplus ( ) , nn . Hardtanh ( min_val = 0.01 , max_val = 7. ) ) return q_z_nn , q_z_mean , q_z_var
short_docstring: Helper function to create the elemental blocks for the encoder.
short_docstring_tokens: Helper function to create the elemental blocks for the encoder .
comment: """
          Helper function to create the elemental blocks for the encoder. Creates a gated convnet encoder.
          the encoder expects data as input of shape (batch_size, num_channels, width, height).
          """