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

Add road points reducing algorithm #14

Merged
merged 9 commits into from
Jan 6, 2024
Merged

Conversation

aaravpandya
Copy link
Collaborator

This PR aims to do the following:

  1. Reduce the number of sampled road points based on input threshold.
  2. Export the road points vector for easy debugging.

This is not final PR. Some changes maybe made as per preferences -

  1. I have added the speedup script with hardcoded path for dataset. This is because the previous configs style folder has been removed. The script can be moved and/or modified as per the project style.
  2. Adding a flag for initializing graphics to check which road points to use for rendering is pending.

@daphne-cornelisse
Copy link
Collaborator

daphne-cornelisse commented Nov 15, 2023

Hi Aarav,

Thanks for doing this, really excited to try this out!

I have three questions:

  1. Have you tested whether it works correctly? Are there additional tests I can run on this end?
  2. Is there a way to turn the road point reduction algorithm off completely? If there are bugs in it, we don't want it to influence my experiments. If so, can you add documentation/briefly explain it?
  3. It looks like this feature speeds up the simulator speed but does not reduce the observation space. Would it be possible to decrease the size of the observations through this as well? Now the observations probably just contain more zeros. Tagging in @eugenevinitsky

@aaravpandya
Copy link
Collaborator Author

aaravpandya commented Nov 16, 2023

  1. Have you tested whether it works correctly? Are there additional tests I can run on this end?

So I have tested it by running rendering. You can run it from here - https://github.com/facebookresearch/nocturne/blob/main/examples/rendering.py
However, I am going to take another look because I am not convinced that it is entirely correct.

  1. Is there a way to turn the road point reduction algorithm off completely? If there are bugs in it, we don't want it to influence my experiments. If so, can you add documentation/briefly explain it?

Yes. You can set the reducing_threshold in the config to 0. Note the condition in the code to skip a point is using strictly less than (<) operator. Since area can never be < 0, it will include all the points.

  1. It looks like this feature speeds up the simulator speed but does not reduce the observation space. Would it be possible to decrease the size of the observations through this as well? Now the observations probably just contain more zeros. Tagging in @eugenevinitsky

I can take a look at how the observations are formed.

@eugenevinitsky
Copy link

Yeah, this won't change the observation size. We'd need to change the values of num_road_points in the observation config for that. We can pick a good value for that by looking at the renderings of the agent view once we pick a threshold

@daphne-cornelisse
Copy link
Collaborator

@aaravpandya thanks for your answers and please let me know if your second sanity check succeeds. I'll also try it out on the RL end this week.

As for decreasing the observation size, it would be nice to have it in Nocturne, but I'd say it is probably not worth spending more than 3 hours on it given that we're migrating to gpudrive within a couple of weeks. Unless you can re-use the code for gpudrive as well, of course.

@daphne-cornelisse daphne-cornelisse merged commit f759836 into main Jan 6, 2024
1 of 4 checks passed
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.

3 participants