jina.optimizers.parameters

class jina.optimizers.parameters.OptimizationParameter(parameter_name='', executor_name=None, prefix='JINA', jaml_variable=None)[source]

Bases: jina.jaml.JAMLCompatible

Base class for all optimization parameters.

class jina.optimizers.parameters.IntegerParameter(low, high, step_size=1, log=False, *args, **kwargs)[source]

Bases: jina.optimizers.parameters.OptimizationParameter

Used for optimizing integer parameters with the FlowOptimizer. For detailed information about sampling and usage see https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.Trial.html#optuna.trial.Trial.suggest_int

class jina.optimizers.parameters.UniformParameter(low, high, *args, **kwargs)[source]

Bases: jina.optimizers.parameters.OptimizationParameter

Used for optimizing float parameters with the FlowOptimizer with uniform sampling. For detailed information about sampling and usage see https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.Trial.html#optuna.trial.Trial.suggest_discrete_uniform

class jina.optimizers.parameters.LogUniformParameter(low, high, *args, **kwargs)[source]

Bases: jina.optimizers.parameters.OptimizationParameter

Used for optimizing float parameters with the FlowOptimizer with loguniform sampling. For detailed information about sampling and usage see https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.Trial.html#optuna.trial.Trial.suggest_loguniform

class jina.optimizers.parameters.CategoricalParameter(choices, *args, **kwargs)[source]

Bases: jina.optimizers.parameters.OptimizationParameter

Used for optimizing categorical parameters with the FlowOptimizer. For detailed information about sampling and usage see https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.Trial.html#optuna.trial.Trial.suggest_categorical

class jina.optimizers.parameters.DiscreteUniformParameter(low, high, q, *args, **kwargs)[source]

Bases: jina.optimizers.parameters.OptimizationParameter

Used for optimizing discrete parameters with the FlowOptimizer with uniform sampling. For detailed information about sampling and usage it is used by Jina with optuna see https://optuna.readthedocs.io/en/stable/reference/generated/optuna.trial.Trial.html#optuna.trial.Trial.suggest_discrete_uniform

jina.optimizers.parameters.load_optimization_parameters(filepath)[source]

Loads optimization parameters from a .yml file and parses it with the JAML parser. :type filepath: str :param filepath: Path to a file that contains optimization parameters. :return:: The loaded OptimizationParameter objects.