ax.storage

JSON

ax.storage.json_store.decoder module

ax.storage.json_store.decoder.ax_class_from_json_dict(_class: Type, object_json: Dict[str, Any], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})Any[source]

Reinstantiates an Ax class registered in DECODER_REGISTRY from a JSON dict.

ax.storage.json_store.decoder.data_from_json(data_by_trial_json: Dict[str, Any], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})Dict[int, OrderedDict[int, Data]][source]

Load Ax Data from JSON.

ax.storage.json_store.decoder.experiment_from_json(object_json: Dict[str, Any], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})ax.core.experiment.Experiment[source]

Load Ax Experiment from JSON.

ax.storage.json_store.decoder.generation_step_from_json(generation_step_json: Dict[str, Any], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})ax.modelbridge.generation_node.GenerationStep[source]

Load generation step from JSON.

ax.storage.json_store.decoder.generation_strategy_from_json(generation_strategy_json: Dict[str, Any], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>}, experiment: Optional[ax.core.experiment.Experiment] = None)ax.modelbridge.generation_strategy.GenerationStrategy[source]

Load generation strategy from JSON.

ax.storage.json_store.decoder.generator_run_from_json(object_json: Dict[str, Any], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})ax.core.generator_run.GeneratorRun[source]

Load Ax GeneratorRun from JSON.

ax.storage.json_store.decoder.multi_type_experiment_from_json(object_json: Dict[str, Any], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})ax.core.multi_type_experiment.MultiTypeExperiment[source]

Load AE MultiTypeExperiment from JSON.

ax.storage.json_store.decoder.object_from_json(object_json: Any, decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})Any[source]

Recursively load objects from a JSON-serializable dictionary.

ax.storage.json_store.decoder.parameter_constraints_from_json(parameter_constraint_json: List[Dict[str, Any]], parameters: List[ax.core.parameter.Parameter], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})List[ax.core.parameter_constraint.ParameterConstraint][source]

Load ParameterConstraints from JSON.

Order and SumConstraint are tied to a search space, and require that SearchSpace’s parameters to be passed in for decoding.

Parameters
  • parameter_constraint_json – JSON representation of parameter constraints.

  • parameters – Parameter definitions for decoding via parameter names.

Returns

Python classes for parameter constraints.

Return type

parameter_constraints

ax.storage.json_store.decoder.runner_from_json(_class: Type[ax.core.runner.Runner], runner_json: Dict[str, Any])ax.core.runner.Runner[source]
ax.storage.json_store.decoder.search_space_from_json(search_space_json: Dict[str, Any], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})ax.core.search_space.SearchSpace[source]

Load a SearchSpace from JSON.

This function is necessary due to the coupled loading of SearchSpace and parameter constraints.

ax.storage.json_store.decoder.trials_from_json(experiment: ax.core.experiment.Experiment, trials_json: Dict[str, Any], decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})Dict[int, ax.core.base_trial.BaseTrial][source]

Load Ax Trials from JSON.

ax.storage.json_store.decoders module

ax.storage.json_store.decoders.batch_trial_from_json(experiment: core.experiment.Experiment, index: int, trial_type: Optional[str], status: TrialStatus, time_created: datetime, time_completed: Optional[datetime], time_staged: Optional[datetime], time_run_started: Optional[datetime], abandoned_reason: Optional[str], run_metadata: Optional[Dict[str, Any]], generator_run_structs: List[GeneratorRunStruct], runner: Optional[Runner], abandoned_arms_metadata: Dict[str, AbandonedArm], num_arms_created: int, status_quo: Optional[Arm], status_quo_weight_override: float, optimize_for_power: Optional[bool], ttl_seconds: Optional[int] = None, generation_step_index: Optional[int] = None, properties: Optional[Dict[str, Any]] = None, stop_metadata: Optional[Dict[str, Any]] = None, **kwargs: Any)BatchTrial[source]

Load Ax BatchTrial from JSON.

Other classes don’t need explicit deserializers, because we can just use their constructors (see decoder.py). However, the constructor for Batch does not allow us to exactly recreate an existing object.

ax.storage.json_store.decoders.botorch_component_from_json(botorch_class: Any, json: Dict[str, Any])Type[Any][source]

Load any instance of gpytorch.Module or descendent registered in CLASS_DECODER_REGISTRY from state dict.

ax.storage.json_store.decoders.class_from_json(json: Dict[str, Any])Type[Any][source]

Load any class registered in CLASS_DECODER_REGISTRY from JSON.

ax.storage.json_store.decoders.transform_type_from_json(object_json: Dict[str, Any])Type[ax.modelbridge.transforms.base.Transform][source]

Load the transform type from JSON.

ax.storage.json_store.decoders.trial_from_json(experiment: core.experiment.Experiment, index: int, trial_type: Optional[str], status: TrialStatus, time_created: datetime, time_completed: Optional[datetime], time_staged: Optional[datetime], time_run_started: Optional[datetime], abandoned_reason: Optional[str], run_metadata: Optional[Dict[str, Any]], generator_run: GeneratorRun, runner: Optional[Runner], num_arms_created: int, ttl_seconds: Optional[int] = None, generation_step_index: Optional[int] = None, properties: Optional[Dict[str, Any]] = None, stop_metadata: Optional[Dict[str, Any]] = None, **kwargs: Any)Trial[source]

Load Ax trial from JSON.

Other classes don’t need explicit deserializers, because we can just use their constructors (see decoder.py). However, the constructor for Trial does not allow us to exactly recreate an existing object.

ax.storage.json_store.encoder module

ax.storage.json_store.encoder.object_to_json(obj: Any, encoder_registry: Dict[Type, Callable[[Any], Dict[str, Any]]] = {<class 'ax.core.arm.Arm'>: <function arm_to_dict>, <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.metrics.branin.AugmentedBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>: <function metric_to_dict>, <class 'ax.core.batch_trial.BatchTrial'>: <function batch_to_dict>, <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>: <function botorch_model_to_dict>, <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>: <function metric_to_dict>, <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>: <function runner_to_dict>, <class 'ax.metrics.branin.BraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.ChoiceParameter'>: <function choice_parameter_to_dict>, <class 'ax.core.data.Data'>: <function data_to_dict>, <class 'ax.core.experiment.Experiment'>: <function experiment_to_dict>, <class 'ax.metrics.factorial.FactorialMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.FixedParameter'>: <function fixed_parameter_to_dict>, <class 'gpytorch.priors.torch_priors.GammaPrior'>: <function botorch_component_to_dict>, <class 'ax.modelbridge.generation_node.GenerationStep'>: <function generation_step_to_dict>, <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>: <function generation_strategy_to_dict>, <class 'ax.core.generator_run.GeneratorRun'>: <function generator_run_to_dict>, <class 'ax.metrics.hartmann6.Hartmann6Metric'>: <function metric_to_dict>, <class 'gpytorch.constraints.constraints.Interval'>: <function botorch_component_to_dict>, <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>: <function surrogate_to_dict>, <class 'ax.metrics.l2norm.L2NormMetric'>: <function metric_to_dict>, <class 'ax.core.map_data.MapData'>: <function map_data_to_dict>, <class 'ax.core.map_data.MapKeyInfo'>: <function map_key_info_to_dict>, <class 'ax.core.map_metric.MapMetric'>: <function metric_to_dict>, <class 'ax.core.metric.Metric'>: <function metric_to_dict>, <class 'ax.core.objective.MultiObjective'>: <function multi_objective_to_dict>, <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>: <function multi_objective_optimization_config_to_dict>, <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>: <function multi_type_experiment_to_dict>, <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>: <function percentile_early_stopping_strategy_to_dict>, <class 'ax.metrics.sklearn.SklearnMetric'>: <function metric_to_dict>, <class 'ax.metrics.chemistry.ChemistryMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin.NegativeBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>: <function metric_to_dict>, <class 'ax.core.objective.Objective'>: <function objective_to_dict>, <class 'ax.core.outcome_constraint.ObjectiveThreshold'>: <function outcome_constraint_to_dict>, <class 'ax.core.optimization_config.OptimizationConfig'>: <function optimization_config_to_dict>, <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.core.parameter_constraint.OrderConstraint'>: <function order_parameter_constraint_to_dict>, <class 'ax.core.outcome_constraint.OutcomeConstraint'>: <function outcome_constraint_to_dict>, <class 'ax.core.parameter_constraint.ParameterConstraint'>: <function parameter_constraint_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>: <function pytorch_cnn_torchvision_benchmark_problem_to_dict>, <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>: <function metric_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>: <function runner_to_dict>, <class 'ax.core.parameter.RangeParameter'>: <function range_parameter_to_dict>, <class 'ax.core.objective.ScalarizedObjective'>: <function scalarized_objective_to_dict>, <class 'ax.core.search_space.SearchSpace'>: <function search_space_to_dict>, <class 'ax.core.search_space.HierarchicalSearchSpace'>: <function search_space_to_dict>, <class 'ax.core.parameter_constraint.SumConstraint'>: <function sum_parameter_constraint_to_dict>, <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>: <function surrogate_to_dict>, <class 'ax.runners.synthetic.SyntheticRunner'>: <function runner_to_dict>, <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>: <function threshold_early_stopping_strategy_to_dict>, <class 'ax.core.trial.Trial'>: <function trial_to_dict>, <class 'ax.core.observation.ObservationFeatures'>: <function observation_features_to_dict>, <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>: <function winsorization_config_to_dict>}, class_encoder_registry: Dict[Type, Callable[[Any], Dict[str, Any]]] = {<class 'ax.models.torch.botorch_modular.acquisition.Acquisition'>: <function botorch_modular_to_dict>, <class 'botorch.acquisition.acquisition.AcquisitionFunction'>: <function botorch_modular_to_dict>, <class 'gpytorch.likelihoods.likelihood.Likelihood'>: <function botorch_modular_to_dict>, <class 'torch.nn.modules.module.Module'>: <function botorch_modular_to_dict>, <class 'gpytorch.mlls.marginal_log_likelihood.MarginalLogLikelihood'>: <function botorch_modular_to_dict>, <class 'botorch.models.model.Model'>: <function botorch_modular_to_dict>, <class 'ax.modelbridge.transforms.base.Transform'>: <function transform_type_to_dict>})Any[source]

Convert an Ax object to a JSON-serializable dictionary.

The root node passed to this function should always be an instance of a core Ax class or a JSON-compatible python builtin. The sub-fields of the input will then be recursively passed to this function.

e.g. if we pass an instance of Experiment, we will first fall through to the line object_dict = ENCODER_REGISTRY[_type](object), which will convert the Experiment to a (shallow) dictionary, where search subfield remains “unconverted”, i.e.: {“name”: <name: string>, “search_space”: <search space: SearchSpace>}. We then pass each item of the dictionary back into this function to recursively convert the entire object.

ax.storage.json_store.encoders module

ax.storage.json_store.encoders.arm_to_dict(arm: ax.core.arm.Arm)Dict[str, Any][source]

Convert Ax arm to a dictionary.

ax.storage.json_store.encoders.batch_to_dict(batch: ax.core.batch_trial.BatchTrial)Dict[str, Any][source]

Convert Ax batch to a dictionary.

ax.storage.json_store.encoders.botorch_component_to_dict(input_obj: Type[Any])Dict[str, Any][source]
ax.storage.json_store.encoders.botorch_model_to_dict(model: ax.models.torch.botorch_modular.model.BoTorchModel)Dict[str, Any][source]

Convert Ax model to a dictionary.

ax.storage.json_store.encoders.botorch_modular_to_dict(class_type: Type[Any])Dict[str, Any][source]

Convert any class to a dictionary.

ax.storage.json_store.encoders.choice_parameter_to_dict(parameter: ax.core.parameter.ChoiceParameter)Dict[str, Any][source]

Convert Ax choice parameter to a dictionary.

ax.storage.json_store.encoders.data_to_dict(data: ax.core.data.Data)Dict[str, Any][source]

Convert Ax data to a dictionary.

ax.storage.json_store.encoders.experiment_to_dict(experiment: ax.core.experiment.Experiment)Dict[str, Any][source]

Convert Ax experiment to a dictionary.

ax.storage.json_store.encoders.fixed_parameter_to_dict(parameter: ax.core.parameter.FixedParameter)Dict[str, Any][source]

Convert Ax fixed parameter to a dictionary.

ax.storage.json_store.encoders.generation_step_to_dict(generation_step: ax.modelbridge.generation_node.GenerationStep)Dict[str, Any][source]

Converts Ax generation step to a dictionary.

ax.storage.json_store.encoders.generation_strategy_to_dict(generation_strategy: ax.modelbridge.generation_strategy.GenerationStrategy)Dict[str, Any][source]

Converts Ax generation strategy to a dictionary.

ax.storage.json_store.encoders.generator_run_to_dict(generator_run: ax.core.generator_run.GeneratorRun)Dict[str, Any][source]

Convert Ax generator run to a dictionary.

ax.storage.json_store.encoders.logical_early_stopping_strategy_to_dict(strategy: ax.early_stopping.strategies.logical.LogicalEarlyStoppingStrategy)Dict[str, Any][source]
ax.storage.json_store.encoders.map_data_to_dict(map_data: ax.core.map_data.MapData)Dict[str, Any][source]

Convert Ax map data to a dictionary.

ax.storage.json_store.encoders.map_key_info_to_dict(mki: ax.core.map_data.MapKeyInfo)Dict[str, Any][source]

Convert Ax map data metadata to a dictionary.

ax.storage.json_store.encoders.metric_to_dict(metric: ax.core.metric.Metric)Dict[str, Any][source]

Convert Ax metric to a dictionary.

ax.storage.json_store.encoders.multi_objective_optimization_config_to_dict(multi_objective_optimization_config: ax.core.optimization_config.MultiObjectiveOptimizationConfig)Dict[str, Any][source]

Convert Ax optimization config to a dictionary.

ax.storage.json_store.encoders.multi_objective_to_dict(objective: ax.core.objective.MultiObjective)Dict[str, Any][source]

Convert Ax objective to a dictionary.

ax.storage.json_store.encoders.multi_type_experiment_to_dict(experiment: ax.core.multi_type_experiment.MultiTypeExperiment)Dict[str, Any][source]

Convert AE multitype experiment to a dictionary.

ax.storage.json_store.encoders.objective_to_dict(objective: ax.core.objective.Objective)Dict[str, Any][source]

Convert Ax objective to a dictionary.

ax.storage.json_store.encoders.observation_features_to_dict(obs_features: ax.core.observation.ObservationFeatures)Dict[str, Any][source]

Converts Ax observation features to a dictionary

ax.storage.json_store.encoders.optimization_config_to_dict(optimization_config: ax.core.optimization_config.OptimizationConfig)Dict[str, Any][source]

Convert Ax optimization config to a dictionary.

ax.storage.json_store.encoders.order_parameter_constraint_to_dict(parameter_constraint: ax.core.parameter_constraint.OrderConstraint)Dict[str, Any][source]

Convert Ax order parameter constraint to a dictionary.

ax.storage.json_store.encoders.outcome_constraint_to_dict(outcome_constraint: ax.core.outcome_constraint.OutcomeConstraint)Dict[str, Any][source]

Convert Ax outcome constraint to a dictionary.

ax.storage.json_store.encoders.parameter_constraint_to_dict(parameter_constraint: ax.core.parameter_constraint.ParameterConstraint)Dict[str, Any][source]

Convert Ax sum parameter constraint to a dictionary.

ax.storage.json_store.encoders.percentile_early_stopping_strategy_to_dict(strategy: ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy)Dict[str, Any][source]

Convert Ax percentile early stopping strategy to a dictionary.

ax.storage.json_store.encoders.pytorch_cnn_torchvision_benchmark_problem_to_dict(problem: ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem)Dict[str, Any][source]
ax.storage.json_store.encoders.range_parameter_to_dict(parameter: ax.core.parameter.RangeParameter)Dict[str, Any][source]

Convert Ax range parameter to a dictionary.

ax.storage.json_store.encoders.runner_to_dict(runner: ax.core.runner.Runner)Dict[str, Any][source]

Convert Ax runner to a dictionary.

ax.storage.json_store.encoders.scalarized_objective_to_dict(objective: ax.core.objective.ScalarizedObjective)Dict[str, Any][source]

Convert Ax objective to a dictionary.

ax.storage.json_store.encoders.search_space_to_dict(search_space: ax.core.search_space.SearchSpace)Dict[str, Any][source]

Convert Ax search space to a dictionary.

ax.storage.json_store.encoders.sum_parameter_constraint_to_dict(parameter_constraint: ax.core.parameter_constraint.SumConstraint)Dict[str, Any][source]

Convert Ax sum parameter constraint to a dictionary.

ax.storage.json_store.encoders.surrogate_to_dict(surrogate: ax.models.torch.botorch_modular.surrogate.Surrogate)Dict[str, Any][source]

Convert Ax surrogate to a dictionary.

ax.storage.json_store.encoders.threshold_early_stopping_strategy_to_dict(strategy: ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy)Dict[str, Any][source]

Convert Ax metric-threshold early stopping strategy to a dictionary.

ax.storage.json_store.encoders.transform_type_to_dict(transform_type: Type[ax.modelbridge.transforms.base.Transform])Dict[str, Any][source]

Convert a transform class to a dictionary.

ax.storage.json_store.encoders.trial_to_dict(trial: ax.core.trial.Trial)Dict[str, Any][source]

Convert Ax trial to a dictionary.

ax.storage.json_store.encoders.winsorization_config_to_dict(config: ax.modelbridge.transforms.winsorize.WinsorizationConfig)Dict[str, Any][source]

Convert Ax winsorization config to a dictionary.

ax.storage.json_store.load module

ax.storage.json_store.load.load_experiment(filepath: str, decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, class_decoder_registry: Dict[str, Callable[[Dict[str, Any]], Any]] = {'Type[AcquisitionFunction]': <function class_from_json>, 'Type[Acquisition]': <function class_from_json>, 'Type[Likelihood]': <function class_from_json>, 'Type[MarginalLogLikelihood]': <function class_from_json>, 'Type[Model]': <function class_from_json>, 'Type[Module]': <function class_from_json>, 'Type[Transform]': <function transform_type_from_json>})ax.core.experiment.Experiment[source]

Load experiment from file.

  1. Read file.

  2. Convert dictionary to Ax experiment instance.

ax.storage.json_store.registry module

ax.storage.json_store.save module

ax.storage.json_store.save.save_experiment(experiment: ax.core.experiment.Experiment, filepath: str, encoder_registry: Dict[Type, Callable[[Any], Dict[str, Any]]] = {<class 'ax.core.arm.Arm'>: <function arm_to_dict>, <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.metrics.branin.AugmentedBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>: <function metric_to_dict>, <class 'ax.core.batch_trial.BatchTrial'>: <function batch_to_dict>, <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>: <function botorch_model_to_dict>, <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>: <function metric_to_dict>, <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>: <function runner_to_dict>, <class 'ax.metrics.branin.BraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.ChoiceParameter'>: <function choice_parameter_to_dict>, <class 'ax.core.data.Data'>: <function data_to_dict>, <class 'ax.core.experiment.Experiment'>: <function experiment_to_dict>, <class 'ax.metrics.factorial.FactorialMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.FixedParameter'>: <function fixed_parameter_to_dict>, <class 'gpytorch.priors.torch_priors.GammaPrior'>: <function botorch_component_to_dict>, <class 'ax.modelbridge.generation_node.GenerationStep'>: <function generation_step_to_dict>, <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>: <function generation_strategy_to_dict>, <class 'ax.core.generator_run.GeneratorRun'>: <function generator_run_to_dict>, <class 'ax.metrics.hartmann6.Hartmann6Metric'>: <function metric_to_dict>, <class 'gpytorch.constraints.constraints.Interval'>: <function botorch_component_to_dict>, <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>: <function surrogate_to_dict>, <class 'ax.metrics.l2norm.L2NormMetric'>: <function metric_to_dict>, <class 'ax.core.map_data.MapData'>: <function map_data_to_dict>, <class 'ax.core.map_data.MapKeyInfo'>: <function map_key_info_to_dict>, <class 'ax.core.map_metric.MapMetric'>: <function metric_to_dict>, <class 'ax.core.metric.Metric'>: <function metric_to_dict>, <class 'ax.core.objective.MultiObjective'>: <function multi_objective_to_dict>, <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>: <function multi_objective_optimization_config_to_dict>, <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>: <function multi_type_experiment_to_dict>, <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>: <function percentile_early_stopping_strategy_to_dict>, <class 'ax.metrics.sklearn.SklearnMetric'>: <function metric_to_dict>, <class 'ax.metrics.chemistry.ChemistryMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin.NegativeBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>: <function metric_to_dict>, <class 'ax.core.objective.Objective'>: <function objective_to_dict>, <class 'ax.core.outcome_constraint.ObjectiveThreshold'>: <function outcome_constraint_to_dict>, <class 'ax.core.optimization_config.OptimizationConfig'>: <function optimization_config_to_dict>, <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.core.parameter_constraint.OrderConstraint'>: <function order_parameter_constraint_to_dict>, <class 'ax.core.outcome_constraint.OutcomeConstraint'>: <function outcome_constraint_to_dict>, <class 'ax.core.parameter_constraint.ParameterConstraint'>: <function parameter_constraint_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>: <function pytorch_cnn_torchvision_benchmark_problem_to_dict>, <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>: <function metric_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>: <function runner_to_dict>, <class 'ax.core.parameter.RangeParameter'>: <function range_parameter_to_dict>, <class 'ax.core.objective.ScalarizedObjective'>: <function scalarized_objective_to_dict>, <class 'ax.core.search_space.SearchSpace'>: <function search_space_to_dict>, <class 'ax.core.search_space.HierarchicalSearchSpace'>: <function search_space_to_dict>, <class 'ax.core.parameter_constraint.SumConstraint'>: <function sum_parameter_constraint_to_dict>, <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>: <function surrogate_to_dict>, <class 'ax.runners.synthetic.SyntheticRunner'>: <function runner_to_dict>, <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>: <function threshold_early_stopping_strategy_to_dict>, <class 'ax.core.trial.Trial'>: <function trial_to_dict>, <class 'ax.core.observation.ObservationFeatures'>: <function observation_features_to_dict>, <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>: <function winsorization_config_to_dict>}, class_encoder_registry: Dict[Type, Callable[[Any], Dict[str, Any]]] = {<class 'ax.models.torch.botorch_modular.acquisition.Acquisition'>: <function botorch_modular_to_dict>, <class 'botorch.acquisition.acquisition.AcquisitionFunction'>: <function botorch_modular_to_dict>, <class 'gpytorch.likelihoods.likelihood.Likelihood'>: <function botorch_modular_to_dict>, <class 'torch.nn.modules.module.Module'>: <function botorch_modular_to_dict>, <class 'gpytorch.mlls.marginal_log_likelihood.MarginalLogLikelihood'>: <function botorch_modular_to_dict>, <class 'botorch.models.model.Model'>: <function botorch_modular_to_dict>, <class 'ax.modelbridge.transforms.base.Transform'>: <function transform_type_to_dict>})None[source]

Save experiment to file.

  1. Convert Ax experiment to JSON-serializable dictionary.

  2. Write to file.

SQLAlchemy (MySQL / SQLite)

ax.storage.sqa_store.base_decoder module

ax.storage.sqa_store.base_encoder module

ax.storage.sqa_store.db module

class ax.storage.sqa_store.db.SQABase[source]

Bases: object

Metaclass for SQLAlchemy classes corresponding to core Ax classes.

ax.storage.sqa_store.db.create_all_tables(engine: sqlalchemy.engine.base.Engine)None[source]

Create all tables that inherit from Base.

Parameters

engine – a SQLAlchemy engine with a connection to a MySQL or SQLite DB.

Note

In order for all tables to be correctly created, all modules that define a mapped class that inherits from Base must be imported.

ax.storage.sqa_store.db.create_mysql_engine_from_creator(creator: Callable, echo: bool = False, pool_recycle: int = 10, **kwargs: Any)sqlalchemy.engine.base.Engine[source]

Create a SQLAlchemy engine with the MySQL dialect given a creator function.

Parameters
  • creator – a callable which returns a DBAPI connection.

  • echo – if True, set engine to be verbose.

  • pool_recycle – number of seconds after which to recycle connections. -1 means no timeout. Default is 10 seconds.

  • **kwargs – keyword args passed to create_engine

Returns

SQLAlchemy engine with connection to MySQL DB.

Return type

Engine

ax.storage.sqa_store.db.create_mysql_engine_from_url(url: str, echo: bool = False, pool_recycle: int = 10, **kwargs: Any)sqlalchemy.engine.base.Engine[source]

Create a SQLAlchemy engine with the MySQL dialect given a database url.

Parameters
  • url – a database url that can include username, password, hostname, database name as well as optional keyword arguments for additional configuration. e.g. dialect+driver://username:password@host:port/database.

  • echo – if True, set engine to be verbose.

  • pool_recycle – number of seconds after which to recycle connections. -1 means no timeout. Default is 10 seconds.

  • **kwargs – keyword args passed to create_engine

Returns

SQLAlchemy engine with connection to MySQL DB.

Return type

Engine

ax.storage.sqa_store.db.create_test_engine(path: Optional[str] = None, echo: bool = True)sqlalchemy.engine.base.Engine[source]

Creates a SQLAlchemy engine object for use in unit tests.

Parameters
  • path – if None, use in-memory SQLite; else attempt to create a SQLite DB in the path provided.

  • echo – if True, set engine to be verbose.

Returns

an instance of SQLAlchemy engine.

Return type

Engine

ax.storage.sqa_store.db.get_engine()sqlalchemy.engine.base.Engine[source]

Fetch a SQLAlchemy engine, if already initialized.

If not initialized, need to either call init_engine_and_session_factory or get_session explicitly.

Returns

an instance of a SQLAlchemy engine with a connection to a DB.

Return type

Engine

ax.storage.sqa_store.db.get_session()sqlalchemy.orm.session.Session[source]

Fetch a SQLAlchemy session with a connection to a DB.

Unless init_engine_and_session_factory is called first with custom args, this will automatically initialize a connection to xdb.adaptive_experiment.

Returns

an instance of a SQLAlchemy session.

Return type

Session

ax.storage.sqa_store.db.init_engine_and_session_factory(url: Optional[str] = None, creator: Optional[Callable] = None, echo: bool = False, force_init: bool = False, **kwargs: Any)None[source]

Initialize the global engine and SESSION_FACTORY for SQLAlchemy.

The initialization needs to only happen once. Note that it is possible to re-initialize the engine by setting the force_init flag to True, but this should only be used if you are absolutely certain that you know what you are doing.

Parameters
  • url – a database url that can include username, password, hostname, database name as well as optional keyword arguments for additional configuration. e.g. dialect+driver://username:password@host:port/database. Either this argument or creator argument must be specified.

  • creator – a callable which returns a DBAPI connection. Either this argument or url argument must be specified.

  • echo – if True, logging for engine is enabled.

  • force_init – if True, allows re-initializing engine and session factory.

  • **kwargs – keyword arguments passed to create_mysql_engine_from_creator

ax.storage.sqa_store.db.init_test_engine_and_session_factory(tier_or_path: Optional[str] = None, echo: bool = False, force_init: bool = False, **kwargs: Any)None[source]

Initialize the global engine and SESSION_FACTORY for SQLAlchemy, using an in-memory SQLite database.

The initialization needs to only happen once. Note that it is possible to re-initialize the engine by setting the force_init flag to True, but this should only be used if you are absolutely certain that you know what you are doing.

Parameters
  • tier_or_path – the name of the DB tier.

  • echo – if True, logging for engine is enabled.

  • force_init – if True, allows re-initializing engine and session factory.

  • **kwargs – keyword arguments passed to create_mysql_engine_from_creator

ax.storage.sqa_store.db.optional_session_scope(session: Optional[sqlalchemy.orm.session.Session] = None)AbstractContextManager[sqlalchemy.orm.session.Session][source]
ax.storage.sqa_store.db.remove_test_db_file(tier_or_path: str)None[source]

Remove the test DB file from system, useful for cleanup in tests.

ax.storage.sqa_store.db.session_scope()Generator[sqlalchemy.orm.session.Session, None, None][source]

Provide a transactional scope around a series of operations.

ax.storage.sqa_store.delete module

ax.storage.sqa_store.json module

class ax.storage.sqa_store.json.JSONEncodedMediumText(object_pairs_hook: Optional[Any] = None, *args: List[Any], **kwargs: Dict[Any, Any])[source]

Bases: ax.storage.sqa_store.json.JSONEncodedObject

Class for JSON-encoding objects in SQLAlchemy, backed by MEDIUMTEXT (MySQL).

See description in JSONEncodedObject.

impl: sqlalchemy.sql.sqltypes.VARCHAR = Text(length=16777215)
class ax.storage.sqa_store.json.JSONEncodedObject(object_pairs_hook: Optional[Any] = None, *args: List[Any], **kwargs: Dict[Any, Any])[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

Class for JSON-encoding objects in SQLAlchemy.

Represents an object that is automatically marshalled and unmarshalled to/from the corresponding JSON string. By itself, this data structure does not track any changes.

cache_ok = True

Indicate if statements using this ExternalType are “safe to cache”.

The default value None will emit a warning and then not allow caching of a statement which includes this type. Set to False to disable statements using this type from being cached at all without a warning. When set to True, the object’s class and selected elements from its state will be used as part of the cache key. For example, using a TypeDecorator:

class MyType(TypeDecorator):
    impl = String

    cache_ok = True

    def __init__(self, choices):
        self.choices = tuple(choices)
        self.internal_only = True

The cache key for the above type would be equivalent to:

>>> MyType(["a", "b", "c"])._static_cache_key
(<class '__main__.MyType'>, ('choices', ('a', 'b', 'c')))

The caching scheme will extract attributes from the type that correspond to the names of parameters in the __init__() method. Above, the “choices” attribute becomes part of the cache key but “internal_only” does not, because there is no parameter named “internal_only”.

The requirements for cacheable elements is that they are hashable and also that they indicate the same SQL rendered for expressions using this type every time for a given cache value.

To accommodate for datatypes that refer to unhashable structures such as dictionaries, sets and lists, these objects can be made “cacheable” by assigning hashable structures to the attributes whose names correspond with the names of the arguments. For example, a datatype which accepts a dictionary of lookup values may publish this as a sorted series of tuples. Given a previously un-cacheable type as:

class LookupType(UserDefinedType):
    '''a custom type that accepts a dictionary as a parameter.

    this is the non-cacheable version, as "self.lookup" is not
    hashable.

    '''

    def __init__(self, lookup):
        self.lookup = lookup

    def get_col_spec(self, **kw):
        return "VARCHAR(255)"

    def bind_processor(self, dialect):
        # ...  works with "self.lookup" ...

Where “lookup” is a dictionary. The type will not be able to generate a cache key:

>>> type_ = LookupType({"a": 10, "b": 20})
>>> type_._static_cache_key
<stdin>:1: SAWarning: UserDefinedType LookupType({'a': 10, 'b': 20}) will not
produce a cache key because the ``cache_ok`` flag is not set to True.
Set this flag to True if this type object's state is safe to use
in a cache key, or False to disable this warning.
symbol('no_cache')

If we did set up such a cache key, it wouldn’t be usable. We would get a tuple structure that contains a dictionary inside of it, which cannot itself be used as a key in a “cache dictionary” such as SQLAlchemy’s statement cache, since Python dictionaries aren’t hashable:

>>> # set cache_ok = True
>>> type_.cache_ok = True

>>> # this is the cache key it would generate
>>> key = type_._static_cache_key
>>> key
(<class '__main__.LookupType'>, ('lookup', {'a': 10, 'b': 20}))

>>> # however this key is not hashable, will fail when used with
>>> # SQLAlchemy statement cache
>>> some_cache = {key: "some sql value"}
Traceback (most recent call last): File "<stdin>", line 1,
in <module> TypeError: unhashable type: 'dict'

The type may be made cacheable by assigning a sorted tuple of tuples to the “.lookup” attribute:

class LookupType(UserDefinedType):
    '''a custom type that accepts a dictionary as a parameter.

    The dictionary is stored both as itself in a private variable,
    and published in a public variable as a sorted tuple of tuples,
    which is hashable and will also return the same value for any
    two equivalent dictionaries.  Note it assumes the keys and
    values of the dictionary are themselves hashable.

    '''

    cache_ok = True

    def __init__(self, lookup):
        self._lookup = lookup

        # assume keys/values of "lookup" are hashable; otherwise
        # they would also need to be converted in some way here
        self.lookup = tuple(
            (key, lookup[key]) for key in sorted(lookup)
        )

    def get_col_spec(self, **kw):
        return "VARCHAR(255)"

    def bind_processor(self, dialect):
        # ...  works with "self._lookup" ...

Where above, the cache key for LookupType({"a": 10, "b": 20}) will be:

>>> LookupType({"a": 10, "b": 20})._static_cache_key
(<class '__main__.LookupType'>, ('lookup', (('a', 10), ('b', 20))))

New in version 1.4.14: - added the cache_ok flag to allow some configurability of caching for TypeDecorator classes.

New in version 1.4.28: - added the ExternalType mixin which generalizes the cache_ok flag to both the TypeDecorator and UserDefinedType classes.

See also

sql_caching

impl: sqlalchemy.sql.sqltypes.VARCHAR = VARCHAR(length=4096)
process_bind_param(value: Any, dialect: Any)Optional[str][source]

Receive a bound parameter value to be converted.

Custom subclasses of _types.TypeDecorator should override this method to provide custom behaviors for incoming data values. This method is called at statement execution time and is passed the literal Python data value which is to be associated with a bound parameter in the statement.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

Parameters
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.

  • dialect – the Dialect in use.

See also

types_typedecorator

_types.TypeDecorator.process_result_value()

process_result_value(value: Any, dialect: Any)Any[source]

Receive a result-row column value to be converted.

Custom subclasses of _types.TypeDecorator should override this method to provide custom behaviors for data values being received in result rows coming from the database. This method is called at result fetching time and is passed the literal Python data value that’s extracted from a database result row.

The operation could be anything desired to perform custom behavior, such as transforming or deserializing data.

Parameters
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.

  • dialect – the Dialect in use.

See also

types_typedecorator

_types.TypeDecorator.process_bind_param()

class ax.storage.sqa_store.json.JSONEncodedText(object_pairs_hook: Optional[Any] = None, *args: List[Any], **kwargs: Dict[Any, Any])[source]

Bases: ax.storage.sqa_store.json.JSONEncodedObject

Class for JSON-encoding objects in SQLAlchemy, backed by TEXT (MySQL).

See description in JSONEncodedObject.

impl

alias of sqlalchemy.sql.sqltypes.Text

object_pairs_hook: Any

ax.storage.sqa_store.load module

ax.storage.sqa_store.save module

ax.storage.sqa_store.structs module

ax.storage.sqa_store.sqa_classes module

class ax.storage.sqa_store.sqa_classes.SQAAbandonedArm(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

abandoned_reason: Optional[str] = Column(None, String(length=255), table=None)
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
name: str = Column(None, String(length=100), table=None, nullable=False)
time_abandoned: datetime.datetime = Column(None, IntTimestamp(), table=None, nullable=False, default=ColumnDefault(<function datetime.now>))
trial_id: int = Column(None, Integer(), ForeignKey('trial_v2.id'), table=None)
class ax.storage.sqa_store.sqa_classes.SQAArm(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

generator_run_id: int = Column(None, Integer(), ForeignKey('generator_run_v2.id'), table=None)
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
name: Optional[str] = Column(None, String(length=100), table=None)
parameters: Dict[str, Optional[Union[str, bool, float, int]]] = Column(None, JSONEncodedText(), table=None, nullable=False)
weight: float = Column(None, Float(), table=None, nullable=False, default=ColumnDefault(1.0))
class ax.storage.sqa_store.sqa_classes.SQAData(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

data_json: str = Column(None, Text(length=4294967295), table=None, nullable=False)
description: Optional[str] = Column(None, String(length=255), table=None)
experiment_id: int = Column(None, Integer(), ForeignKey('experiment_v2.id'), table=None)
generation_strategy_id: Optional[int] = Column(None, Integer(), ForeignKey('generation_strategy.id'), table=None)
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
structure_metadata_json: str = Column(None, Text(length=4294967295), table=None)
time_created: int = Column(None, BigInteger(), table=None, nullable=False)
trial_index: Optional[int] = Column(None, Integer(), table=None)
class ax.storage.sqa_store.sqa_classes.SQAExperiment(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

data: List[ax.storage.sqa_store.sqa_classes.SQAData] = <RelationshipProperty at 0x7f5b828d73b0; no key>
default_data_type: ax.core.experiment.DataType = Column(None, IntEnum(), table=None)
default_trial_type: Optional[str] = Column(None, String(length=100), table=None)
description: Optional[str] = Column(None, String(length=255), table=None)
experiment_type: Optional[int] = Column(None, Integer(), table=None)
generation_strategy: Optional[ax.storage.sqa_store.sqa_classes.SQAGenerationStrategy] = <RelationshipProperty at 0x7f5b828d7710; no key>
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
is_test: bool = Column(None, Boolean(), table=None, nullable=False, default=ColumnDefault(False))
metrics: List[ax.storage.sqa_store.sqa_classes.SQAMetric] = <RelationshipProperty at 0x7f5b828d7440; no key>
name: str = Column(None, String(length=100), table=None, nullable=False)
parameter_constraints: List[ax.storage.sqa_store.sqa_classes.SQAParameterConstraint] = <RelationshipProperty at 0x7f5b828d7560; no key>
parameters: List[ax.storage.sqa_store.sqa_classes.SQAParameter] = <RelationshipProperty at 0x7f5b828d74d0; no key>
properties: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None, default=ColumnDefault({}))
runners: List[ax.storage.sqa_store.sqa_classes.SQARunner] = <RelationshipProperty at 0x7f5b828d75f0; no key>
status_quo_name: Optional[str] = Column(None, String(length=100), table=None)
status_quo_parameters: Optional[Dict[str, Optional[Union[str, bool, float, int]]]] = Column(None, JSONEncodedText(), table=None)
time_created: datetime.datetime = Column(None, IntTimestamp(), table=None, nullable=False)
trials: List[ax.storage.sqa_store.sqa_classes.SQATrial] = <RelationshipProperty at 0x7f5b828d7680; no key>
class ax.storage.sqa_store.sqa_classes.SQAGenerationStrategy(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

curr_index: int = Column(None, Integer(), table=None, nullable=False)
experiment_id: Optional[int] = Column(None, Integer(), ForeignKey('experiment_v2.id'), table=None)
generator_runs: List[ax.storage.sqa_store.sqa_classes.SQAGeneratorRun] = <RelationshipProperty at 0x7f5b828c5050; no key>
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
name: str = Column(None, String(length=100), table=None, nullable=False)
steps: List[Dict[str, Any]] = Column(None, JSONEncodedObject(length=4096), table=None, nullable=False)
class ax.storage.sqa_store.sqa_classes.SQAGeneratorRun(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

arms: List[ax.storage.sqa_store.sqa_classes.SQAArm] = <RelationshipProperty at 0x7f5b828ac950; no key>
best_arm_name: Optional[str] = Column(None, String(length=100), table=None)
best_arm_parameters: Optional[Dict[str, Optional[Union[str, bool, float, int]]]] = Column(None, JSONEncodedText(), table=None)
best_arm_predictions: Optional[Tuple[Dict[str, float], Optional[Dict[str, Dict[str, float]]]]] = Column(None, JSONEncodedObject(length=4096), table=None)
bridge_kwargs: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None)
candidate_metadata_by_arm_signature: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None)
fit_time: Optional[float] = Column(None, Float(), table=None)
gen_metadata: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None)
gen_time: Optional[float] = Column(None, Float(), table=None)
generation_step_index: Optional[int] = Column(None, Integer(), table=None)
generation_strategy_id: Optional[int] = Column(None, Integer(), ForeignKey('generation_strategy.id'), table=None)
generator_run_type: Optional[int] = Column(None, Integer(), table=None)
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
index: Optional[int] = Column(None, Integer(), table=None)
metrics: List[ax.storage.sqa_store.sqa_classes.SQAMetric] = <RelationshipProperty at 0x7f5b829dbc20; no key>
model_key: Optional[str] = Column(None, String(length=100), table=None)
model_kwargs: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None)
model_predictions: Optional[Tuple[Dict[str, List[float]], Dict[str, Dict[str, List[float]]]]] = Column(None, JSONEncodedObject(length=4096), table=None)
model_state_after_gen: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None)
parameter_constraints: List[ax.storage.sqa_store.sqa_classes.SQAParameterConstraint] = <RelationshipProperty at 0x7f5b828accb0; no key>
parameters: List[ax.storage.sqa_store.sqa_classes.SQAParameter] = <RelationshipProperty at 0x7f5b828acc20; no key>
time_created: datetime.datetime = Column(None, IntTimestamp(), table=None, nullable=False, default=ColumnDefault(<function datetime.now>))
trial_id: Optional[int] = Column(None, Integer(), ForeignKey('trial_v2.id'), table=None)
weight: Optional[float] = Column(None, Float(), table=None)
class ax.storage.sqa_store.sqa_classes.SQAMetric(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

bound: Optional[float] = Column(None, Float(), table=None)
canonical_name: Optional[str] = Column(None, String(length=100), table=None)
experiment_id: Optional[int] = Column(None, Integer(), ForeignKey('experiment_v2.id'), table=None)
generator_run_id: Optional[int] = Column(None, Integer(), ForeignKey('generator_run_v2.id'), table=None)
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
intent: ax.storage.utils.MetricIntent = Column(None, StringEnum(length=100), table=None, nullable=False)
lower_is_better: Optional[bool] = Column(None, Boolean(), table=None)
metric_type: int = Column(None, Integer(), table=None, nullable=False)
minimize: Optional[bool] = Column(None, Boolean(), table=None)
name: str = Column(None, String(length=255), table=None, nullable=False)
op: Optional[ax.core.types.ComparisonOp] = Column(None, IntEnum(), table=None)
properties: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None, default=ColumnDefault({}))
relative: Optional[bool] = Column(None, Boolean(), table=None)
scalarized_objective_children_metrics = <RelationshipProperty at 0x7f5b829dbe60; no key>
scalarized_objective_id = Column(None, Integer(), ForeignKey('metric_v2.id'), table=None)
scalarized_objective_weight: Optional[float] = Column(None, Float(), table=None)
scalarized_outcome_constraint_children_metrics = <RelationshipProperty at 0x7f5b828ac200; no key>
scalarized_outcome_constraint_id = Column(None, Integer(), ForeignKey('metric_v2.id'), table=None)
scalarized_outcome_constraint_weight: Optional[float] = Column(None, Float(), table=None)
trial_type: Optional[str] = Column(None, String(length=100), table=None)
class ax.storage.sqa_store.sqa_classes.SQAParameter(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

choice_values: Optional[List[Optional[Union[str, bool, float, int]]]] = Column(None, JSONEncodedObject(length=4096), table=None)
digits: Optional[int] = Column(None, Integer(), table=None)
domain_type: ax.storage.utils.DomainType = Column(None, IntEnum(), table=None, nullable=False)
experiment_id: Optional[int] = Column(None, Integer(), ForeignKey('experiment_v2.id'), table=None)
fixed_value: Optional[Union[str, bool, float, int]] = Column(None, JSONEncodedObject(length=4096), table=None)
generator_run_id: Optional[int] = Column(None, Integer(), ForeignKey('generator_run_v2.id'), table=None)
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
is_fidelity: Optional[bool] = Column(None, Boolean(), table=None)
is_ordered: Optional[bool] = Column(None, Boolean(), table=None)
is_task: Optional[bool] = Column(None, Boolean(), table=None)
log_scale: Optional[bool] = Column(None, Boolean(), table=None)
lower: Optional[float] = Column(None, Float(), table=None)
name: str = Column(None, String(length=100), table=None, nullable=False)
parameter_type: ax.core.parameter.ParameterType = Column(None, IntEnum(), table=None, nullable=False)
target_value: Optional[Union[str, bool, float, int]] = Column(None, JSONEncodedObject(length=4096), table=None)
upper: Optional[float] = Column(None, Float(), table=None)
class ax.storage.sqa_store.sqa_classes.SQAParameterConstraint(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

bound: float = Column(None, Float(), table=None, nullable=False)
constraint_dict: Dict[str, float] = Column(None, JSONEncodedObject(length=4096), table=None, nullable=False)
experiment_id: Optional[int] = Column(None, Integer(), ForeignKey('experiment_v2.id'), table=None)
generator_run_id: Optional[int] = Column(None, Integer(), ForeignKey('generator_run_v2.id'), table=None)
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
type: ax.storage.sqa_store.sqa_enum.IntEnum = Column(None, IntEnum(), table=None, nullable=False)
class ax.storage.sqa_store.sqa_classes.SQARunner(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

experiment_id: Optional[int] = Column(None, Integer(), ForeignKey('experiment_v2.id'), table=None)
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
properties: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None, default=ColumnDefault({}))
runner_type: int = Column(None, Integer(), table=None, nullable=False)
trial_id: Optional[int] = Column(None, Integer(), ForeignKey('trial_v2.id'), table=None)
trial_type: Optional[str] = Column(None, String(length=100), table=None)
class ax.storage.sqa_store.sqa_classes.SQATrial(*args: Any, **kwargs: Any)[source]

Bases: sqlalchemy.ext.declarative.

abandoned_arms: List[ax.storage.sqa_store.sqa_classes.SQAAbandonedArm] = <RelationshipProperty at 0x7f5b828c5e60; no key>
abandoned_reason: Optional[str] = Column(None, String(length=100), table=None)
deployed_name: Optional[str] = Column(None, String(length=100), table=None)
experiment_id: int = Column(None, Integer(), ForeignKey('experiment_v2.id'), table=None)
generation_step_index: Optional[int] = Column(None, Integer(), table=None)
generator_runs: List[ax.storage.sqa_store.sqa_classes.SQAGeneratorRun] = <RelationshipProperty at 0x7f5b828c5ef0; no key>
id: int = Column(None, Integer(), table=None, primary_key=True, nullable=False)
index: int = Column(None, Integer(), table=None, nullable=False)
is_batch: bool = Column('is_batched', Boolean(), table=None, nullable=False, default=ColumnDefault(True))
lifecycle_stage: ax.core.batch_trial.LifecycleStage = Column(None, IntEnum(), table=None)
num_arms_created: int = Column(None, Integer(), table=None, nullable=False, default=ColumnDefault(0))
optimize_for_power: Optional[bool] = Column(None, Boolean(), table=None)
properties: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None, default=ColumnDefault({}))
run_metadata: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None)
runner: ax.storage.sqa_store.sqa_classes.SQARunner = <RelationshipProperty at 0x7f5b828c5f80; no key>
status: ax.core.base_trial.TrialStatus = Column(None, IntEnum(), table=None, nullable=False, default=ColumnDefault(<TrialStatus.CANDIDATE: 0>))
status_quo_name: Optional[str] = Column(None, String(length=100), table=None)
stop_metadata: Optional[Dict[str, Any]] = Column(None, JSONEncodedText(), table=None)
time_completed: Optional[datetime.datetime] = Column(None, IntTimestamp(), table=None)
time_created: datetime.datetime = Column(None, IntTimestamp(), table=None, nullable=False)
time_run_started: Optional[datetime.datetime] = Column(None, IntTimestamp(), table=None)
time_staged: Optional[datetime.datetime] = Column(None, IntTimestamp(), table=None)
trial_type: Optional[str] = Column(None, String(length=100), table=None)
ttl_seconds: Optional[int] = Column(None, Integer(), table=None)

ax.storage.sqa_store.sqa_config module

ax.storage.sqa_store.sqa_enum module

class ax.storage.sqa_store.sqa_enum.BaseNullableEnum(enum: Any, *arg: List[Any], **kw: Dict[Any, Any])[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

cache_ok = True

Indicate if statements using this ExternalType are “safe to cache”.

The default value None will emit a warning and then not allow caching of a statement which includes this type. Set to False to disable statements using this type from being cached at all without a warning. When set to True, the object’s class and selected elements from its state will be used as part of the cache key. For example, using a TypeDecorator:

class MyType(TypeDecorator):
    impl = String

    cache_ok = True

    def __init__(self, choices):
        self.choices = tuple(choices)
        self.internal_only = True

The cache key for the above type would be equivalent to:

>>> MyType(["a", "b", "c"])._static_cache_key
(<class '__main__.MyType'>, ('choices', ('a', 'b', 'c')))

The caching scheme will extract attributes from the type that correspond to the names of parameters in the __init__() method. Above, the “choices” attribute becomes part of the cache key but “internal_only” does not, because there is no parameter named “internal_only”.

The requirements for cacheable elements is that they are hashable and also that they indicate the same SQL rendered for expressions using this type every time for a given cache value.

To accommodate for datatypes that refer to unhashable structures such as dictionaries, sets and lists, these objects can be made “cacheable” by assigning hashable structures to the attributes whose names correspond with the names of the arguments. For example, a datatype which accepts a dictionary of lookup values may publish this as a sorted series of tuples. Given a previously un-cacheable type as:

class LookupType(UserDefinedType):
    '''a custom type that accepts a dictionary as a parameter.

    this is the non-cacheable version, as "self.lookup" is not
    hashable.

    '''

    def __init__(self, lookup):
        self.lookup = lookup

    def get_col_spec(self, **kw):
        return "VARCHAR(255)"

    def bind_processor(self, dialect):
        # ...  works with "self.lookup" ...

Where “lookup” is a dictionary. The type will not be able to generate a cache key:

>>> type_ = LookupType({"a": 10, "b": 20})
>>> type_._static_cache_key
<stdin>:1: SAWarning: UserDefinedType LookupType({'a': 10, 'b': 20}) will not
produce a cache key because the ``cache_ok`` flag is not set to True.
Set this flag to True if this type object's state is safe to use
in a cache key, or False to disable this warning.
symbol('no_cache')

If we did set up such a cache key, it wouldn’t be usable. We would get a tuple structure that contains a dictionary inside of it, which cannot itself be used as a key in a “cache dictionary” such as SQLAlchemy’s statement cache, since Python dictionaries aren’t hashable:

>>> # set cache_ok = True
>>> type_.cache_ok = True

>>> # this is the cache key it would generate
>>> key = type_._static_cache_key
>>> key
(<class '__main__.LookupType'>, ('lookup', {'a': 10, 'b': 20}))

>>> # however this key is not hashable, will fail when used with
>>> # SQLAlchemy statement cache
>>> some_cache = {key: "some sql value"}
Traceback (most recent call last): File "<stdin>", line 1,
in <module> TypeError: unhashable type: 'dict'

The type may be made cacheable by assigning a sorted tuple of tuples to the “.lookup” attribute:

class LookupType(UserDefinedType):
    '''a custom type that accepts a dictionary as a parameter.

    The dictionary is stored both as itself in a private variable,
    and published in a public variable as a sorted tuple of tuples,
    which is hashable and will also return the same value for any
    two equivalent dictionaries.  Note it assumes the keys and
    values of the dictionary are themselves hashable.

    '''

    cache_ok = True

    def __init__(self, lookup):
        self._lookup = lookup

        # assume keys/values of "lookup" are hashable; otherwise
        # they would also need to be converted in some way here
        self.lookup = tuple(
            (key, lookup[key]) for key in sorted(lookup)
        )

    def get_col_spec(self, **kw):
        return "VARCHAR(255)"

    def bind_processor(self, dialect):
        # ...  works with "self._lookup" ...

Where above, the cache key for LookupType({"a": 10, "b": 20}) will be:

>>> LookupType({"a": 10, "b": 20})._static_cache_key
(<class '__main__.LookupType'>, ('lookup', (('a', 10), ('b', 20))))

New in version 1.4.14: - added the cache_ok flag to allow some configurability of caching for TypeDecorator classes.

New in version 1.4.28: - added the ExternalType mixin which generalizes the cache_ok flag to both the TypeDecorator and UserDefinedType classes.

See also

sql_caching

process_bind_param(value: Any, dialect: Any)Any[source]

Receive a bound parameter value to be converted.

Custom subclasses of _types.TypeDecorator should override this method to provide custom behaviors for incoming data values. This method is called at statement execution time and is passed the literal Python data value which is to be associated with a bound parameter in the statement.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

Parameters
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.

  • dialect – the Dialect in use.

See also

types_typedecorator

_types.TypeDecorator.process_result_value()

process_result_value(value: Any, dialect: Any)Any[source]

Receive a result-row column value to be converted.

Custom subclasses of _types.TypeDecorator should override this method to provide custom behaviors for data values being received in result rows coming from the database. This method is called at result fetching time and is passed the literal Python data value that’s extracted from a database result row.

The operation could be anything desired to perform custom behavior, such as transforming or deserializing data.

Parameters
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.

  • dialect – the Dialect in use.

See also

types_typedecorator

_types.TypeDecorator.process_bind_param()

class ax.storage.sqa_store.sqa_enum.IntEnum(enum: Any, *arg: List[Any], **kw: Dict[Any, Any])[source]

Bases: ax.storage.sqa_store.sqa_enum.BaseNullableEnum

impl

alias of sqlalchemy.sql.sqltypes.SmallInteger

class ax.storage.sqa_store.sqa_enum.StringEnum(enum: Any, *arg: List[Any], **kw: Dict[Any, Any])[source]

Bases: ax.storage.sqa_store.sqa_enum.BaseNullableEnum

impl = VARCHAR(length=100)

ax.storage.sqa_store.timestamp module

class ax.storage.sqa_store.timestamp.IntTimestamp(*args, **kwargs)[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

cache_ok = True

Indicate if statements using this ExternalType are “safe to cache”.

The default value None will emit a warning and then not allow caching of a statement which includes this type. Set to False to disable statements using this type from being cached at all without a warning. When set to True, the object’s class and selected elements from its state will be used as part of the cache key. For example, using a TypeDecorator:

class MyType(TypeDecorator):
    impl = String

    cache_ok = True

    def __init__(self, choices):
        self.choices = tuple(choices)
        self.internal_only = True

The cache key for the above type would be equivalent to:

>>> MyType(["a", "b", "c"])._static_cache_key
(<class '__main__.MyType'>, ('choices', ('a', 'b', 'c')))

The caching scheme will extract attributes from the type that correspond to the names of parameters in the __init__() method. Above, the “choices” attribute becomes part of the cache key but “internal_only” does not, because there is no parameter named “internal_only”.

The requirements for cacheable elements is that they are hashable and also that they indicate the same SQL rendered for expressions using this type every time for a given cache value.

To accommodate for datatypes that refer to unhashable structures such as dictionaries, sets and lists, these objects can be made “cacheable” by assigning hashable structures to the attributes whose names correspond with the names of the arguments. For example, a datatype which accepts a dictionary of lookup values may publish this as a sorted series of tuples. Given a previously un-cacheable type as:

class LookupType(UserDefinedType):
    '''a custom type that accepts a dictionary as a parameter.

    this is the non-cacheable version, as "self.lookup" is not
    hashable.

    '''

    def __init__(self, lookup):
        self.lookup = lookup

    def get_col_spec(self, **kw):
        return "VARCHAR(255)"

    def bind_processor(self, dialect):
        # ...  works with "self.lookup" ...

Where “lookup” is a dictionary. The type will not be able to generate a cache key:

>>> type_ = LookupType({"a": 10, "b": 20})
>>> type_._static_cache_key
<stdin>:1: SAWarning: UserDefinedType LookupType({'a': 10, 'b': 20}) will not
produce a cache key because the ``cache_ok`` flag is not set to True.
Set this flag to True if this type object's state is safe to use
in a cache key, or False to disable this warning.
symbol('no_cache')

If we did set up such a cache key, it wouldn’t be usable. We would get a tuple structure that contains a dictionary inside of it, which cannot itself be used as a key in a “cache dictionary” such as SQLAlchemy’s statement cache, since Python dictionaries aren’t hashable:

>>> # set cache_ok = True
>>> type_.cache_ok = True

>>> # this is the cache key it would generate
>>> key = type_._static_cache_key
>>> key
(<class '__main__.LookupType'>, ('lookup', {'a': 10, 'b': 20}))

>>> # however this key is not hashable, will fail when used with
>>> # SQLAlchemy statement cache
>>> some_cache = {key: "some sql value"}
Traceback (most recent call last): File "<stdin>", line 1,
in <module> TypeError: unhashable type: 'dict'

The type may be made cacheable by assigning a sorted tuple of tuples to the “.lookup” attribute:

class LookupType(UserDefinedType):
    '''a custom type that accepts a dictionary as a parameter.

    The dictionary is stored both as itself in a private variable,
    and published in a public variable as a sorted tuple of tuples,
    which is hashable and will also return the same value for any
    two equivalent dictionaries.  Note it assumes the keys and
    values of the dictionary are themselves hashable.

    '''

    cache_ok = True

    def __init__(self, lookup):
        self._lookup = lookup

        # assume keys/values of "lookup" are hashable; otherwise
        # they would also need to be converted in some way here
        self.lookup = tuple(
            (key, lookup[key]) for key in sorted(lookup)
        )

    def get_col_spec(self, **kw):
        return "VARCHAR(255)"

    def bind_processor(self, dialect):
        # ...  works with "self._lookup" ...

Where above, the cache key for LookupType({"a": 10, "b": 20}) will be:

>>> LookupType({"a": 10, "b": 20})._static_cache_key
(<class '__main__.LookupType'>, ('lookup', (('a', 10), ('b', 20))))

New in version 1.4.14: - added the cache_ok flag to allow some configurability of caching for TypeDecorator classes.

New in version 1.4.28: - added the ExternalType mixin which generalizes the cache_ok flag to both the TypeDecorator and UserDefinedType classes.

See also

sql_caching

impl

alias of sqlalchemy.sql.sqltypes.Integer

process_bind_param(value: Optional[datetime.datetime], dialect: sqlalchemy.engine.interfaces.Dialect)Optional[int][source]

Receive a bound parameter value to be converted.

Custom subclasses of _types.TypeDecorator should override this method to provide custom behaviors for incoming data values. This method is called at statement execution time and is passed the literal Python data value which is to be associated with a bound parameter in the statement.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

Parameters
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.

  • dialect – the Dialect in use.

See also

types_typedecorator

_types.TypeDecorator.process_result_value()

process_result_value(value: Optional[int], dialect: sqlalchemy.engine.interfaces.Dialect)Optional[datetime.datetime][source]

Receive a result-row column value to be converted.

Custom subclasses of _types.TypeDecorator should override this method to provide custom behaviors for data values being received in result rows coming from the database. This method is called at result fetching time and is passed the literal Python data value that’s extracted from a database result row.

The operation could be anything desired to perform custom behavior, such as transforming or deserializing data.

Parameters
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.

  • dialect – the Dialect in use.

See also

types_typedecorator

_types.TypeDecorator.process_bind_param()

ax.storage.sqa_store.utils module

ax.storage.sqa_store.validation module

ax.storage.sqa_store.reduced_state module

ax.storage.sqa_store.reduced_state.get_query_options_to_defer_immutable_duplicates()List[sqlalchemy.orm.strategy_options.Load][source]

Returns the query options that defer loading of attributes that are duplicated on each trial (like search space attributes and metrics). These attributes do not need to be loaded for experiments with immutable search space and optimization configuration.

ax.storage.sqa_store.reduced_state.get_query_options_to_defer_large_model_cols()List[sqlalchemy.orm.strategy_options.Load][source]

Returns the query options that defer loading of model-state-related columns of generator runs, which can be large and are not needed on every generator run when loading experiment and generation strategy in reduced state.

Registries

ax.storage.botorch_modular_registry.ACQUISITION_FUNCTION_REGISTRY: Dict[Type[botorch.acquisition.acquisition.AcquisitionFunction], str] = {<class 'botorch.acquisition.analytic.ExpectedImprovement'>: 'ExpectedImprovement', <class 'botorch.acquisition.multi_objective.monte_carlo.qExpectedHypervolumeImprovement'>: 'qExpectedHypervolumeImprovement', <class 'botorch.acquisition.multi_objective.monte_carlo.qNoisyExpectedHypervolumeImprovement'>: 'qNoisyExpectedHypervolumeImprovement', <class 'botorch.acquisition.monte_carlo.qExpectedImprovement'>: 'qExpectedImprovement', <class 'botorch.acquisition.knowledge_gradient.qKnowledgeGradient'>: 'qKnowledgeGradient', <class 'botorch.acquisition.max_value_entropy_search.qMaxValueEntropy'>: 'qMaxValueEntropy', <class 'botorch.acquisition.knowledge_gradient.qMultiFidelityKnowledgeGradient'>: 'qMultiFidelityKnowledgeGradient', <class 'botorch.acquisition.max_value_entropy_search.qMultiFidelityMaxValueEntropy'>: 'qMultiFidelityMaxValueEntropy', <class 'botorch.acquisition.monte_carlo.qNoisyExpectedImprovement'>: 'qNoisyExpectedImprovement'}

Mapping of BoTorch MarginalLogLikelihood classes to class name strings.

ax.storage.botorch_modular_registry.ACQUISITION_REGISTRY: Dict[Type[ax.models.torch.botorch_modular.acquisition.Acquisition], str] = {<class 'ax.models.torch.botorch_modular.acquisition.Acquisition'>: 'Acquisition'}

Mapping of BoTorch Model classes to class name strings.

ax.storage.botorch_modular_registry.CLASS_TO_REGISTRY: Dict[Any, Dict[Type[Any], str]] = {<class 'ax.models.torch.botorch_modular.acquisition.Acquisition'>: {<class 'ax.models.torch.botorch_modular.acquisition.Acquisition'>: 'Acquisition'}, <class 'botorch.acquisition.acquisition.AcquisitionFunction'>: {<class 'botorch.acquisition.analytic.ExpectedImprovement'>: 'ExpectedImprovement', <class 'botorch.acquisition.multi_objective.monte_carlo.qExpectedHypervolumeImprovement'>: 'qExpectedHypervolumeImprovement', <class 'botorch.acquisition.multi_objective.monte_carlo.qNoisyExpectedHypervolumeImprovement'>: 'qNoisyExpectedHypervolumeImprovement', <class 'botorch.acquisition.monte_carlo.qExpectedImprovement'>: 'qExpectedImprovement', <class 'botorch.acquisition.knowledge_gradient.qKnowledgeGradient'>: 'qKnowledgeGradient', <class 'botorch.acquisition.max_value_entropy_search.qMaxValueEntropy'>: 'qMaxValueEntropy', <class 'botorch.acquisition.knowledge_gradient.qMultiFidelityKnowledgeGradient'>: 'qMultiFidelityKnowledgeGradient', <class 'botorch.acquisition.max_value_entropy_search.qMultiFidelityMaxValueEntropy'>: 'qMultiFidelityMaxValueEntropy', <class 'botorch.acquisition.monte_carlo.qNoisyExpectedImprovement'>: 'qNoisyExpectedImprovement'}, <class 'gpytorch.likelihoods.likelihood.Likelihood'>: {<class 'gpytorch.likelihoods.gaussian_likelihood.GaussianLikelihood'>: 'GaussianLikelihood'}, <class 'gpytorch.mlls.marginal_log_likelihood.MarginalLogLikelihood'>: {<class 'gpytorch.mlls.exact_marginal_log_likelihood.ExactMarginalLogLikelihood'>: 'ExactMarginalLogLikelihood', <class 'gpytorch.mlls.leave_one_out_pseudo_likelihood.LeaveOneOutPseudoLikelihood'>: 'LeaveOneOutPseudoLikelihood', <class 'gpytorch.mlls.sum_marginal_log_likelihood.SumMarginalLogLikelihood'>: 'SumMarginalLogLikelihood'}, <class 'botorch.models.model.Model'>: {<class 'botorch.models.gp_regression.FixedNoiseGP'>: 'FixedNoiseGP', <class 'botorch.models.gp_regression_fidelity.FixedNoiseMultiFidelityGP'>: 'FixedNoiseMultiFidelityGP', <class 'botorch.models.multitask.FixedNoiseMultiTaskGP'>: 'FixedNoiseMultiTaskGP', <class 'botorch.models.gp_regression_mixed.MixedSingleTaskGP'>: 'MixedSingleTaskGP', <class 'botorch.models.model_list_gp_regression.ModelListGP'>: 'ModelListGP', <class 'botorch.models.multitask.MultiTaskGP'>: 'MultiTaskGP', <class 'botorch.models.gp_regression.SingleTaskGP'>: 'SingleTaskGP', <class 'botorch.models.gp_regression_fidelity.SingleTaskMultiFidelityGP'>: 'SingleTaskMultiFidelityGP'}, <class 'gpytorch.constraints.constraints.Interval'>: {<class 'gpytorch.constraints.constraints.Interval'>: 'Interval', <class 'gpytorch.priors.torch_priors.GammaPrior'>: 'GammaPrior'}, <class 'gpytorch.priors.torch_priors.GammaPrior'>: {<class 'gpytorch.constraints.constraints.Interval'>: 'Interval', <class 'gpytorch.priors.torch_priors.GammaPrior'>: 'GammaPrior'}}

Reverse registries for decoding.

ax.storage.botorch_modular_registry.GPYTORCH_COMPONENT_REGISTRY: Dict[Type[torch.nn.modules.module.Module], str] = {<class 'gpytorch.constraints.constraints.Interval'>: 'Interval', <class 'gpytorch.priors.torch_priors.GammaPrior'>: 'GammaPrior'}

Overarching mapping from encoded classes to registry map.

ax.storage.botorch_modular_registry.MODEL_REGISTRY: Dict[Type[botorch.models.model.Model], str] = {<class 'botorch.models.gp_regression.FixedNoiseGP'>: 'FixedNoiseGP', <class 'botorch.models.gp_regression_fidelity.FixedNoiseMultiFidelityGP'>: 'FixedNoiseMultiFidelityGP', <class 'botorch.models.multitask.FixedNoiseMultiTaskGP'>: 'FixedNoiseMultiTaskGP', <class 'botorch.models.gp_regression_mixed.MixedSingleTaskGP'>: 'MixedSingleTaskGP', <class 'botorch.models.model_list_gp_regression.ModelListGP'>: 'ModelListGP', <class 'botorch.models.multitask.MultiTaskGP'>: 'MultiTaskGP', <class 'botorch.models.gp_regression.SingleTaskGP'>: 'SingleTaskGP', <class 'botorch.models.gp_regression_fidelity.SingleTaskMultiFidelityGP'>: 'SingleTaskMultiFidelityGP'}

Mapping of Botorch AcquisitionFunction classes to class name strings.

ax.storage.botorch_modular_registry.REVERSE_GPYTORCH_COMPONENT_REGISTRY: Dict[str, Type[torch.nn.modules.module.Module]] = {'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>}

Overarching mapping from encoded classes to reverse registry map.

ax.storage.botorch_modular_registry.register_acquisition(acq_class: Type[ax.models.torch.botorch_modular.acquisition.Acquisition])None[source]

Add a custom acquisition class to the SQA and JSON registries.

ax.storage.botorch_modular_registry.register_acquisition_function(acqf_class: Type[botorch.acquisition.acquisition.AcquisitionFunction])None[source]

Add a custom acquisition class to the SQA and JSON registries.

ax.storage.metric_registry.WARNING_MSG = 'There have been some recent changes to `register_metric`. Please see https://ax.dev/tutorials/gpei_hartmann_developer.html#9.-Save-to-JSON-or-SQL for the most up-to-date information on saving custom metrics.'

Mapping of Metric classes to ints.

All metrics will be stored in the same table in the database. When saving, we look up the metric subclass in METRIC_REGISTRY, and store the corresponding type field in the database.

ax.storage.metric_registry.register_metric(metric_cls: Type[ax.core.metric.Metric], metric_registry: Optional[Dict[Type[ax.core.metric.Metric], int]] = None, encoder_registry: Dict[Type, Callable[[Any], Dict[str, Any]]] = {<class 'ax.core.arm.Arm'>: <function arm_to_dict>, <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.metrics.branin.AugmentedBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>: <function metric_to_dict>, <class 'ax.core.batch_trial.BatchTrial'>: <function batch_to_dict>, <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>: <function botorch_model_to_dict>, <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>: <function metric_to_dict>, <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>: <function runner_to_dict>, <class 'ax.metrics.branin.BraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.ChoiceParameter'>: <function choice_parameter_to_dict>, <class 'ax.core.data.Data'>: <function data_to_dict>, <class 'ax.core.experiment.Experiment'>: <function experiment_to_dict>, <class 'ax.metrics.factorial.FactorialMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.FixedParameter'>: <function fixed_parameter_to_dict>, <class 'gpytorch.priors.torch_priors.GammaPrior'>: <function botorch_component_to_dict>, <class 'ax.modelbridge.generation_node.GenerationStep'>: <function generation_step_to_dict>, <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>: <function generation_strategy_to_dict>, <class 'ax.core.generator_run.GeneratorRun'>: <function generator_run_to_dict>, <class 'ax.metrics.hartmann6.Hartmann6Metric'>: <function metric_to_dict>, <class 'gpytorch.constraints.constraints.Interval'>: <function botorch_component_to_dict>, <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>: <function surrogate_to_dict>, <class 'ax.metrics.l2norm.L2NormMetric'>: <function metric_to_dict>, <class 'ax.core.map_data.MapData'>: <function map_data_to_dict>, <class 'ax.core.map_data.MapKeyInfo'>: <function map_key_info_to_dict>, <class 'ax.core.map_metric.MapMetric'>: <function metric_to_dict>, <class 'ax.core.metric.Metric'>: <function metric_to_dict>, <class 'ax.core.objective.MultiObjective'>: <function multi_objective_to_dict>, <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>: <function multi_objective_optimization_config_to_dict>, <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>: <function multi_type_experiment_to_dict>, <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>: <function percentile_early_stopping_strategy_to_dict>, <class 'ax.metrics.sklearn.SklearnMetric'>: <function metric_to_dict>, <class 'ax.metrics.chemistry.ChemistryMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin.NegativeBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>: <function metric_to_dict>, <class 'ax.core.objective.Objective'>: <function objective_to_dict>, <class 'ax.core.outcome_constraint.ObjectiveThreshold'>: <function outcome_constraint_to_dict>, <class 'ax.core.optimization_config.OptimizationConfig'>: <function optimization_config_to_dict>, <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.core.parameter_constraint.OrderConstraint'>: <function order_parameter_constraint_to_dict>, <class 'ax.core.outcome_constraint.OutcomeConstraint'>: <function outcome_constraint_to_dict>, <class 'ax.core.parameter_constraint.ParameterConstraint'>: <function parameter_constraint_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>: <function pytorch_cnn_torchvision_benchmark_problem_to_dict>, <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>: <function metric_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>: <function runner_to_dict>, <class 'ax.core.parameter.RangeParameter'>: <function range_parameter_to_dict>, <class 'ax.core.objective.ScalarizedObjective'>: <function scalarized_objective_to_dict>, <class 'ax.core.search_space.SearchSpace'>: <function search_space_to_dict>, <class 'ax.core.search_space.HierarchicalSearchSpace'>: <function search_space_to_dict>, <class 'ax.core.parameter_constraint.SumConstraint'>: <function sum_parameter_constraint_to_dict>, <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>: <function surrogate_to_dict>, <class 'ax.runners.synthetic.SyntheticRunner'>: <function runner_to_dict>, <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>: <function threshold_early_stopping_strategy_to_dict>, <class 'ax.core.trial.Trial'>: <function trial_to_dict>, <class 'ax.core.observation.ObservationFeatures'>: <function observation_features_to_dict>, <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>: <function winsorization_config_to_dict>}, decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, val: Optional[int] = None)Tuple[Dict[Type[ax.core.metric.Metric], int], Dict[Type, Callable[[Any], Dict[str, Any]]], Dict[str, Type]][source]

Add a custom metric class to the SQA and JSON registries. For the SQA registry, if no int is specified, use a hash of the class name.

ax.storage.metric_registry.register_metrics(metric_clss: Dict[Type[ax.core.metric.Metric], Optional[int]], metric_registry: Optional[Dict[Type[ax.core.metric.Metric], int]] = None, encoder_registry: Dict[Type, Callable[[Any], Dict[str, Any]]] = {<class 'ax.core.arm.Arm'>: <function arm_to_dict>, <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.metrics.branin.AugmentedBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>: <function metric_to_dict>, <class 'ax.core.batch_trial.BatchTrial'>: <function batch_to_dict>, <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>: <function botorch_model_to_dict>, <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>: <function metric_to_dict>, <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>: <function runner_to_dict>, <class 'ax.metrics.branin.BraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.ChoiceParameter'>: <function choice_parameter_to_dict>, <class 'ax.core.data.Data'>: <function data_to_dict>, <class 'ax.core.experiment.Experiment'>: <function experiment_to_dict>, <class 'ax.metrics.factorial.FactorialMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.FixedParameter'>: <function fixed_parameter_to_dict>, <class 'gpytorch.priors.torch_priors.GammaPrior'>: <function botorch_component_to_dict>, <class 'ax.modelbridge.generation_node.GenerationStep'>: <function generation_step_to_dict>, <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>: <function generation_strategy_to_dict>, <class 'ax.core.generator_run.GeneratorRun'>: <function generator_run_to_dict>, <class 'ax.metrics.hartmann6.Hartmann6Metric'>: <function metric_to_dict>, <class 'gpytorch.constraints.constraints.Interval'>: <function botorch_component_to_dict>, <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>: <function surrogate_to_dict>, <class 'ax.metrics.l2norm.L2NormMetric'>: <function metric_to_dict>, <class 'ax.core.map_data.MapData'>: <function map_data_to_dict>, <class 'ax.core.map_data.MapKeyInfo'>: <function map_key_info_to_dict>, <class 'ax.core.map_metric.MapMetric'>: <function metric_to_dict>, <class 'ax.core.metric.Metric'>: <function metric_to_dict>, <class 'ax.core.objective.MultiObjective'>: <function multi_objective_to_dict>, <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>: <function multi_objective_optimization_config_to_dict>, <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>: <function multi_type_experiment_to_dict>, <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>: <function percentile_early_stopping_strategy_to_dict>, <class 'ax.metrics.sklearn.SklearnMetric'>: <function metric_to_dict>, <class 'ax.metrics.chemistry.ChemistryMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin.NegativeBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>: <function metric_to_dict>, <class 'ax.core.objective.Objective'>: <function objective_to_dict>, <class 'ax.core.outcome_constraint.ObjectiveThreshold'>: <function outcome_constraint_to_dict>, <class 'ax.core.optimization_config.OptimizationConfig'>: <function optimization_config_to_dict>, <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.core.parameter_constraint.OrderConstraint'>: <function order_parameter_constraint_to_dict>, <class 'ax.core.outcome_constraint.OutcomeConstraint'>: <function outcome_constraint_to_dict>, <class 'ax.core.parameter_constraint.ParameterConstraint'>: <function parameter_constraint_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>: <function pytorch_cnn_torchvision_benchmark_problem_to_dict>, <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>: <function metric_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>: <function runner_to_dict>, <class 'ax.core.parameter.RangeParameter'>: <function range_parameter_to_dict>, <class 'ax.core.objective.ScalarizedObjective'>: <function scalarized_objective_to_dict>, <class 'ax.core.search_space.SearchSpace'>: <function search_space_to_dict>, <class 'ax.core.search_space.HierarchicalSearchSpace'>: <function search_space_to_dict>, <class 'ax.core.parameter_constraint.SumConstraint'>: <function sum_parameter_constraint_to_dict>, <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>: <function surrogate_to_dict>, <class 'ax.runners.synthetic.SyntheticRunner'>: <function runner_to_dict>, <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>: <function threshold_early_stopping_strategy_to_dict>, <class 'ax.core.trial.Trial'>: <function trial_to_dict>, <class 'ax.core.observation.ObservationFeatures'>: <function observation_features_to_dict>, <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>: <function winsorization_config_to_dict>}, decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>})Tuple[Dict[Type[ax.core.metric.Metric], int], Dict[Type, Callable[[Any], Dict[str, Any]]], Dict[str, Type]][source]

Add custom metric classes to the SQA and JSON registries. For the SQA registry, if no int is specified, use a hash of the class name.

ax.storage.runner_registry.register_runner(runner_cls: Type[ax.core.runner.Runner], runner_registry: Dict[Type[ax.core.runner.Runner], int] = {<class 'ax.runners.synthetic.SyntheticRunner'>: 0}, encoder_registry: Dict[Type, Callable[[Any], Dict[str, Any]]] = {<class 'ax.core.arm.Arm'>: <function arm_to_dict>, <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.metrics.branin.AugmentedBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>: <function metric_to_dict>, <class 'ax.core.batch_trial.BatchTrial'>: <function batch_to_dict>, <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>: <function botorch_model_to_dict>, <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>: <function metric_to_dict>, <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>: <function runner_to_dict>, <class 'ax.metrics.branin.BraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.ChoiceParameter'>: <function choice_parameter_to_dict>, <class 'ax.core.data.Data'>: <function data_to_dict>, <class 'ax.core.experiment.Experiment'>: <function experiment_to_dict>, <class 'ax.metrics.factorial.FactorialMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.FixedParameter'>: <function fixed_parameter_to_dict>, <class 'gpytorch.priors.torch_priors.GammaPrior'>: <function botorch_component_to_dict>, <class 'ax.modelbridge.generation_node.GenerationStep'>: <function generation_step_to_dict>, <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>: <function generation_strategy_to_dict>, <class 'ax.core.generator_run.GeneratorRun'>: <function generator_run_to_dict>, <class 'ax.metrics.hartmann6.Hartmann6Metric'>: <function metric_to_dict>, <class 'gpytorch.constraints.constraints.Interval'>: <function botorch_component_to_dict>, <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>: <function surrogate_to_dict>, <class 'ax.metrics.l2norm.L2NormMetric'>: <function metric_to_dict>, <class 'ax.core.map_data.MapData'>: <function map_data_to_dict>, <class 'ax.core.map_data.MapKeyInfo'>: <function map_key_info_to_dict>, <class 'ax.core.map_metric.MapMetric'>: <function metric_to_dict>, <class 'ax.core.metric.Metric'>: <function metric_to_dict>, <class 'ax.core.objective.MultiObjective'>: <function multi_objective_to_dict>, <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>: <function multi_objective_optimization_config_to_dict>, <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>: <function multi_type_experiment_to_dict>, <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>: <function percentile_early_stopping_strategy_to_dict>, <class 'ax.metrics.sklearn.SklearnMetric'>: <function metric_to_dict>, <class 'ax.metrics.chemistry.ChemistryMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin.NegativeBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>: <function metric_to_dict>, <class 'ax.core.objective.Objective'>: <function objective_to_dict>, <class 'ax.core.outcome_constraint.ObjectiveThreshold'>: <function outcome_constraint_to_dict>, <class 'ax.core.optimization_config.OptimizationConfig'>: <function optimization_config_to_dict>, <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.core.parameter_constraint.OrderConstraint'>: <function order_parameter_constraint_to_dict>, <class 'ax.core.outcome_constraint.OutcomeConstraint'>: <function outcome_constraint_to_dict>, <class 'ax.core.parameter_constraint.ParameterConstraint'>: <function parameter_constraint_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>: <function pytorch_cnn_torchvision_benchmark_problem_to_dict>, <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>: <function metric_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>: <function runner_to_dict>, <class 'ax.core.parameter.RangeParameter'>: <function range_parameter_to_dict>, <class 'ax.core.objective.ScalarizedObjective'>: <function scalarized_objective_to_dict>, <class 'ax.core.search_space.SearchSpace'>: <function search_space_to_dict>, <class 'ax.core.search_space.HierarchicalSearchSpace'>: <function search_space_to_dict>, <class 'ax.core.parameter_constraint.SumConstraint'>: <function sum_parameter_constraint_to_dict>, <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>: <function surrogate_to_dict>, <class 'ax.runners.synthetic.SyntheticRunner'>: <function runner_to_dict>, <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>: <function threshold_early_stopping_strategy_to_dict>, <class 'ax.core.trial.Trial'>: <function trial_to_dict>, <class 'ax.core.observation.ObservationFeatures'>: <function observation_features_to_dict>, <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>: <function winsorization_config_to_dict>}, decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>}, val: Optional[int] = None)Tuple[Dict[Type[ax.core.runner.Runner], int], Dict[Type, Callable[[Any], Dict[str, Any]]], Dict[str, Type]][source]

Add a custom runner class to the SQA and JSON registries. For the SQA registry, if no int is specified, use a hash of the class name.

ax.storage.runner_registry.register_runners(runner_clss: Dict[Type[ax.core.runner.Runner], Optional[int]], runner_registry: Dict[Type[ax.core.runner.Runner], int] = {<class 'ax.runners.synthetic.SyntheticRunner'>: 0}, encoder_registry: Dict[Type, Callable[[Any], Dict[str, Any]]] = {<class 'ax.core.arm.Arm'>: <function arm_to_dict>, <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.metrics.branin.AugmentedBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>: <function metric_to_dict>, <class 'ax.core.batch_trial.BatchTrial'>: <function batch_to_dict>, <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>: <function botorch_model_to_dict>, <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>: <function metric_to_dict>, <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>: <function runner_to_dict>, <class 'ax.metrics.branin.BraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.ChoiceParameter'>: <function choice_parameter_to_dict>, <class 'ax.core.data.Data'>: <function data_to_dict>, <class 'ax.core.experiment.Experiment'>: <function experiment_to_dict>, <class 'ax.metrics.factorial.FactorialMetric'>: <function metric_to_dict>, <class 'ax.core.parameter.FixedParameter'>: <function fixed_parameter_to_dict>, <class 'gpytorch.priors.torch_priors.GammaPrior'>: <function botorch_component_to_dict>, <class 'ax.modelbridge.generation_node.GenerationStep'>: <function generation_step_to_dict>, <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>: <function generation_strategy_to_dict>, <class 'ax.core.generator_run.GeneratorRun'>: <function generator_run_to_dict>, <class 'ax.metrics.hartmann6.Hartmann6Metric'>: <function metric_to_dict>, <class 'gpytorch.constraints.constraints.Interval'>: <function botorch_component_to_dict>, <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>: <function surrogate_to_dict>, <class 'ax.metrics.l2norm.L2NormMetric'>: <function metric_to_dict>, <class 'ax.core.map_data.MapData'>: <function map_data_to_dict>, <class 'ax.core.map_data.MapKeyInfo'>: <function map_key_info_to_dict>, <class 'ax.core.map_metric.MapMetric'>: <function metric_to_dict>, <class 'ax.core.metric.Metric'>: <function metric_to_dict>, <class 'ax.core.objective.MultiObjective'>: <function multi_objective_to_dict>, <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>: <function multi_objective_optimization_config_to_dict>, <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>: <function multi_type_experiment_to_dict>, <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>: <function percentile_early_stopping_strategy_to_dict>, <class 'ax.metrics.sklearn.SklearnMetric'>: <function metric_to_dict>, <class 'ax.metrics.chemistry.ChemistryMetric'>: <function metric_to_dict>, <class 'ax.metrics.branin.NegativeBraninMetric'>: <function metric_to_dict>, <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>: <function metric_to_dict>, <class 'ax.core.objective.Objective'>: <function objective_to_dict>, <class 'ax.core.outcome_constraint.ObjectiveThreshold'>: <function outcome_constraint_to_dict>, <class 'ax.core.optimization_config.OptimizationConfig'>: <function optimization_config_to_dict>, <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>: <function logical_early_stopping_strategy_to_dict>, <class 'ax.core.parameter_constraint.OrderConstraint'>: <function order_parameter_constraint_to_dict>, <class 'ax.core.outcome_constraint.OutcomeConstraint'>: <function outcome_constraint_to_dict>, <class 'ax.core.parameter_constraint.ParameterConstraint'>: <function parameter_constraint_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>: <function pytorch_cnn_torchvision_benchmark_problem_to_dict>, <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>: <function metric_to_dict>, <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>: <function runner_to_dict>, <class 'ax.core.parameter.RangeParameter'>: <function range_parameter_to_dict>, <class 'ax.core.objective.ScalarizedObjective'>: <function scalarized_objective_to_dict>, <class 'ax.core.search_space.SearchSpace'>: <function search_space_to_dict>, <class 'ax.core.search_space.HierarchicalSearchSpace'>: <function search_space_to_dict>, <class 'ax.core.parameter_constraint.SumConstraint'>: <function sum_parameter_constraint_to_dict>, <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>: <function surrogate_to_dict>, <class 'ax.runners.synthetic.SyntheticRunner'>: <function runner_to_dict>, <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>: <function threshold_early_stopping_strategy_to_dict>, <class 'ax.core.trial.Trial'>: <function trial_to_dict>, <class 'ax.core.observation.ObservationFeatures'>: <function observation_features_to_dict>, <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>: <function winsorization_config_to_dict>}, decoder_registry: Dict[str, Type] = {'AbandonedArm': <class 'ax.core.batch_trial.AbandonedArm'>, 'AggregatedBenchmarkResult': <class 'ax.benchmark.benchmark_result.AggregatedBenchmarkResult'>, 'AndEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.AndEarlyStoppingStrategy'>, 'Arm': <class 'ax.core.arm.Arm'>, 'AugmentedBraninMetric': <class 'ax.metrics.branin.AugmentedBraninMetric'>, 'AugmentedHartmann6Metric': <class 'ax.metrics.hartmann6.AugmentedHartmann6Metric'>, 'BatchTrial': <class 'ax.core.batch_trial.BatchTrial'>, 'BenchmarkMethod': <class 'ax.benchmark.benchmark_method.BenchmarkMethod'>, 'BenchmarkProblem': <class 'ax.benchmark.benchmark_problem.BenchmarkProblem'>, 'BenchmarkResult': <class 'ax.benchmark.benchmark_result.BenchmarkResult'>, 'BoTorchModel': <class 'ax.models.torch.botorch_modular.model.BoTorchModel'>, 'BotorchTestProblemMetric': <class 'ax.metrics.botorch_test_problem.BotorchTestProblemMetric'>, 'BotorchTestProblemRunner': <class 'ax.runners.botorch_test_problem.BotorchTestProblemRunner'>, 'BraninMetric': <class 'ax.metrics.branin.BraninMetric'>, 'BraninTimestampMapMetric': <class 'ax.metrics.branin_map.BraninTimestampMapMetric'>, 'ChemistryMetric': <class 'ax.metrics.chemistry.ChemistryMetric'>, 'ChemistryProblemType': <enum 'ChemistryProblemType'>, 'ChoiceParameter': <class 'ax.core.parameter.ChoiceParameter'>, 'ComparisonOp': <enum 'ComparisonOp'>, 'Data': <class 'ax.core.data.Data'>, 'DataType': <enum 'DataType'>, 'DomainType': <enum 'DomainType'>, 'Experiment': <class 'ax.core.experiment.Experiment'>, 'FactorialMetric': <class 'ax.metrics.factorial.FactorialMetric'>, 'FixedParameter': <class 'ax.core.parameter.FixedParameter'>, 'GammaPrior': <class 'gpytorch.priors.torch_priors.GammaPrior'>, 'GenerationStep': <class 'ax.modelbridge.generation_node.GenerationStep'>, 'GenerationStrategy': <class 'ax.modelbridge.generation_strategy.GenerationStrategy'>, 'GeneratorRun': <class 'ax.core.generator_run.GeneratorRun'>, 'GeneratorRunStruct': <class 'ax.core.batch_trial.GeneratorRunStruct'>, 'Hartmann6Metric': <class 'ax.metrics.hartmann6.Hartmann6Metric'>, 'HierarchicalSearchSpace': <class 'ax.core.search_space.HierarchicalSearchSpace'>, 'Interval': <class 'gpytorch.constraints.constraints.Interval'>, 'L2NormMetric': <class 'ax.metrics.l2norm.L2NormMetric'>, 'ListSurrogate': <class 'ax.models.torch.botorch_modular.list_surrogate.ListSurrogate'>, 'MapData': <class 'ax.core.map_data.MapData'>, 'MapKeyInfo': <class 'ax.core.map_data.MapKeyInfo'>, 'MapMetric': <class 'ax.core.map_metric.MapMetric'>, 'Metric': <class 'ax.core.metric.Metric'>, 'Models': <enum 'Models'>, 'MultiObjective': <class 'ax.core.objective.MultiObjective'>, 'MultiObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.MultiObjectiveBenchmarkProblem'>, 'MultiObjectiveOptimizationConfig': <class 'ax.core.optimization_config.MultiObjectiveOptimizationConfig'>, 'MultiTypeExperiment': <class 'ax.core.multi_type_experiment.MultiTypeExperiment'>, 'NegativeBraninMetric': <class 'ax.metrics.branin.NegativeBraninMetric'>, 'NoisyFunctionMetric': <class 'ax.metrics.noisy_function.NoisyFunctionMetric'>, 'Objective': <class 'ax.core.objective.Objective'>, 'ObjectiveThreshold': <class 'ax.core.outcome_constraint.ObjectiveThreshold'>, 'ObservationFeatures': <class 'ax.core.observation.ObservationFeatures'>, 'OptimizationConfig': <class 'ax.core.optimization_config.OptimizationConfig'>, 'OrEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.logical.OrEarlyStoppingStrategy'>, 'OrderConstraint': <class 'ax.core.parameter_constraint.OrderConstraint'>, 'OutcomeConstraint': <class 'ax.core.outcome_constraint.OutcomeConstraint'>, 'ParameterConstraint': <class 'ax.core.parameter_constraint.ParameterConstraint'>, 'ParameterConstraintType': <enum 'ParameterConstraintType'>, 'ParameterType': <enum 'ParameterType'>, 'PercentileEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.percentile.PercentileEarlyStoppingStrategy'>, 'PyTorchCNNMetric': <class 'ax.benchmark.problems.hpo.pytorch_cnn.PyTorchCNNMetric'>, 'PyTorchCNNTorchvisionBenchmarkProblem': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionBenchmarkProblem'>, 'PyTorchCNNTorchvisionRunner': <class 'ax.benchmark.problems.hpo.torchvision.PyTorchCNNTorchvisionRunner'>, 'RangeParameter': <class 'ax.core.parameter.RangeParameter'>, 'ScalarizedObjective': <class 'ax.core.objective.ScalarizedObjective'>, 'SchedulerOptions': <class 'ax.service.utils.scheduler_options.SchedulerOptions'>, 'ScoredBenchmarkResult': <class 'ax.benchmark.benchmark_result.ScoredBenchmarkResult'>, 'SearchSpace': <class 'ax.core.search_space.SearchSpace'>, 'SingleObjectiveBenchmarkProblem': <class 'ax.benchmark.benchmark_problem.SingleObjectiveBenchmarkProblem'>, 'SklearnDataset': <enum 'SklearnDataset'>, 'SklearnMetric': <class 'ax.metrics.sklearn.SklearnMetric'>, 'SklearnModelType': <enum 'SklearnModelType'>, 'SumConstraint': <class 'ax.core.parameter_constraint.SumConstraint'>, 'Surrogate': <class 'ax.models.torch.botorch_modular.surrogate.Surrogate'>, 'SyntheticRunner': <class 'ax.runners.synthetic.SyntheticRunner'>, 'ThresholdEarlyStoppingStrategy': <class 'ax.early_stopping.strategies.threshold.ThresholdEarlyStoppingStrategy'>, 'Trial': <class 'ax.core.trial.Trial'>, 'TrialStatus': <enum 'TrialStatus'>, 'TrialType': <enum 'TrialType'>, 'WinsorizationConfig': <class 'ax.modelbridge.transforms.winsorize.WinsorizationConfig'>})Tuple[Dict[Type[ax.core.runner.Runner], int], Dict[Type, Callable[[Any], Dict[str, Any]]], Dict[str, Type]][source]

Add custom runner classes to the SQA and JSON registries. For the SQA registry, if no int is specified, use a hash of the class name.

Utilities

class ax.storage.utils.DomainType(value)[source]

Bases: enum.Enum

Class for enumerating domain types.

CHOICE: int = 2
FIXED: int = 0
RANGE: int = 1
class ax.storage.utils.MetricIntent(value)[source]

Bases: enum.Enum

Class for enumerating metric use types.

ADDITIONAL_OBJECTIVE: str = 'additional_objective'
MULTI_OBJECTIVE: str = 'multi_objective'
OBJECTIVE: str = 'objective'
OBJECTIVE_THRESHOLD: str = 'objective_threshold'
OUTCOME_CONSTRAINT: str = 'outcome_constraint'
SCALARIZED_OBJECTIVE: str = 'scalarized_objective'
SCALARIZED_OUTCOME_CONSTRAINT: str = 'scalarized_outcome_constraint'
TRACKING: str = 'tracking'
class ax.storage.utils.ParameterConstraintType(value)[source]

Bases: enum.Enum

Class for enumerating parameter constraint types.

Linear constraint is base type whereas other constraint types are special types of linear constraints.

LINEAR: int = 0
ORDER: int = 1
SUM: int = 2