# archai.algos.petridish package

## Submodules

## archai.algos.petridish.evaluater_petridish module

class `archai.algos.petridish.evaluater_petridish.``EvaluaterPetridish`

  Bases: `archai.nas.evaluater.Evaluater`

  `evaluate`(conf_eval: archai.common.config.Config, model_desc_builder: archai.nas.model_desc_builder.ModelDescBuilder) → archai.nas.evaluater.EvalResult

    Takes a folder of model descriptions output by search process and trains them in a distributed manner using ray with 1 gpu

## archai.algos.petridish.petridish_exp_runner module

class `archai.algos.petridish.petridish_exp_runner.``PetridishExperimentRunner`(config_filename: str, base_name: str, clean_expdir=False)

  Bases: `archai.nas.exp_runner.ExperimentRunner`

  `copy_search_to_eval`() → None
  `evaluater`() → archai.algos.petridish.evaluater_petridish.EvaluaterPetridish
  `model_desc_builder`() → archai.algos.petridish.petridish_model_desc_builder.PetridishModelBuilder
  `searcher`() → archai.algos.petridish.searcher_petridish.SearcherPetridish
  `trainer_class`() → Optional[Type[archai.nas.arch_trainer.ArchTrainer]]

## archai.algos.petridish.petridish_model_desc_builder module

class `archai.algos.petridish.petridish_model_desc_builder.``PetridishModelBuilder`

  Bases: `archai.algos.random.random_model_desc_builder.RandomModelDescBuilder`

  `pre_build`(conf_model_desc: archai.common.config.Config) → None

## archai.algos.petridish.petridish_op module

class `archai.algos.petridish.petridish_op.``PetridishOp`(op_desc: archai.nas.model_desc.OpDesc, arch_params: Optional[archai.nas.arch_params.ArchParams], reduction: bool, affine: bool)

  Bases: `archai.nas.operations.Op`

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

    for trainable op, return final op and its rank

  `forward`(x: List[torch.Tensor])

    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.

  `ops`() → Iterator[Tuple[archai.nas.operations.Op, float]]

    Return contituent ops, if this op is primitive just return self

class `archai.algos.petridish.petridish_op.``StopForward`

  Bases: `archai.nas.operations.Op`

  `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.

class `archai.algos.petridish.petridish_op.``StopForwardReductionOp`(op_desc: archai.nas.model_desc.OpDesc, affine: bool)

  Bases: `archai.nas.operations.Op`

  `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.

class `archai.algos.petridish.petridish_op.``StopGradient`

  Bases: `archai.nas.operations.Op`

  `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.

class `archai.algos.petridish.petridish_op.``StopGradientReduction`(op_desc: archai.nas.model_desc.OpDesc, affine: bool)

  Bases: `archai.nas.operations.Op`

  `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.

class `archai.algos.petridish.petridish_op.``TempIdentityOp`(op_desc)

  Bases: `archai.nas.operations.Identity`

  `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.

## archai.algos.petridish.petridish_utils module

class `archai.algos.petridish.petridish_utils.``ConvexHullPoint`(job_stage: archai.algos.petridish.petridish_utils.JobStage, parent_id: int, sampling_count: int, model_desc: archai.nas.model_desc.ModelDesc, cells_reductions_nodes: Tuple[int, int, int], metrics: Optional[archai.common.metrics.Metrics] = None, model_stats: Optional[tensorwatch.model_graph.torchstat_utils.ModelStats] = None)

  Bases: `object`

  `is_trained_stage`() → bool
  `next_stage`() → archai.algos.petridish.petridish_utils.JobStage

class `archai.algos.petridish.petridish_utils.``JobStage`

  Bases: `enum.Enum`

  An enumeration.

  `EVAL` = 5
  `EVAL_TRAINED` = 6
  `SEARCH` = 3
  `SEARCH_TRAINED` = 4
  `SEED` = 1
  `SEED_TRAINED` = 2

`archai.algos.petridish.petridish_utils.``hull_points2tsv`(points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint]) → str

`archai.algos.petridish.petridish_utils.``model_descs_on_front`(hull_points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint], convex_hull_eps: float, lower_hull: bool = True) → Tuple[List[archai.algos.petridish.petridish_utils.ConvexHullPoint], List[archai.algos.petridish.petridish_utils.ConvexHullPoint], List[float], List[float]]

`archai.algos.petridish.petridish_utils.``plot_frontier`(hull_points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint], convex_hull_eps: float, expdir: str) → None

`archai.algos.petridish.petridish_utils.``plot_pool`(hull_points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint], expdir: str) → None

`archai.algos.petridish.petridish_utils.``plot_seed_model_stats`(seed_model_stats: List[tensorwatch.model_graph.torchstat_utils.ModelStats], expdir: str) → None

`archai.algos.petridish.petridish_utils.``sample_from_hull`(hull_points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint], convex_hull_eps: float) → archai.algos.petridish.petridish_utils.ConvexHullPoint

`archai.algos.petridish.petridish_utils.``save_hull`(hull_points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint], expdir: str) → None

`archai.algos.petridish.petridish_utils.``save_hull_frontier`(hull_points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint], convex_hull_eps: float, final_desc_foldername: str, expdir: str) → archai.algos.petridish.petridish_utils.ConvexHullPoint

## archai.algos.petridish.searcher_petridish module

class `archai.algos.petridish.searcher_petridish.``SearcherPetridish`

  Bases: `archai.nas.search_combinations.SearchCombinations`

  `build_model_desc`(model_desc_builder: archai.nas.model_desc_builder.ModelDescBuilder, conf_model_desc: archai.common.config.Config, reductions: int, cells: int, nodes: int) → archai.nas.model_desc.ModelDesc
  `search`(conf_search: archai.common.config.Config, model_desc_builder: archai.nas.model_desc_builder.ModelDescBuilder, trainer_class: Optional[Type[ArchTrainer]], finalizers: archai.nas.finalizers.Finalizers) → archai.nas.searcher.SearchResult
  `search_model_desc_dist` = <ray.remote_function.RemoteFunction object>
  `train_model_desc_dist` = <ray.remote_function.RemoteFunction object>

## Module contents