docstr: Parameters
  ----------
  model : pytorch model
      the user model, which has mutables
  auxiliarynet : pytorch model
      the auxiliarynet to regress angle
  model_optim : pytorch optimizer
      the user defined optimizer
  criterion : pytorch loss
      the main task loss
  device : pytorch device
      the devices to train/search the model
  device_ids : list of int
      the indexes of devices used for training
  config : class
      configuration object for fbnet training
  lookup_table : class
      lookup table object for fbnet training
  train_loader : pytorch data loader
      data loader for the training set
  valid_loader : pytorch data loader
      data loader for the validation set
  n_epochs : int
      number of epochs to train/search
  load_ckpt : bool
      whether load checkpoint
  arch_path : str
      the path to store chosen architecture
  logger : logger
      the logger
docstr_tok: ["Parameters","--","--","--","--","--","model",":","pytorch","model","the","user","model",",","which","has","mutables","auxiliarynet",":","pytorch","model","the","auxiliarynet","to","regress","angle","model_optim",":","pytorch","optimizer","the","user","defined","optimizer","criterion",":","pytorch","loss","the","main","task","loss","device",":","pytorch","device","the","devices","to","train\/search","the","model","device_ids",":","list","of","int","the","indexes","of","devices","used","for","training","config",":","class","configuration","object","for","fbnet","training","lookup_table",":","class","lookup","table","object","for","fbnet","training","train_loader",":","pytorch","data","loader","data","loader","for","the","training","set","valid_loader",":","pytorch","data","loader","data","loader","for","the","validation","set","n_epochs",":","int","number","of","epochs","to","train\/search","load_ckpt",":","bool","whether","load","checkpoint","arch_path",":","str","the","path","to","store","chosen","architecture","logger",":","logger","the","logger"]
code: def __init__(
      self,
      model,
      auxiliarynet,
      model_optim,
      criterion,
      device,
      device_ids,
      config,
      lookup_table,
      train_loader,
      valid_loader,
      n_epochs=300,
      load_ckpt=False,
      arch_path=None,
      logger=None,
  ):
      """
      Parameters
      ----------
      model : pytorch model
          the user model, which has mutables
      auxiliarynet : pytorch model
          the auxiliarynet to regress angle
      model_optim : pytorch optimizer
          the user defined optimizer
      criterion : pytorch loss
          the main task loss
      device : pytorch device
          the devices to train/search the model
      device_ids : list of int
          the indexes of devices used for training
      config : class
          configuration object for fbnet training
      lookup_table : class
          lookup table object for fbnet training
      train_loader : pytorch data loader
          data loader for the training set
      valid_loader : pytorch data loader
          data loader for the validation set
      n_epochs : int
          number of epochs to train/search
      load_ckpt : bool
          whether load checkpoint
      arch_path : str
          the path to store chosen architecture
      logger : logger
          the logger
      """
  
      super(PFLDTrainer, self).__init__(
          model,
          model_optim,
          criterion,
          device,
          device_ids,
          lookup_table,
          train_loader,
          valid_loader,
          n_epochs,
          load_ckpt,
          arch_path,
          logger,
      )
  
      # DataParallel of the AuxiliaryNet to PFLD
      self.auxiliarynet = auxiliarynet
      self.auxiliarynet = torch.nn.DataParallel(
          self.auxiliarynet, device_ids=device_ids
      )
      self.auxiliarynet.to(device)
  
file_path: nni/examples/nas/legacy/oneshot/pfld/lib/trainer.py
imports: from __future__ import absolute_import, division, print_function
  import os
  import time
  import torch
  import numpy
  from nni.algorithms.nas.pytorch.fbnet import FBNetTrainer
  from nni.nas.pytorch.utils import AverageMeter
  from .utils import accuracy
label_desc: Use image node_id 1 to create a new PFLDTrainer object from inherited base classes: FBNetTrainer with example: obj = PFLDTrainer(model, auxiliarynet, model_optim, criterion, device, device_ids, config, lookup_table, train_loader, valid_loader, n_epochs, load_ckpt, arch_path, logger)