class_docstr: ENAS trainer.
  
  Parameters
  ----------
  num_epochs : int
      Number of epochs planned for training.
  n_warmup : int
      Number of epochs for training super network.
  log_frequency : int
      Step count per logging.
  grad_clip : float
      Gradient clipping. Set to 0 to disable. Default: 5.
  entropy_weight : float
      Weight of sample entropy loss.
  skip_weight : float
      Weight of skip penalty loss.
  baseline_decay : float
      Decay factor of baseline. New baseline will be equal to ``baseline_decay * baseline_old + reward * (1 - baseline_decay)``.
  ctrl_lr : float
      Learning rate for RL controller.
  ctrl_steps_aggregate : int
      Number of steps that will be aggregated into one mini-batch for RL controller.
  ctrl_kwargs : dict
      Optional kwargs that will be passed to :class:`ReinforceController`.
  model_lr : float
      Learning rate for super network.
  model_wd : float
      Weight decay for super network.
  disable_progeress: boolean
      Control whether show the progress bar.
  device : str or torch.device
      The device of the whole process, e.g. "cuda", torch.device("cpu")
class_docstr_tok: ["ENAS","trainer",".","Parameters","--","--","--","--","--","num_epochs",":","int","Number","of","epochs","planned","for","training",".","n_warmup",":","int","Number","of","epochs","for","training","super","network",".","log_frequency",":","int","Step","count","per","logging",".","grad_clip",":","float","Gradient","clipping",".","Set","to","0","to","disable",".","Default",":","5.","entropy_weight",":","float","Weight","of","sample","entropy","loss",".","skip_weight",":","float","Weight","of","skip","penalty","loss",".","baseline_decay",":","float","Decay","factor","of","baseline",".","New","baseline","will","be","equal","to","``","baseline_decay","*","baseline_old","+","reward","*","(","1","-","baseline_decay",")","``",".","ctrl_lr",":","float","Learning","rate","for","RL","controller",".","ctrl_steps_aggregate",":","int","Number","of","steps","that","will","be","aggregated","into","one","mini-batch","for","RL","controller",".","ctrl_kwargs",":","dict","Optional","kwargs","that","will","be","passed","to",":","class",":","`","ReinforceController","`",".","model_lr",":","float","Learning","rate","for","super","network",".","model_wd",":","float","Weight","decay","for","super","network",".","disable_progeress",":","boolean","Control","whether","show","the","progress","bar",".","device",":","str","or","torch.device","The","device","of","the","whole","process",",","e.g",".","``","cuda","''",",","torch.device","(","``","cpu","''",")"]
code: def __init__(
      self,
      num_epochs=5,
      n_warmup=100,
      log_frequency=None,
      grad_clip=5.0,
      entropy_weight=0.0001,
      skip_weight=0.8,
      baseline_decay=0.999,
      ctrl_lr=0.00035,
      ctrl_steps_aggregate=20,
      ctrl_kwargs=None,
      model_lr=5e-3,
      model_wd=5e-4,
      disable_progress=True,
      device="auto",
  ):
      super().__init__(device)
      self.num_epochs = num_epochs
      self.log_frequency = log_frequency
      self.entropy_weight = entropy_weight
      self.skip_weight = skip_weight
      self.baseline_decay = baseline_decay
      self.baseline = 0.0
      self.ctrl_steps_aggregate = ctrl_steps_aggregate
      self.grad_clip = grad_clip
      self.ctrl_kwargs = ctrl_kwargs
      self.ctrl_lr = ctrl_lr
      self.n_warmup = n_warmup
      self.model_lr = model_lr
      self.model_wd = model_wd
      self.disable_progress = disable_progress
  
file_path: AutoGL/autogl/module/nas/algorithm/enas.py
imports: import copy
  import torch
  import torch.nn
  import torch.nn.functional
  from .None import register_nas_algo
  from .base import BaseNAS
  from ..space import BaseSpace
  from ..utils import AverageMeterGroup, replace_layer_choice, replace_input_choice, get_module_order, sort_replaced_module
  from tqdm import tqdm, trange
  from .rl import PathSamplingLayerChoice, PathSamplingInputChoice, ReinforceField, ReinforceController
  from ....utils import get_logger
label_desc: Use image node_id 1 to create a new Enas object from inherited base classes: BaseNAS with example: obj = Enas(num_epochs, n_warmup, log_frequency, grad_clip, entropy_weight, skip_weight, baseline_decay, ctrl_lr, ctrl_steps_aggregate, ctrl_kwargs, model_lr, model_wd, disable_progress, device)