cms-patatrack / The-Optimizer

Mozilla Public License 2.0
3 stars 4 forks source link

Number of objectives vs Number of values returned by and objective function #12

Closed waredjeb closed 3 months ago

waredjeb commented 11 months ago

In the current implementation there's some inconsistency in dealing with the number of objectives functions. In principle an objective function could return multiple values (an example is the CA autotuning or, more in general, I would say any CMSSW workflows we would like to optimize) . The number of objectives function is not only used to evaluate each objective function, as in the example below

https://github.com/cms-patatrack/The-Optimizer/blob/main/optimizer/objective.py#L12-L13

But is also used to set the fitness shape for each particle: https://github.com/cms-patatrack/The-Optimizer/blob/main/optimizer/mopso.py#L50-L51

It becomes tricky to define an objective function in this way. We would need a way to disentangle the Number of Objectives and the Number of Values returned by the Objectives function

rsreds commented 7 months ago

Working solution in 64ea31bec66235b6c22aa058680fe82d660ae243