class_docstr: Trains an autoencoder (AE) to represent categorical information with over 100 categories. This is used to ensure that feature vectors for categorical data with many categories are not excessively large.
  
  The AE defaults to a vector sized 100 but can be adjusted to user preference. It is highly advised NOT to use this encoder to feature engineer your target, as reconstruction accuracy will determine your AE's ability to decode properly.
docstr: :param stop_after: Stops training with provided time limit (sec)
  :param is_target: Encoder represents target class (NOT recommended)
  :param max_encoded_length: Maximum length of vector represented
  :param desired_error: Threshold for reconstruction accuracy error
  :param batch_size: Minimum batch size while training
  :param device: Name of the device that get_device_from_name will attempt to use
  :param input_encoder: one of `OneHotEncoder` or `SimpleLabelEncoder` to force usage of the underlying input encoder. Note that OHE does not scale for categorical features with high cardinality, while SLE can but is less accurate overall.
docstr_tok: [":","param","stop_after",":","Stops","training","with","provided","time","limit","(","sec",")",":","param","is_target",":","Encoder","represents","target","class","(","NOT","recommended",")",":","param","max_encoded_length",":","Maximum","length","of","vector","represented",":","param","desired_error",":","Threshold","for","reconstruction","accuracy","error",":","param","batch_size",":","Minimum","batch","size","while","training",":","param","device",":","Name","of","the","device","that","get_device_from_name","will","attempt","to","use",":","param","input_encoder",":","one","of","`","OneHotEncoder","`","or","`","SimpleLabelEncoder","`","to","force","usage","of","the","underlying","input","encoder",".","Note","that","OHE","does","not","scale","for","categorical","features","with","high","cardinality",",","while","SLE","can","but","is","less","accurate","overall","."]
code: def __init__(
      self,
      stop_after: float = 3600,
      is_target: bool = False,
      max_encoded_length: int = 100,
      desired_error: float = 0.01,
      batch_size: int = 200,
      device: str = "",
      input_encoder: str = None,
  ):
      """
      :param stop_after: Stops training with provided time limit (sec)
      :param is_target: Encoder represents target class (NOT recommended)
      :param max_encoded_length: Maximum length of vector represented
      :param desired_error: Threshold for reconstruction accuracy error
      :param batch_size: Minimum batch size while training
      :param device: Name of the device that get_device_from_name will attempt to use
      :param input_encoder: one of `OneHotEncoder` or `SimpleLabelEncoder` to force usage of the underlying input encoder. Note that OHE does not scale for categorical features with high cardinality, while SLE can but is less accurate overall.
      """  # noqa
      super().__init__(is_target)
      self.is_prepared = False
      self.name = "Categorical Autoencoder"
      self.output_size = max_encoded_length
  
      # Model details
      self.net = None
      self.encoder = None
      self.decoder = None
      self.input_encoder = None  # TBD at prepare()
      self.device_type = device
      self.input_encoder = input_encoder
  
      # Training details
      self.batch_size = batch_size
      self.desired_error = desired_error
      self.stop_after = stop_after
  
imports: import random
  import numpy
  import torch
  from torch.utils.data import DataLoader
  from lightwood.mixer.helpers.ranger import Ranger
  from lightwood.encoder.categorical.simple_label import SimpleLabelEncoder
  from lightwood.encoder.categorical.onehot import OneHotEncoder
  from lightwood.encoder.categorical.gym import Gym
  from lightwood.encoder.base import BaseEncoder
  from lightwood.helpers.log import log
  from lightwood.mixer.helpers.default_net import DefaultNet
  import pandas
  from typing import Iterable, Tuple, List
label_desc: Use image node_id 1 to create a new CategoricalAutoEncoder object from inherited base classes: BaseEncoder with example: obj = CategoricalAutoEncoder(stop_after, is_target, max_encoded_length, desired_error, batch_size, device, input_encoder)