Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algorithm Improvment proposal on the random shape generation #22

Open
Cerdic opened this issue Jul 15, 2019 · 0 comments
Open

Algorithm Improvment proposal on the random shape generation #22

Cerdic opened this issue Jul 15, 2019 · 0 comments

Comments

@Cerdic
Copy link

Cerdic commented Jul 15, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant