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

Addressing redundent feval with SA and RHC #27

Closed

Conversation

Airick73
Copy link

Whenever set_state() is called there is an additional function evaluation called but the fitness value would have already been known in the main optimization loop when check if the new state should be accept

@knakamura13 knakamura13 self-requested a review January 22, 2025 02:00
Copy link
Owner

@knakamura13 knakamura13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rejecting because 113 test cases are failing due to missing positional argument 'fitness'.

@@ -230,19 +230,21 @@ def evaluate_population_fitness(self) -> None:
"""Evaluate the fitness of the current population."""
self.pop_fitness = np.array([self.eval_fitness(indiv) for indiv in self.population])

def set_state(self, new_state: np.ndarray) -> None:
def set_state(self, new_state: np.ndarray, fitness: float) -> None:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new parameter was added without updating the test cases that cover .set_state().

@knakamura13
Copy link
Owner

knakamura13 commented Jan 22, 2025

Closing PR permanently.

I implemented the same improvements on a separate branch, except with fixes for the bugs, and found that there is statistically zero performance difference between the new and old code.

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

Successfully merging this pull request may close these issues.

2 participants