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

(Ongoing) OnlookerBee's new positions are not limited by minimum or maximum values #32

Closed
tjkessler opened this issue Dec 14, 2018 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@tjkessler
Copy link
Member

The calculate_positions() method of the OnlookerBee class does not adhere to the minimum and maximum values specified during ABC initialization:

    def calculate_positions(self, first_bee, second_bee, value_types):
        '''
        Calculate the positions when merging two bees
        '''
        new_values = first_bee.values
        index = randint(0, len(first_bee.values)-1)
        # Here
        value = first_bee.values[index] + abs(np.random.uniform(-1, 1) \
                * (first_bee.values[index] - second_bee.values[index]))
        if value_types[index] == 'int':
            value = int(value)
        new_values[index] = value
        return new_values

For example, I have experience a variable (dropout_rate) being set to 1.47 when my value argument is:

('float', (0.0, 1.0))
@tjkessler tjkessler added the bug Something isn't working label Dec 14, 2018
@hgromer
Copy link
Member

hgromer commented Dec 14, 2018

This has been fixed by added limits to the what the new value can be. This seems like a more fundamental issue that I'd like to look into more. We are using the formula found on Wikipedia to merge the two bees.

@hgromer hgromer pinned this issue Dec 14, 2018
@hgromer hgromer self-assigned this Dec 14, 2018
@hgromer hgromer changed the title OnlookerBee's new positions are not limited by minimum or maximum values **Ongoing** OnlookerBee's new positions are not limited by minimum or maximum values Dec 15, 2018
@hgromer hgromer changed the title **Ongoing** OnlookerBee's new positions are not limited by minimum or maximum values (Ongoing) OnlookerBee's new positions are not limited by minimum or maximum values Dec 15, 2018
@hgromer hgromer closed this as completed May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants