Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible Replay bug

See original GitHub issue

Hi all,

I’m working on implementing Class-Balanced and Experience-balanced Replay (See #479). I want to provide the opportunity for the user to select a fixed capacity prior or adaptive to all seen experiences so far.

However, when looking at the Replay code I find it hard to follow:

single_task_mem_size = min(self.mem_size, len(curr_data))
h = single_task_mem_size // (strategy.training_exp_counter + 1)

remaining_example = single_task_mem_size % (
    strategy.training_exp_counter + 1)
# We recover it using the random_split method and getting rid of the
# second split.
rm_add, _ = random_split(
    curr_data, [h, len(curr_data) - h]

In the first line: What if len(curr_data) is smaller than self.mem_size? It would occur to me that ‘h’ is not correct anymore. Even though the current data length len(curr_data) may not equal the full memory size, it can still have capacity for a mem_size/n_observed_exps portion of the memory. So h should become self.mem_size // (strategy.training_exp_counter + 1)?

When taking the random_split however, then we should take the ‘min’ operation into account:

 h2 = min(capacity_per_exp, len(curr_data))
  rm_add, _ = random_split(
      curr_data, [h2, len(curr_data) - h2]

Am I missing something here or is this a bug?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (3 by maintainers)

github_iconTop GitHub Comments

AntonioCartacommented, Apr 20, 2021

A single PR is ok.

lrzpellegrinicommented, Apr 22, 2021

Thank you @Mattdl, I’ll try this immediately!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create bug reports that developers love to receive. Provide detailed feedback to your team. Make your customer support experience as seamless as possible....
Read more >
Using Replay to fix my first Replay bug | by Cecelia Martinez
These are the steps I used to debug the issue, which can serve as a good framework for approaching many types of bugs....
Read more >
Possible Replay bug - Project CARS 2 - Steam Community
IT's not the replay it's live in race graphic bug that shows smoke where there shouldn't be any. In online race you won't...
Read more >
Recording Bug Reports - Docs -
When you record a bug with Replay you're capturing the browser tab so it can be replayed later. ... We recommend keeping the...
Read more >
Possible replay button bug, play button not working.
Possible replay button bug, play button not working. ... After a game I am unable to get the play button to play through...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found