fungtion / DANN

pytorch implementation of Domain-Adversarial Training of Neural Networks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Number of classes of domain classifier

ilteralp opened this issue · comments

Hi all, I have a question. Why does the output layer of domain classifier have 2 output features (this line) ? Since the domain labels are either 0 or 1 in the paper, I think it should be a binary classifier as below,

self.domain_classifier.add_module('d_fc2', nn.Linear(100, 1))

Agree. But weirdly I saw this also in many other implementations.

The target label is a binary one-hot vector, so there are two outputs, and finally through softmax?

@ilteralp Yes, you can set the number as 1, I used 2 outputs for multiple domains purpose