-
Notifications
You must be signed in to change notification settings - Fork 13
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
Address sample_sequence_length
greater than min_length_time_axis
#45
base: main
Are you sure you want to change the base?
Address sample_sequence_length
greater than min_length_time_axis
#45
Conversation
I think the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why its necessary to replace min_length
with add_batch_size
. Otherwise it makes sense, please just see my comment on the merge conflict.
c485ecf
to
082261d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just two tests still failing. You forgot to change a line on one, and another one you changed unnecessarily.
flashbax/buffers/flat_buffer_test.py
Outdated
@@ -79,7 +79,7 @@ def test_sample( | |||
fake_batch = get_fake_batch(fake_transition, int(min_length + 10)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fake_batch = get_fake_batch(fake_transition, int(min_length + 10)) | |
fake_batch = get_fake_batch(fake_transition, int(min_length)) |
|
||
for i in range(n_sequences_to_fill): | ||
assert not state.is_full | ||
state = buffer.add(state, fake_batch) | ||
assert state.current_index == ( | ||
((i + 1) * add_sequence_size) % (max_length // add_batch_size) | ||
((i + 1) * add_sequence_size) % (max_length // min_length) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo the changes to this test, test_add_sequences_and_batches
. The problem you found only comes up when add_batch_size
is manually set to something bigger than min_length
, but here it just uses the argument which is fine.
6abfd3d
to
9f3ecec
Compare
9f3ecec
to
7ba5b38
Compare
Based on #43, please review that first and if it wasn't merged yet, please review this PR per commit.
The goal of this PR is to make the tests not generate flashbax warnings and to prevent code from being added that would trigger a flashbax warning.
I am not sure that the suggested changes in the last commit are right.
I am unsure why
min_length_time_axis=min_length // add_batch_size + 1
is used in the trajectory buffer source code, particularly the+ 1
. I am also unsure why themin_length
fixture is defined as:I could understand if it was defined in terms of
add_batch_size
, but it is not.