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

Avoid duplicating initial points when using vectorization #875

Merged
merged 5 commits into from
Sep 20, 2024

Conversation

uri-granta
Copy link
Collaborator

Related issue(s)/PRs:

Summary

Fully backwards compatible: yes / no

PR checklist

  • The quality checks are all passing
  • The bug case / new feature is covered by tests
  • Any new features are well-documented (in docstrings or notebooks)

@@ -802,7 +802,7 @@ def target_function(x: TensorType) -> TensorType: # [N,V,D] -> [N, V]
return tf.concat(individual_func, axis=-1) # vectorize by repeating same function

optimizer = batchify_vectorize(
generate_continuous_optimizer(num_initial_samples=1_000, num_optimization_runs=10),
generate_continuous_optimizer(num_initial_samples=20_000, num_optimization_runs=10),
Copy link
Collaborator Author

@uri-granta uri-granta Sep 19, 2024

Choose a reason for hiding this comment

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

This started failing for Ackley5 (but not the others) following the code change. The code itself is working as intended: beforehand it was generating 1000 initial points and duplicating them 5 times, whereas afterwards it was generating 5000 distinct points. However, the found maximizer was no longer good enough.

Increasing the number of initial points (significantly) fixes things, but there may be a better way.

Copy link
Collaborator

@hstojic hstojic left a comment

Choose a reason for hiding this comment

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

looks good I think

@uri-granta uri-granta marked this pull request as ready for review September 19, 2024 15:08
@uri-granta uri-granta merged commit 7ceb15a into develop Sep 20, 2024
12 checks passed
@uri-granta uri-granta deleted the uri/handle_vectorization_in_initial_samples branch September 20, 2024 08:46
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