As a matter of fact, it is quite visible that whereas the first steps are producing large shapes to fill the larger gap between the target image and the initial one, the mean size of the found shapes is mainly decreasing.
Then I found that generating constant size shapes was a loss of computation energy:
- generating small shapes needs a lot of mutation at the start to reach an optimal size,
- generating large shapes implies more and more of wasted effort on error computation of error on random shamoes during random phase
Then you have to find a compromise and between the start of processus and the late phase.
So I tried to introduce a sizeFactor in shapes:
- in the constructor it is used to adapt the scale of the random size ot shapes relatively to the bounds
- a
getSizeFactor() method is added to shapes classes to give a feedback on the approximative sizes factor of the found shapes
Cerdic/geometrize-php@f9384ca
Then the Model get an internal shapeSizeFactor with an initial value set to 1.0 and that is updated at each call of addShape with a low-pass filter
This shapeSizeFactor is then used to init random shapes in the interesting size range:
Cerdic/geometrize-php@1a276c8
This is really improving the convergence process by a much better random shape generation, and avoiding random large shapes that have a big computation cost, when not any more useful
As a matter of fact, it is quite visible that whereas the first steps are producing large shapes to fill the larger gap between the target image and the initial one, the mean size of the found shapes is mainly decreasing.
Then I found that generating constant size shapes was a loss of computation energy:
Then you have to find a compromise and between the start of processus and the late phase.
So I tried to introduce a sizeFactor in shapes:
getSizeFactor()method is added to shapes classes to give a feedback on the approximative sizes factor of the found shapesCerdic/geometrize-php@f9384ca
Then the Model get an internal
shapeSizeFactorwith an initial value set to1.0and that is updated at each call of addShape with a low-pass filterThis
shapeSizeFactoris then used to init random shapes in the interesting size range:Cerdic/geometrize-php@1a276c8
This is really improving the convergence process by a much better random shape generation, and avoiding random large shapes that have a big computation cost, when not any more useful