cuishuhao / BNM

code of Towards Discriminability and Diversity: Batch Nuclear-norm Maximization under Label Insufficient Situations (CVPR2020 oral)
MIT License
265 stars 31 forks source link

Tensor #9

Open mzprose opened 3 years ago

mzprose commented 3 years ago

Hello,if I have a Tensor with size [8,3,512,512], how can I compute BNM?

cuishuhao commented 3 years ago

That depends on the goal of optimization the tensor. If batch_size=8, class_num=3, width=height=512,
you can resize the tensor to [8 512 512, 3], to ensure class_num (3) as a dimension. Then BNM loss can be calculated on the tensor with size of [8 512 512, 3].

mzprose commented 3 years ago

Thank you for answering, I will try, but in this case, there is a question, is the matrix too large, I am afraid it is difficult to execute the program.

cuishuhao commented 3 years ago

Tricks in https://github.com/cuishuhao/BNM/issues/3 might work. We also speed up BNM in recent unpublished work, which might be released in September.

mzprose commented 3 years ago

OK,thanks for your reply!