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

ngen.cal performs 1 more iterations than it should #174

Open
aaraney opened this issue Aug 22, 2024 · 1 comment
Open

ngen.cal performs 1 more iterations than it should #174

aaraney opened this issue Aug 22, 2024 · 1 comment
Assignees
Labels
bug Something isn't working ngen.cal Related to ngen.cal package

Comments

@aaraney
Copy link
Member

aaraney commented Aug 22, 2024

for i in range(start_iteration, iterations+1):

for i in range(start_iteration, iterations+1):

I believe should be:

    for i in range(start_iteration, iterations):

Issue found by @ajkhattak (thanks 🎉)

@aaraney aaraney added bug Something isn't working ngen.cal Related to ngen.cal package labels Aug 22, 2024
@hellkite500
Copy link
Member

If asked to run 100 iterations, iteration 0 is established as an initial evaluation iteration and start_iteration becomes 1. If we want to actually run 100 parameter permutations, then we need a range of 1..100, and since python range is non-inclusive on the end of the range, we use +1 to ensure that we get range(1, 101) which gives 100 parameter permutations.

I don't consider this a bug, but it depends on the expected semantics. The code was originally written based on the semantics I described.

@hellkite500 hellkite500 changed the title ngen.cal performs n+1 more iterations than it should ngen.cal performs 1 more iterations than it should Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ngen.cal Related to ngen.cal package
Projects
None yet
Development

No branches or pull requests

2 participants