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

Support ScaledLoss #141

Merged
merged 1 commit into from Feb 21, 2020
Merged

Conversation

efernandez
Copy link
Collaborator

@efernandez efernandez commented Feb 13, 2020

This adds supports to ceres::ScaledLoss: https://github.com/ceres-solver/ceres-solver/blob/032d5844c2db412e25f780c6acf95ecc7a0b7975/include/ceres/loss_function.h#L311-L349

This allows to scale the output of a loss function by a scalar factor a.

This is useful if we want to scale the loss function influence of a particular source more than others, or even to workaround the incorrect implementation of the TukeyLoss: https://github.com/ceres-solver/ceres-solver/blob/032d5844c2db412e25f780c6acf95ecc7a0b7975/internal/ceres/loss_function.cc#L118-L132, that should be multiplied by 2 because the cost multiplies the output of the loss function Evaluate method by 0.5, which is Ceres solver convention.

Copy link
Collaborator Author

@efernandez efernandez left a comment

Choose a reason for hiding this comment

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

Added some comments to help with the review.

fuse_core/include/fuse_core/parameter.h Show resolved Hide resolved
fuse_loss/CMakeLists.txt Show resolved Hide resolved
fuse_loss/fuse_plugins.xml Show resolved Hide resolved
fuse_loss/src/scaled_loss.cpp Show resolved Hide resolved
fuse_loss/include/fuse_loss/scaled_loss.h Outdated Show resolved Hide resolved
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.

Just some quick typos to fix

fuse_core/include/fuse_core/parameter.h Outdated Show resolved Hide resolved
fuse_loss/fuse_plugins.xml Outdated Show resolved Hide resolved
fuse_loss/fuse_plugins.xml Outdated Show resolved Hide resolved
fuse_loss/fuse_plugins.xml Outdated Show resolved Hide resolved
fuse_loss/fuse_plugins.xml Outdated Show resolved Hide resolved
fuse_loss/include/fuse_loss/scaled_loss.h Outdated Show resolved Hide resolved
fuse_loss/test/test_scaled_loss.cpp Show resolved Hide resolved
@efernandez
Copy link
Collaborator Author

@svwilliams I just addressed all the typos and the test suggestions. Thanks.

@svwilliams svwilliams merged commit 6243e46 into locusrobotics:devel Feb 21, 2020
@efernandez efernandez deleted the scaled_loss branch March 11, 2020 09:56
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