CMA-ES / moarchiving

A bi-objective nondominated archive class
Other
2 stars 3 forks source link

Computational cost of the Fraction module #2

Open nikohansen opened 4 years ago

nikohansen commented 4 years ago

moarchiving uses the Fraction type to avoid rounding errors when computing HV differences. When used to build an archive with more and more dense points, the Fraction module will become more and more computational expensive, quite likely proportional to the archive size or to the iteration count.

Timing of repeated computation of a = (a + b) / 2 with Fraction and with float:

Screen Shot 2020-05-04 at 13 14 01

The "fix" to prevent using Fraction

import moarchiving
moarchiving.BiobjectiveNondominatedSortedList.hypervolume_final_float_type = float
moarchiving.BiobjectiveNondominatedSortedList.hypervolume_computation_float_type = float

will reduce the computational demand problem but also turn off arbitrary precision.