class_docstr: This is the base class for all autoencoders, including image autoencoders, image autoencoders with discriminators,
  unCLIP models, etc. Hence, it is fairly general, and specific features
  (e.g. discriminator training, encoding, decoding) must be implemented in subclasses.
class_docstr_tok: ["This","is","the","base","class","for","all","autoencoders",",","including","image","autoencoders",",","image","autoencoders","with","discriminators",",","unCLIP","models",",","etc",".","Hence",",","it","is","fairly","general",",","and","specific","features","(","e.g",".","discriminator","training",",","encoding",",","decoding",")","must","be","implemented","in","subclasses","."]
code: def __init__(
      self,
      ema_decay: Union[None, float] = None,
      monitor: Union[None, str] = None,
      input_key: str = "jpg",
  ):
      super().__init__()
  
      self.input_key = input_key
      self.use_ema = ema_decay is not None
      if monitor is not None:
          self.monitor = monitor
  
      if self.use_ema:
          self.model_ema = LitEma(self, decay=ema_decay)
          logpy.info(
              f"Keeping EMAs of {len(list(self.model_ema.buffers()))}."
          )
  
      if version.parse(torch.__version__) >= version.parse("2.0.0"):
          self.automatic_optimization = False
  
imports: import logging
  import math
  import re
  from abc import abstractmethod
  from contextlib import contextmanager
  from typing import Any, Dict, List, Optional, Tuple, Union
  import pytorch_lightning
  import torch
  import torch.nn
  from einops import rearrange
  from packaging import version
  from ..modules.autoencoding.regularizers import AbstractRegularizer
  from ..modules.ema import LitEma
  from ..util import default, get_nested_attribute, get_obj_from_str, instantiate_from_config
label_desc: Use image node_id 1 to create a new AbstractAutoencoder object from inherited base classes: pl with example: obj = AbstractAutoencoder(ema_decay, monitor, input_key)