B-cos / B-cos-v2

Official PyTorch implementation of improved B-cos models
Apache License 2.0
39 stars 5 forks source link

TABLE 1: the classification accuracy of B-cos models with MaxOut and increasing values for B on CIFAR-10. #8

Open April-lx opened 3 months ago

April-lx commented 3 months ago

Hi all,

Thank you for the great contribution. In B-cos Alignment for Inherently Interpretable CNNs and Vision Transformers, TABLE 1 shows the classification accuracy of B-cos models with MaxOut and increasing values for B on CIFAR-10.

We are committed to reproducing these results. Except for the result of B=1.0, our reproduced result is close to the original. But when B=1.0, the results are puzzling and far from the original text.

We have repeatedly considered this problem. It is mentioned in the original text "... for B=1, the B-cos transformation is equivalent to a linear transformation..."

So, I would like to know how a linear transformation can yield the result of B=1 in TABLE 1, or if there are certain settings in the code that need to be modified when B=1.

Best, Xue Li

nps1ngh commented 3 months ago

Hi,

Thanks for your interest in our work!

Could you please ensure if MaxOut is being used in your models? In v2, the default for BcosConv2d is to not use MaxOut, unlike in v1 where it's set to 2.

There is another difference with the layerwise scaling from v1 (that table is from v1).

Hence, for reproducing that one table, I highly recommend you to use the v1 codebase (https://github.com/moboehle/B-cos), to avoid such differences, and also because the numbers were from that codebase.

Let me know if you have more questions! :)

Best, Navdeep