title: Convert Pytorch MLP Class to Tensorflow MLP class
body: <p>I have the question on how to convert a Pytorch Neural Network to a Tensorflow Neural Network. The TF class as its written below does not work and I assume its die to the difference between nn.Sequential and tf.keras.Sequential.</p>
  <pre><code>class FullyConnected(nn.Sequential):
  
  &quot;&quot;&quot;
  Fully connected multi-layer network with ELU activations.
  &quot;&quot;&quot;
  
  def __init__(self, sizes, final_activation=None):
      layers = []
      for in_size, out_size in zip(sizes, sizes[1:]):
          layers.append(nn.Linear(in_size, out_size))
          layers.append(nn.ELU())
      layers.pop(-1)
      if final_activation is not None:
          layers.append(final_activation)
      super().__init__(*layers) here
  
  
  
  
  class FullyConnected(tf.keras.Sequential):
  &quot;&quot;&quot;
  Fully connected multi-layer network with ELU activations.
  &quot;&quot;&quot;
  def __init__(self, sizes, final_activation=None):
      layers = []
      for out_size in sizes[1:-1]:
          layers.append(Dense(units=out_size, activation='elu'))
      if final_activation is not None:
          layers.append(Dense(units=sizes[-1], activation='elu'))
      else:
          layers.append(Dense(units=sizes[-1]))
      super().__init__(*layers)
  </code></pre>
  <p>If I try to initialize the network say by <code>self.fc = FullyConnected(sizes=(sizes[:-1] + [self.dim * 2]))</code> with <code>sizes = [1, 128, 128, 128, 1]</code> I get the Error: <code>TypeError: object.__init__() takes exactly one argument (the instance to initialize)</code> when using the TF network.</p>
  <p>Can somebody help?</p>
  <p>Many thanks in advance!!</p>