paraqeet.optimizers.optimizer.Optimizer#

class paraqeet.optimizers.optimizer.Optimizer(measure, optimization_map, logger=None)[source]#

Bases: ABC

Base class for all classes that implement an optimization algorithm.

The class accepts a list of optimizable parameters from the lower layers which shall be optimized in order to minimize the given measure.

Parameters:
  • measure (Measurement) – Implementation of the Measurement class that measures the observable to be minimized.

  • optimizables (OptimizationMap) – An optimization map containing all parameters that can be optimized. If none, an empty map will be created to which the parameters can be added later used.

  • logger (FileLogger) – The file logger object.

  • optimization_map (OptimizationMap)

__init__(measure, optimization_map, logger=None)[source]#
Parameters:

Methods

__init__(measure, optimization_map[, logger])

optimize(times)

Perform the actual optimization.

Attributes

logger

Returns the current logger that is being used by this optimizer, or None if no logger was set yet.

optimization_map

Return the optimization map that this optimizer uses.

property logger: Logger | None#

Returns the current logger that is being used by this optimizer, or None if no logger was set yet.

property optimization_map: OptimizationMap#

Return the optimization map that this optimizer uses.

Parameters that can be optimized need to be added to this map.

Returns:

Returns the optimization map that this optimizer uses.

Return type:

paraqeet.optimization_map

abstract optimize(times)[source]#

Perform the actual optimization.

Depending on the implementation, this function might take a long time and might need several calls to the underlying layers. The returned object contains some information about the result. The result will include the raw result of the underlying algorithm for more information.

Returns:

Result of optimization via the OptimizationResult object. (status, value, iterations and the raw result)

Return type:

OptimizationResult

Parameters:

times (Array | float)