class_docstr: Masked Autoencoder model
  
  Args:
      model_config (MADEConfig): The MADE model configuration setting the main parameters of the
          model
class_docstr_tok: ["Masked","Autoencoder","model","Args",":","model_config","(","MADEConfig",")",":","The","MADE","model","configuration","setting","the","main","parameters","of","the","model"]
code: def __init__(self, model_config: MADEConfig):
      BaseNF.__init__(self, model_config=model_config)
  
      self.net = []
      self.m = {}
      self.model_config = model_config
      self.input_dim = np.prod(model_config.input_dim)
      self.output_dim = np.prod(model_config.output_dim)
      self.hidden_sizes = model_config.hidden_sizes
      self.model_name = "MADE"
  
      if model_config.input_dim is None:
          raise AttributeError(
              "No input dimension provided !"
              "'input_dim' parameter of MADEConfig instance must be set to 'data_shape' "
              "where the shape of the data is (C, H, W ..)]. Unable to build network"
              "automatically"
          )
  
      if model_config.output_dim is None:
          raise AttributeError(
              "No input dimension provided !"
              "'output_dim' parameter of MADEConfig instance must be set to 'data_shape' "
              "where the shape of the data is (C, H, W ..)]. Unable to build network"
              "automatically"
          )
  
      hidden_sizes = (
          [self.input_dim]
          + model_config.hidden_sizes
          + [self.output_dim]
      )
  
      masks = self._make_mask(
          ordering=self.model_config.degrees_ordering
      )
  
      for inp, out, mask in zip(
          hidden_sizes[:-1], hidden_sizes[1:-1], masks[:-1]
      ):
          self.net.extend([MaskedLinear(inp, out, mask), nn.ReLU()])
  
      # outputs mean and logvar
      self.net.extend(
          [
              MaskedLinear(
                  self.hidden_sizes[-1],
                  2 * self.output_dim,
                  masks[-1].repeat(2, 1),
              )
          ]
      )
  
      self.net = nn.Sequential(*self.net)
  
file_path: benchmark_VAE/src/pythae/models/normalizing_flows/made/made_model.py
imports: import os
  import numpy
  import torch
  import torch.nn
  from pythae.models.base.base_utils import ModelOutput
  from ..base import BaseNF
  from ..layers import MaskedLinear
  from .made_config import MADEConfig
label_desc: Use image node_id 1 to create a new MADE object from inherited base classes: BaseNF with example: obj = MADE(model_config)