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

GA: _calc_fitness_function() can return very large values which cause Overflow #597

Closed
Gabriel-p opened this issue Apr 30, 2020 · 2 comments
Assignees
Labels
Bug Tasks related to found bugs

Comments

@Gabriel-p
Copy link

I'm getting fitness values over 10000 for example, which cause the _select() function to overflow here:

        fitness[_idx] = math.exp(1 + fitness[_idx] * select_coeff)

Perhaps clip the fitness array before exponentiating?

fitness = np.clip(fitness, a_min=None, a_max=100)
@annoviko annoviko added the Bug Tasks related to found bugs label Apr 30, 2020
@annoviko
Copy link
Owner

Hi, @Gabriel-p

Thank you for the reporting, the correction for the problem will be introduced.

@annoviko annoviko self-assigned this Aug 17, 2020
annoviko added a commit that referenced this issue Oct 28, 2020
@annoviko
Copy link
Owner

As I understand, the cause of the problem is non-normalized data. I would suggest to normalize data between [0, 1] to perform cluster analysis using genetic algorithm, for example, using the same approach as you suggested for the fitness function.

Nevertheless, I have added human-readable error that explains how to resolve the issue.

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

No branches or pull requests

2 participants