# archai.algos.xnas package

## Submodules

## archai.algos.xnas.xnas_arch_trainer module

class `archai.algos.xnas.xnas_arch_trainer.``XnasArchTrainer`(conf_train: archai.common.config.Config, model: archai.nas.model.Model, checkpoint: Optional[archai.common.checkpoint.CheckPoint])

  Bases: `archai.nas.arch_trainer.ArchTrainer`

  `create_optimizer`(conf_optim: archai.common.config.Config, params) → torch.optim.optimizer.Optimizer
  `post_epoch`(train_dl: torch.utils.data.dataloader.DataLoader, val_dl: Optional[torch.utils.data.dataloader.DataLoader]) → None
  `post_fit`(train_dl: torch.utils.data.dataloader.DataLoader, val_dl: Optional[torch.utils.data.dataloader.DataLoader]) → None
  `pre_epoch`(train_dl: torch.utils.data.dataloader.DataLoader, val_dl: Optional[torch.utils.data.dataloader.DataLoader]) → None
  `pre_fit`(train_dl: torch.utils.data.dataloader.DataLoader, val_dl: Optional[torch.utils.data.dataloader.DataLoader]) → None
  `pre_step`(x: torch.Tensor, y: torch.Tensor) → None
  `update_checkpoint`(checkpoint: archai.common.checkpoint.CheckPoint) → None

## archai.algos.xnas.xnas_exp_runner module

class `archai.algos.xnas.xnas_exp_runner.``XnasExperimentRunner`(config_filename: str, base_name: str, clean_expdir=False)

  Bases: `archai.nas.exp_runner.ExperimentRunner`

  `model_desc_builder`() → archai.algos.xnas.xnas_model_desc_builder.XnasModelDescBuilder
  `trainer_class`() → Optional[Type[archai.nas.arch_trainer.ArchTrainer]]

## archai.algos.xnas.xnas_model_desc_builder module

class `archai.algos.xnas.xnas_model_desc_builder.``XnasModelDescBuilder`

  Bases: `archai.nas.model_desc_builder.ModelDescBuilder`

  `build_nodes`(stem_shapes: List[List[int]], conf_cell: archai.common.config.Config, cell_index: int, cell_type: archai.nas.model_desc.CellType, node_count: int, in_shape: List[int], out_shape: List[int]) → Tuple[List[List[int]], List[archai.nas.model_desc.NodeDesc]]
  `pre_build`(conf_model_desc: archai.common.config.Config) → None

## archai.algos.xnas.xnas_op module

class `archai.algos.xnas.xnas_op.``XnasOp`(op_desc: archai.nas.model_desc.OpDesc, arch_params: Optional[archai.nas.arch_params.ArchParams], affine: bool)

  Bases: `archai.nas.operations.Op`

  The output of XnasOp is weighted output of all allowed primitives.

  `PRIMITIVES` = ['max_pool_3x3', 'avg_pool_3x3', 'skip_connect', 'sep_conv_3x3', 'sep_conv_5x5', 'dil_conv_3x3', 'dil_conv_5x5', 'none']
  `can_drop_path`() → bool
  `finalize`() → Tuple[archai.nas.model_desc.OpDesc, Optional[float]]

    for trainable op, return final op and its rank

  `forward`(x)

    Defines the computation performed at every call.

    Should be overridden by all subclasses.

    Note

    Although the recipe for forward pass needs to be defined within this function, one should call the `Module` instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

  `update_alphas`(eta: float, current_t: int, total_t: int, grad_clip: float)

## Module contents

Contents:

- archai
  - archai package

- Github