class_docstr: MNIST encoder used in the experiments for the Counterfactual with Reinforcement Learning. The model
  consists of 3 convolutional layers having 16, 8 and 8 channels and a kernel size of 3, with ReLU nonlinearities.
  Each convolutional layer is followed by a maxpooling layer of size 2. Finally, a fully connected layer
  follows the convolutional block with a tanh nonlinearity. The tanh clips the output between [-1, 1], required
  in the DDPG algorithm (e.g., [act_low, act_high]). The embedding dimension used in the paper is 32, although
  this can vary.
docstr: Forward pass.
  
  Parameters
  ----------
  x
      Input tensor.
  
  Returns
  -------
  Encoding representation having each component in the interval [-1, 1]
docstr_tok: ["Forward","pass",".","Parameters","--","--","--","--","--","x","Input","tensor",".","Returns","--","--","--","-","Encoding","representation","having","each","component","in","the","interval","[","-1",",","1","]"]
code: def forward(self, x: torch.Tensor) -> torch.Tensor:
      """
      Forward pass.
  
      Parameters
      ----------
      x
          Input tensor.
  
      Returns
      -------
      Encoding representation having each component in the interval [-1, 1]
      """
      x = self.maxpool1(F.relu(self.conv1(x)))
      x = self.maxpool2(F.relu(self.conv2(x)))
      x = self.maxpool3(F.relu(self.conv3(x)))
      x = self.flatten(x)
      x = torch.tanh(self.fc1(x))
      return x
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from typing import List
  from alibi.models.pytorch.model import Model
label_desc: Use image node_id 2 for calling the MNISTEncoder obj's underlying member method code with example usage: obj.forward(x) and returns: x