archai.algos.petridish package¶
Submodules¶
archai.algos.petridish.evaluater_petridish module¶
-
class
archai.algos.petridish.evaluater_petridish.
EvaluaterPetridish
[source]¶ 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[source]¶ 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)[source]¶ Bases:
archai.nas.exp_runner.ExperimentRunner
-
model_desc_builder
() → archai.algos.petridish.petridish_model_desc_builder.PetridishModelBuilder[source]¶
-
trainer_class
() → Optional[Type[archai.nas.arch_trainer.ArchTrainer]][source]¶
-
archai.algos.petridish.petridish_model_desc_builder module¶
-
class
archai.algos.petridish.petridish_model_desc_builder.
PetridishModelBuilder
[source]¶ Bases:
archai.algos.random.random_model_desc_builder.RandomModelDescBuilder
-
pre_build
(conf_model_desc: archai.common.config.Config) → None[source]¶
-
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)[source]¶ 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]][source]¶ for trainable op, return final op and its rank
-
forward
(x: List[torch.Tensor])[source]¶ 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]][source]¶ Return contituent ops, if this op is primitive just return self
-
-
class
archai.algos.petridish.petridish_op.
StopForward
[source]¶ Bases:
archai.nas.operations.Op
-
forward
(x)[source]¶ 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)[source]¶ Bases:
archai.nas.operations.Op
-
forward
(x)[source]¶ 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
[source]¶ Bases:
archai.nas.operations.Op
-
forward
(x)[source]¶ 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)[source]¶ Bases:
archai.nas.operations.Op
-
forward
(x)[source]¶ 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)[source]¶ Bases:
archai.nas.operations.Identity
-
forward
(x)[source]¶ 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)[source]¶ Bases:
object
-
next_stage
() → archai.algos.petridish.petridish_utils.JobStage[source]¶
-
-
class
archai.algos.petridish.petridish_utils.
JobStage
[source]¶ 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[source]¶
-
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]][source]¶
-
archai.algos.petridish.petridish_utils.
plot_frontier
(hull_points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint], convex_hull_eps: float, expdir: str) → None[source]¶
-
archai.algos.petridish.petridish_utils.
plot_pool
(hull_points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint], expdir: str) → None[source]¶
-
archai.algos.petridish.petridish_utils.
plot_seed_model_stats
(seed_model_stats: List[tensorwatch.model_graph.torchstat_utils.ModelStats], expdir: str) → None[source]¶
-
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[source]¶
-
archai.algos.petridish.petridish_utils.
save_hull
(hull_points: List[archai.algos.petridish.petridish_utils.ConvexHullPoint], expdir: str) → None[source]¶
-
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[source]¶
archai.algos.petridish.searcher_petridish module¶
-
class
archai.algos.petridish.searcher_petridish.
SearcherPetridish
[source]¶ 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[source]¶
-
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[source]¶
-
search_model_desc_dist
= <ray.remote_function.RemoteFunction object>¶
-
train_model_desc_dist
= <ray.remote_function.RemoteFunction object>¶
-