-
Notifications
You must be signed in to change notification settings - Fork 56
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
heatmap diffusion convolution confusion #1741
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Alexander Schmidt <[email protected]>
@@ -70,7 +71,7 @@ impl SearchSuggestor { | |||
} | |||
|
|||
pub fn cycle(&mut self, mut context: CycleContext) -> Result<MainOutputs> { | |||
self.update_heatmap(&context); | |||
let _ = self.update_heatmap(&context); |
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.
why do you choose to silently ignore the error?
@@ -107,7 +108,28 @@ impl SearchSuggestor { | |||
} | |||
} | |||
|
|||
self.heatmap.map *= 1.0 - context.search_suggestor_configuration.heatmap_decay_factor; | |||
let kernel: Array2<f32> = 1.0 |
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.
extract kernel creation to new function
self.heatmap.map = | ||
self.heatmap | ||
.map | ||
.conv(&kernel, ConvMode::Same, PaddingMode::Replicate)?; |
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.
are you sure PaddingMode::Zero
isn't more appropriate here?
self.heatmap | ||
.map | ||
.conv(&kernel, ConvMode::Same, PaddingMode::Replicate)?; | ||
self.heatmap.map /= self.heatmap.map.sum() + f32::EPSILON; |
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.
instead of adding f32::EPSILON
, initialize the heatmap with 1.0 / number_of_grid_cells
. Then the heatmap can never sum up to 0.0
[1.0, 1.0, 1.0], | ||
[ | ||
1.0, | ||
context | ||
.search_suggestor_configuration | ||
.heatmap_convolution_kernel_weight, | ||
1.0 | ||
], | ||
[1.0, 1.0, 1.0] |
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 find it much more intuitive to have the kernel be [[a, a, a], [a, 1-a, a], [a, a, a]]
with a in [0, 1]
Why? What?
changes heatmap decay in single cells to diffusion.
Ideas for Next Iterations (Not This PR)
decay based on viewing direction (#1676)
How to Test
Behavior Sim
or let robot play and look at heatmap