class_docstr: Encoder part of the VAE, computer the latent represenations of the input.
  
  :param shape: Shape of the input to the network: (channels, height, width)
  :param latent_dim: Dimension of last hidden layer
class_docstr_tok: ["Encoder","part","of","the","VAE",",","computer","the","latent","represenations","of","the","input",".",":","param","shape",":","Shape","of","the","input","to","the","network",":","(","channels",",","height",",","width",")",":","param","latent_dim",":","Dimension","of","last","hidden","layer"]
code: def __init__(self, shape, latent_dim=128):
      super(VAEMLPEncoder, self).__init__()
      flattened_size = torch.Size(shape).numel()
      self.encode = nn.Sequential(
          Flatten(),
          nn.Linear(in_features=flattened_size, out_features=400),
          nn.BatchNorm1d(400),
          nn.LeakyReLU(),
          MLP([400, latent_dim]),
      )
  
imports: from abc import abstractmethod
  from typing import Union
  from matplotlib import transforms
  import torch
  import torch.nn
  from torchvision import transforms
  from avalanche.models.utils import MLP, Flatten
  from avalanche.models.base_model import BaseModel
label_desc: Use image node_id 1 to create a new VAEMLPEncoder object from inherited base classes: nn with example: obj = VAEMLPEncoder(shape, latent_dim)