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

Question about size loss. #44

Open
Sharpiless opened this issue Jul 28, 2022 · 1 comment
Open

Question about size loss. #44

Sharpiless opened this issue Jul 28, 2022 · 1 comment

Comments

@Sharpiless
Copy link

In function loss_size, the "gt_box_sizes" is scaled by point_cloud_dims on the scale of 0 to ∞ while the "pred_box_sizes" is scaled into (0, 1) by sigmoid. F.l1_loss is used to match "gt_box_sizes" and "pred_box_sizes". Is this the right thing to do?

In [1]: pred_box_sizes.max()
Out[1]: tensor(0.8369, device='cuda:0', grad_fn=<MaxBackward1>)

In [2]: gt_box_sizes.max()
Out[2]: tensor(2.5446, device='cuda:0')

In [3]:
@Sharpiless
Copy link
Author

Sharpiless commented Jul 28, 2022

Rewrite:

    def loss_size(self, outputs, targets, assignments):
        gt_box_sizes = targets["gt_box_sizes_normalized"]
        pred_box_sizes = outputs["size_normalized"]
        print("gt_box_sizes(max):", gt_box_sizes.max(), "pred_box_sizes(max):", pred_box_sizes.max())

run:

sh scripts/sunrgbd_quick.sh

get:

gt_box_sizes(max): tensor(2.7780, device='cuda:0') pred_box_sizes(max): tensor(0.8626, device='cuda:0', grad_fn=<MaxBackwa
rd1>)                                                        
gt_box_sizes(max): tensor(2.7780, device='cuda:0') pred_box_sizes(max): tensor(0.8083, device='cuda:0', grad_fn=<MaxBackwa
rd1>)        
gt_box_sizes(max): tensor(2.7780, device='cuda:0') pred_box_sizes(max): tensor(0.8018, device='cuda:0', grad_fn=<MaxBackwa
rd1>)                                                                                                                     
gt_box_sizes(max): tensor(2.7780, device='cuda:0') pred_box_sizes(max): tensor(0.7761, device='cuda:0', grad_fn=<MaxBackwa
rd1>)                                                        
gt_box_sizes(max): tensor(2.7780, device='cuda:0') pred_box_sizes(max): tensor(0.8450, device='cuda:0', grad_fn=<MaxBackwa
rd1>)                                                        
gt_box_sizes(max): tensor(2.7780, device='cuda:0') pred_box_sizes(max): tensor(0.8318, device='cuda:0', grad_fn=<MaxBackwa
rd1>)                                                                                                                     
gt_box_sizes(max): tensor(0.9309, device='cuda:0') pred_box_sizes(max): tensor(0.8833, device='cuda:0', grad_fn=<MaxBackwa
rd1>)                                                        
gt_box_sizes(max): tensor(0.9309, device='cuda:0') pred_box_sizes(max): tensor(0.8971, device='cuda:0', grad_fn=<MaxBackwa
rd1>)                                                        
gt_box_sizes(max): tensor(0.9309, device='cuda:0') pred_box_sizes(max): tensor(0.8606, device='cuda:0', grad_fn=<MaxBackwa
rd1>)                                                        
gt_box_sizes(max): tensor(0.9309, device='cuda:0') pred_box_sizes(max): tensor(0.8204, device='cuda:0', grad_fn=<MaxBackwa
rd1>)

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

No branches or pull requests

1 participant