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

Visualize loss #144

Merged
merged 3 commits into from
Mar 13, 2020
Merged

Conversation

efernandez
Copy link
Collaborator

This PR shows the impact of a loss function into the constraint cost in the rviz display plugin for the graph.

There are two commits because the first one implements a different visualization approach I explain later. The second commit implements the final approach, that is explained below.

The error line brightness is scaled by the quotient of the constraint cost with and without loss, as it's explained in the code). This way, a dark error line means the cost is reduced significantly by the loss function, which is the expected behaviour when we get outliers, as shown in the screenshot below:

74250011-4e6c4c80-4cea-11ea-87e1-14f6d849bef1

The alternative visualization approach consisted on splitting the error line in two, using the aforementioned quotient to scaled the length of the line that belong to the loss and the rest. In this case, we'd get something like this:

74046263-86178380-49ce-11ea-976e-3e23478ea74b

I used a different width in order to distinguish one segment from the other. They're highlighted in the next image:

74214809-36bba680-4c9f-11ea-8158-6a4c9d417861

I'm open to suggestion and comments regarding the two approaches and whether you think the one I'm going with at the end is better or worse than the previous one (last one explained here). Or maybe I should combine them, but I'm quite happy with the end result for now.

Copy link
Contributor

@svwilliams svwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A tiny quibble about an edge case.
As far as the broader question of how the loss function should be visualized? I'm really not sure. Maybe a "rainbow" mode, so inlier costs are green and move to red as the loss function takes affect? But this seems reasonable enough to me.

If a constraint has a loss function, the cost is computed with and
without loss, and the quotient of the cost with loss by the cost without
loss is used to scale the error line. This is used to draw a "loss"
error line, so we can see the contribution of the loss function to the
constraint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants