BEVDepth icon indicating copy to clipboard operation
BEVDepth copied to clipboard

Some questions about code matrixvt.py

Open wuwangzhuanwan opened this issue 2 years ago • 6 comments

On line 280 and 282 of bevdepth/layers/backbones/matrixvt.py, ray_map[b, dir, geom_idx[b, dir]] += 1 and circle_map[b, d, geom_idx[b, :, d]] += 1 , they are equivalent ray_map[b, dir, geom_idx[b, dir]] = 1 and circle_map[b, d, geom_idx[b, :, d]] = 1,right?I don't think it's necessary to add a plus sign

wuwangzhuanwan avatar Feb 06 '23 11:02 wuwangzhuanwan

This is a incremental imrpovement that brought about 0.2 mAP, we found that a soft maxtrix is a little bit better than a binary one.

ZRandomize avatar Feb 14 '23 02:02 ZRandomize

Hello, I have the same confusion. I found they are equivalent. Have you ever checked the result of ray_map[b, dir, geom_idx[b, dir]] += 1 and circle_map[b, d, geom_idx[b, :, d]] += 1?

ZhouZijie77 avatar Feb 21 '23 09:02 ZhouZijie77

They are not equivalent since geom_idx may contains serveral same indexes

ZRandomize avatar Feb 26 '23 07:02 ZRandomize

Thank you for your reply! But I still have some questions. I found that the maximum values of ray_map and circle_map are 1. Then I did a simple test:

a = torch.tensor([0, 1, 1, 3, 3, 3], dtype=torch.long)
b = torch.zeros(5)
b[a]+=1
print(b)

The result is tensor([1., 1., 0., 1., 0.]) instead of tensor([1., 2., 0., 3., 0.])

ZhouZijie77 avatar Feb 28 '23 09:02 ZhouZijie77

Well, this is not expected for me. In that case, the observed improvement might be only fluatuation. But this proved that a binary matrix will work well as stated in the paper :)

ZRandomize avatar Mar 03 '23 02:03 ZRandomize

Thank you

ZhouZijie77 avatar Mar 03 '23 02:03 ZhouZijie77