biomedia-mira / masf

Domain Generalization via Model-Agnostic Learning of Semantic Features
Apache License 2.0
146 stars 18 forks source link

How/where are the class-conditional mean *feature* vectors computed? #15

Open chnsh opened 4 years ago

chnsh commented 4 years ago

Hi,

Thank you for releasing the source code of the the paper, it is very helpful.

In the paper, equation 2 mentions that the inputs are forwarded through the feature network, and then a class-wise mean vector is computed which is finally forwarded through the class network.

However, https://github.com/biomedia-mira/masf/blob/master/masf_func.py#L78 shows that the global function is passed the final task logits directly and the mean is computed with respect to the final logits as opposed to the feature vector.

Is this an error in the code or something is incorrect with my understanding? Thanks!

carrenD commented 3 years ago

Hi, thanks for the careful point, class-wise mean vector is a general formulation, we implemented in task logits to make this presentation very high-level, but your point is very interesting, chaning to intermediate features is worth trying!