M APPING CONDITIONAL DISTRIBUTIONS FOR DOMAIN ADAPTATION UNDER GENERALIZED TARGET SHIFT
Anonymous authors
Paper under double-blind review
A BSTRACT
We consider the problem of unsupervised domain adaptation (UDA) between a source and a target domain under conditional and label shift a.k.a Generalized
Target Shift ( GeTarS ).
Unlike simpler UDA settings, few works have addressed this challenging problem.
Recent approaches learn domain-invariant representations, yet they have practical limitations and rely on strong assumptions that may not hold in practice.
In this paper, we explore a novel and general approach to align pretrained representations, which circumvents existing drawbacks.
Instead of constraining representation invariance, it learns an optimal transport map, implemented as a NN, which maps source representations onto target ones.
Our approach is ﬂexible and scalable, it preserves the problem’s structure and it has strong theoretical guarantees under mild assumptions.
In particular, our solution is unique, matches conditional distributions across domains, recovers target proportions and explicitly controls the target generalization risk.
Through an exhaustive comparison on several datasets, we challenge the state-of-the-art in GeTarS .
I NTRODUCTION
Unsupervised Domain Adaptation (UDA) methods (Pan & Yang, 2010) train a classiﬁer with labelled samples from a source domain S such that its risk on an unlabelled target domain T is low.
This problem is ill-posed and simplifying assumptions have been considered.
Initial contributions focused on two settings which decompose differently the joint distribution over X × Y : covariate shift ( CoS ), when input marginals differ across domains while class-posteriors are unchanged i.e. p S
( Y | X ) =
p T ( Y | X ) , p S ( X ) (cid:54) =
p T ( X ) and target shift ( TarS ) when label distributions differ while conditionals are unchanged i.e. p S ( Y ) (cid:54) =
p T ( Y ) , p S ( X | Y ) =
p T ( X | Y ) .
These restrictive assumptions were recently extended into model shift i.e. p S
( Y | X ) (cid:54) = p T ( Y | X ) , p S ( X ) (cid:54) =
p T ( X ) (Wang & Schneider, 2014; 2015) and generalized target shift ( GeTarS ) i.e. p S ( X | Y ) (cid:54) = p T ( X | Y ) , p S ( Y ) (cid:54) = p T ( Y ) , which are more realistic in real-world applications.
Our work addresses GeTarS for which a key challenge is to learn how to map the source domain onto the target one to minimize both conditional and label shifts, without using target labels.
The current state-of-the-art in Gong et al. (2016); Combes et al.
; Rakotomamonjy et al.
Shui et al.
(2021) learns domain-invariant representations and uses, as importance weights in the training objectives, the estimated class-ratios between domains.
However, this approach has several limitations.
First, to transfer representations, the domain-invariance constraint breaks the original problem structure and it was shown that this may degrade the discriminativity of target representations (Liu et al., 2019). Some approaches proposed to better enforce target discriminativity when learning invariant representations e.g. Xiao et al. ; Li et al. ; Chen et al.
, yet they were not applied to the GeTarS setting.
Second, generalization guarantees are derived under strong assumptions, detailed in Section 2.3, which may not hold in practice.
In this paper, we address these limitations with a new general approach, named Optimal Sample Transformation and Reweight ( OSTAR ), which maps pretrained representations using Optimal
Transport (OT).
OSTAR proposes an alternative to constraining representation invariance and performs jointly three operations: given a pretrained encoder, (i) it learns an OT map, implemented as a neural network (NN), between encoded source and target conditionals, (ii) it estimates target proportions for sample reweighting and (iii) it learns a classiﬁer for the target domain using source labels.
OSTAR has several beneﬁts: (i) it is ﬂexible, scalable and preserves target discriminativity and (ii) it provides strong theoretical guarantees under mild assumptions.
In summary, our contributions are:
• We propose an approach, OSTAR , to align pretrained representations under GeTarS .
Without constraining representation-invariance, OSTAR jointly learns a classiﬁer for inference on the target domain and an OT map, which maps representations of source conditionals to those of target ones under class-reweighting.
OSTAR preserves target discriminativity and experimentally challenges the state-of-the-art for GeTarS .
• OSTAR implements its OT map as a NN shared across classes.
Our approach is thus ﬂexible and has native regularization biases for stability.
Moreover it is scalable and generalizes beyond training samples unlike standard linear programming based OT approaches.
• OSTAR has strong theoretical guarantees under mild assumptions: its solution is unique, recovers target proportions and correctly matches source and target conditionals at the optimum.
It also explicitly controls the target risk with a new Wasserstein-based bound.
Our paper is organized as follows.
In Section 2, we deﬁne our problem, approach and assumptions.
In Section 3, we derive theoretical results.
In Section 4, we describe our implementation.
We report in Section 5 experimental results and ablation studies.
In Section 6, we present related work.
P ROPOSED APPROACH
In this section, we successively deﬁne our problem, present our method, OSTAR and its main ideas and introduce our assumptions, used to provide theoretical guarantees for our method.
2. P ROBLEM DEFINITION
Denoting X the input space and Y = { 1 , . .
, K } the label space, we consider UDA between a source S =
( X S , Y S , p S ( X, Y )) with labelled samples (cid:98) S
= { ( x ( i ) S , y ( i ) S ) }
ni =1 ∈ ( X S × Y S ) n and a target T =
( X T , Y T , p T ( X, Y )) with unlabelled samples (cid:98) T
= { x ( i ) T } mi =1 ∈ X mT .
We denote
Z ⊂ R d a latent space and g : X → Z an encoder from X to Z .
Z S and Z T are the encoded source and target input domains, Z (cid:98) S and Z (cid:98) T the corresponding training sets and Z a random variable in this space.
The latent marginal probability induced by g on D ∈ { S, T } is deﬁned as ∀ A ⊂
Z , p gD ( A ) (cid:44) g # ( p D ( A )) 1 .
For convenience, p YD ∈ R K denotes the label marginal p D ( Y ) and p D ( Z ) (cid:44) p gD ( Z ) .
In all generality, conditional distributions in this latent space and label marginals differ across domains; this is the GeTarS assumption (Deﬁnition 1) illustrated in Figure 1a.
This assumption, made in feature space Z rather than input space X , states that latent representations for both domains from a given class are different with different label proportions.
Operating in the latent space has several practical advantages such as improved discriminativity and dimension reduction.
Deﬁnition 1 ( GeTarS ) .
GeTarS is characterized by conditional mismatch across domains i.e.
∃ j ∈ { 1 , . . .
, K } , p S ( Z
| Y =
j ) (cid:54) =
p T ( Z | Y = j ) and label shift i.e. p YS (cid:54) =
p YT .
Our goal is to learn a classiﬁer in Z with low target risk, using source labels.
This is challenging as (i) target labels are unknown and (ii) there are two shifts to handle.
We will show that this can be achieved with pretrained representations if we recover two key properties: (i) a map which matches source and target conditional distributions and (ii) target proportions to reweight samples by classratios and thus account for label shift.
Our approach, OSTAR , achieves this objective.
2. M APPING CONDITIONAL DISTRIBUTIONS UNDER LABEL SHIFT
We now present the components in OSTAR , their objective and the various training steps.
Components The main components of OSTAR , illustrated in Figure 1b, are detailed below.
These components are learned and estimated using the algorithm detailed in Section 4.
They include:
• a ﬁxed encoder g : X → Z , deﬁned in Section 2.
• a mapping φ : Z → Z , acting on source samples encoded by g .
• a label proportion vector p YN on the simplex ∆ K .
• a classiﬁer f N : Z → { 1 , . .
, K } for the target domain in a hypothesis class H over Z
[Figure]
and p YN should estimate p Y T Objective g encodes source and target samples in a latent space such that it preserves rich information about the target task and such that the risk on the source domain is small.
g is ﬁxed throughout training to preserve target discriminativity.
φ should map encoded source conditionals in Z S onto corresponding encoded target ones in Z T to account for conditional shift; Z N denotes the mapped space.
p YN should estimate the target proportions p YT to account for label shift.
Components ( φ, p YN ) deﬁne a new labelled domain in latent space N =
( Z N , Y N , p N ( Z, Y )) through a Sample Transformation And Reweight operation of the encoded S domain, as illustrated in Figure 1b.
Indeed, the pushforward by φ of encoded source conditionals deﬁnes conditionals in domain N , p φN ( Z | Y ) :
[Equation]
Then, p YN weights each conditional in N .
This yields a marginal distribution in N , p φN ( Z ) :
[Equation]
Finally, classiﬁer f N is trained on labelled samples from domain N .
This is possible as each sample in N is a projection of a labelled sample from S .
f N can then be used for inference on T .
We will show that it has low target risk when components φ and p YN achieve their objectives detailed above.
Training We train OSTAR ’s components in two stages.
First, we train g along a source classiﬁer f S from scratch by minimizing source classiﬁcation loss; alternatively, g can be tailored to speciﬁc problems with pretraining.
Second, we jointly learn ( f N , φ, p YN ) to minimize a classiﬁcation loss in domain N and to match target conditionals and proportions with those in domain N .
As target conditionals and proportions are unknown, we propose a proxy problem for ( φ, p YN ) to match instead latent marginals p T ( Z ) and p φN ( Z ) (1).
We solve this proxy problem under least action principle measured by a Monge transport cost (Santambrogio, 2015), denoted C ( φ ) , as in problem (OT):
[Equation]
OT
[Equation]
For any function φ e.g. parametrized by a NN, C ( φ ) is the transport cost of encoded source conditionals by φ .
It uses a cost function, c ( x , y )
= (cid:107) x − y (cid:107) p 2 , where without loss of generality p = 2 .
The optimal C ( φ ) is the sum of Wasserstein-2 distances between source conditionals and their mappings. Problem (OT) seeks to minimize C ( φ ) under marginal matching. We provide some further background on optimal transport in Appendix C and discuss there the differences between our OT problem (OT) and the standard Monge OT problem between p S ( Z ) and p T ( Z ) .
Our OT formulation is key to the approach.
First, it is at the basis of our theoretical analysis.
Under
Assumption 2 later deﬁned, the optimal transport cost is the sum of the Wasserstein-2 distance between source and matched target conditionals.
We can then provide conditions on these distances in
Assumption 3 to formally deﬁne when the solution to problem (OT) correctly matches conditionals.
Second, it allows us to learn the OT map with a NN.
This NN approach: (i) generalizes beyond training samples and scales up with the number of samples unlike linear programming based OT approaches (Courty et al., 2017b) and (ii) introduces useful stability biases which make learning less prone to numerical instabilities as highlighted in de B´ezenac et al.
; Karkar et al.
2. A SSUMPTIONS
In Section 3 we will introduce the theoretical properties of our method which offers several guarantees.
As always, this requires some assumptions which are introduced below.
We discuss their relations with assumptions used in related work and detail why they are less restrictive.
We provide some additional discussion on their motivation and validity in Appendix D.
Assumption 1 (Cluster Assumption on S) .
∀ k, p Y =
k S >
and there is a partition of the source domain Z S such that Z S
=
∪ Kk =1 Z ( k ) S and ∀ k p S ( Z ∈ Z ( k ) S
| Y = k ) = 1 .
Assumption 1, inspired from Chapelle et al.
(2010), states that source representations with the same label are within the same cluster.
It helps guarantee that only one map is required to match source and target conditionals.
Assumption 1 is for instance satisﬁed when the classiﬁcation loss on the source domain is zero which corresponds to the training criterion of our encoder g .
Interestingly other approaches e.g. Combes et al.
; Rakotomamonjy et al.
(2020) assume that it also holds for target representations; this is harder to induce as target labels are unknown.
Assumption 2 (Conditional matching) .
A mapping φ solution to our matching problem in problem (OT) maps a source conditional to a target one i.e. ∀ k ∃ j φ # ( p S ( Z
| Y = k ))
=
p T ( Z | Y = j ) .
Assumption 2 guarantees that mass of a source conditional will be entirely transferred to a target conditional; φ solution to problem (OT) will then perform optimal assignment between conditionals.
It is less restrictive than alternatives: the ACons assumption in Zhang et al.
; Gong et al.
(2016) states the existence of a map matching the right conditional pairs i.e. j = k in Assumption 2, while the GLS assumption of Combes et al.
(2020) imposes that p S ( Z | Y )
=
p T ( Z | Y ) .
GLS is thus included in Assumption 2 when j = k and φ
= Id and is more restrictive.
Assumption 3 (Cyclical monotonicity between S and T) .
For all K elements permutation σ , conditional probabilities in the source and target domains satisfy (cid:80)
Kk =1 W 2 ( p S ( Z | Y
=
k ) , p T ( Z | Y = k )) ≤ (cid:80)
Kk =1 W 2 ( p S ( Z | Y
=
k ) , p T ( Z | Y =
σ ( k )) with W 2 , the Wasserstein-2 distance.
Assumption 3, introduced in Rakotomamonjy et al.
(2020), formally deﬁnes settings where conditionals are guaranteed to be correctly matched with an optimal assignment in the latent space under
Assumption 2.
One sufﬁcient condition for yielding this assumption is when ∀ k, j, W 2 ( p S ( Z | Y = k ) , p T ( Z | Y = k ))
≤ W 2 ( p S ( Z | Y = k ) , p T ( Z | Y = j )) .
This last condition is typically achieved when conditionals between source and target of the same class are “sufﬁciently near” to each other.
Assumption 4 (Conditional linear independence on T) .
{ p T ( Z | Y = k ) }
Kk =1 are linearly independent implying ∀ k, (cid:54)∃
α ∈ (cid:110) ∆ K | p T ( Z | Y =
[Equation]
Assumption 4 is standard and seen in TarS to guarantee correctly estimating target proportions (Redko et al., 2019; Garg et al., 2020).
It discards pathological cases like when ∃ ( i, j, k ) ∃ ( a, b ) s.t.
a + b = 1 , p T ( Z
| Y = i ) = a × p T ( Z | Y =
j ) + b × p T ( Z | Y = k ) .
It is milder than its alternative A2Cons in Zhang et al.
; Gong et al.
(2016) which states linear independence of linear combinations of source and target conditionals, in X respectively Z .
T HEORETICAL RESULTS
We present our theoretical results, with proofs in Appendix E, for OSTAR under our mild assumptions in Section 2.3.
We ﬁrst analyze in Section 3.1 the properties of the solution to our problem in (OT).
Then, we show in Section 3.2 that given the learned components g , φ and p YN , the target generalization error of a classiﬁer in the hypothesis space H can be upper-bounded by different terms including its risk on domain N and the Wasserstein-1 distance between marginals in N and T .
3. P ROPERTIES OF THE SOLUTION TO THE OT ALIGNMENT PROBLEM
Proposition 1 (Unicity and match) .
For any encoder g which deﬁnes Z satisfying Assumption 1, 2, 3, 4, there is a unique solution ( φ, p YN ) to (OT) and φ # ( p S ( Z | Y )) =
p T ( Z | Y ) and p YN = p YT .
Given an encoder g satisfying our assumptions, Proposition 1 shows two strong results.
First, the solution to problem (OT) exists and is unique.
Second, we prove that this solution deﬁnes a domain
N , via the sample transformation and reweight operation deﬁned in (1), where encoded conditionals and label proportions are equal to target ones.
For comparison, Combes et al.
Shui et al.
(2021) recover target proportions only under GLS i.e. when conditionals are already matched, while we match both conditional and label proportions under the more general GeTarS .
3. C ONTROLLED TARGET GENERALIZATION RISK
We now characterize the generalization properties of a classiﬁer f N trained on this domain N with a new general upper-bound.
First, we introduce some notations; given an encoder g onto a latent space
Z , we deﬁne the risk of a classiﬁer f as (cid:15) gD ( f ) (cid:44) E
z ∼ p D
( Z,Y )
[ f ( z ) (cid:54) =
y ] with D ∈ { S, T, N } .
Theorem 1 (Target risk upper-bound) .
Given a ﬁxed encoder g deﬁning a latent space Z , two domains N and T satisfying cyclical monotonicity in Z , assuming that we have ∀ k, p Y =
k N > 0 , then ∀ f N ∈ H where H is a set of M -Lipschitz continuous functions over Z , we have
[Equation]
We ﬁrst analyze our upper-bound in (2).
The target risk of f N is controlled by three main terms: the ﬁrst (C) is the risk of f N on domain N , the second (A) is the Wasserstein-1 distance between latent marginals of domain N and T , the third term (L) measures a divergence between label distributions using, as a proxy, two ad-hoc marginal distributions.
There are two other terms in (2): ﬁrst, a Lipschitz-constant M that can be made small by implementing f N as a NN with piece-wise linear activations and regularized weights; second the minimum of p YN , which says that generalization is harder when a target class is less represented.
We learn OSTAR ’s components to minimize the r.h.s of (2).
Terms (C) and (A) can be explicitly minimized, respectively by training a classiﬁer f N on domain N and by learning ( φ, p YN ) to match marginals of domains N and T .
Term (L) is not computable, yet its minimization is naturally handled by OSTAR .
Indeed, term (L) is minimal when p YN = p
YT under Assumption 4 per Redko et al.
With OSTAR , this sufﬁcient condition is guaranteed in Proposition 1 by the solution to problem (OT) under our mild assumptions in
Section 2.3.
This solution deﬁnes a domain N for which p Y N = p Y T and term (A) equals zero.
We now detail the originality of this result over existing Wasserstein-based generalization bounds.
First, our upper-bound is general and can be explicitly minimized even when target labels are unknown unlike Shui et al.
(2021) or Combes et al.
(2020) which require knowledge of p YT or its perfect estimation.
Combes et al.
(2020) claims that correct estimation of p YT i.e. (L) close to zero, is achieved under GLS
i.e. p S ( Z | Y ) =
p T ( Z | Y ) .
However, GLS is hardly guaranteed when the latent space is learned: a sufﬁcient condition in Combes et al.
(2020) requires knowing p YT , which is unrealistic in UDA.
Second, our bound is simpler than the one in Rakotomamonjy et al.
(2020): in particular, it removes several redundant terms which are unmeasurable due to unknown target labels.
I MPLEMENTATION
Our solution, detailed below, minimizes the generalization bound in (2) with OSTAR .
It implements components f N , g with NNs and the map φ with a residual NN.
Our solution jointly solves with pretrained representations (i) a classiﬁcation problem to account for term (C) in (2) and (ii) an alignment problem (OT) to account for terms (A) and (L) in (2).
Our pseudo-code and runtime / complexity analysis are presented in Appendix F.
Encoder initialization Prior to learning φ, p YN , f N , we ﬁrst learn the encoder g jointly with a source classiﬁer f S to yield a zero source classiﬁcation loss via (3).
With L ce the cross-entropy loss,
[Equation]
g is then ﬁxed to preserve the original problem structure.
This initialization step helps enforce
Assumption 1 and could alternatively be replaced by directly using a pretrained encoder if available.
Joint alignment and classiﬁcation We then solve alternatively (i) a classiﬁcation problem on domain N w.r.t.
f N to account for term (C) in (2) and (ii) the problem (OT) w.r.t.
( φ, p YN ) to account for term (A).
Term (L) in (2) is handled by matching p YN and p YT through the minimization of problem (OT).
p YN is estimated with the confusion-based approach in Lipton et al.
(2018), while φ minimizes the Lagrangian relaxation, with hyperparameter λ OT , of the constrained optimization problem (OT).
The equality constraint in (OT) is measured through a Wasserstein distance as our bound in (2) is tailored to this distance, however, we are not restricted by this choice as other discrepancy measures are also possible.
The objective based on (2) corresponds to the following optimization problem:
[Equation]
[Labelproportionestimation]
[Equation]
CAL
[Equation]
where L gc ( f N , N ) (cid:44) 1 n n
[Equation]
p
[Equation]
[Classiﬁcationlossin
[Equation]
) and L gOT ( φ ) (cid:44)
K (cid:88)
[Equation]
=
[Equation] [Objectivefunctionof [Equation] 5) and L gwd ( φ, p YN ) (cid:44) sup (cid:107) v (cid:107) L
[Equation]
[Equation]
n n (cid:88)
i
[Equation]
ˆ C is the confusion matrix of f N on domain N , ˆ p YT ∈
∆ K is the target label proportions estimated with f N .
L gc ( f N , N ) (4) is the classiﬁcation loss of f N on Z (cid:98) N , derived in Appendix E, which minimizes term (C) in (2).
Note that samples in domain N are obtained by mapping source samples with φ ; they are reweighted to account for label shift.
L gOT (5) deﬁnes the transport cost of φ on Z (cid:98) S .
Implementing φ with a ResNet performed better than standard MLPs, thus we minimize in practise the dynamical transport cost, better tailored to residual maps and used in de B ´ ezenac et al.
Karkar et al.
L g wd (6) is the empirical form of the dual Wasserstein-1 distance between p φN ( Z ) and p T ( Z ) and seeks at enforcing the equality constraint in problem (OT) i.e. minimizing term (A).
OSTAR ’s assumptions also guarantee that term (L) is small at the optimum.
Improve target discriminativity OSTAR solves a transfer problem with pretrained representations, but cannot change their discriminativity in the target.
This may harm performance when the encoder g is not well suited for the target.
Domain-invariant methods are less prone to this issue as they handle jointly these two problems.
In our upper-bound in (2), target discriminativity is assessed by the smallest value of term (C) at optimum of the alignment problem (OT) when terms (A) and (L) are equal to zero.
This value depends on g and may be high since g has been trained with only source labels.
Nevertheless, it can be reduced by updating g using target outputs such that class separability for target representations is better enforced.
To achieve this goal, we propose an extension of (CAL) using Information Maximization (IM), not considered in existing domain-invariant GeTarS methods.
IM was originally introduced for source-free adaptation without alignment (Liang et al., 2020). In this context, target predictions are prone to errors and there is no principled way to mitigate this problem. In our case, we have access to source samples and OSTAR minimizes an upper-bound to its target error, which avoids performance degradation.
IM reﬁnes the decision boundaries of f N with two terms on target samples.
L gent ( f N , T ) (7) is the conditional entropy of f N which favors low-density separation between classes.
Denoting δ k ( · ) the k -th component of the softmax function,
[Equation]
L gdiv ( f N , T ) (8) promotes diversity by regularizing the average output of f N ◦ g to be uniform on T .
It avoids predictions from collapsing to the same class thus softens the effect of conditional entropy.
[Equation]
Our variant introduces two additional steps in the learning process.
First, the latent space is ﬁxed and we optimize f N with IM in (SS).
Then, we optimize the representations in (SSg) while avoiding modifying source representations by including L gc ( f S , S ) (3) with a ﬁxed source classiﬁer f S .
[Equation]
E XPERIMENTAL RESULTS
We now present our experimental results on several UDA problems under GeTarS and show that
OSTAR outperforms recent SOTA baselines.
The GeTarS assumption is particularly relevant on our datasets as encoded conditional distributions do not initially match as seen in Appendix Figure 3.
Experimental setup We consider: (i) an academic benchmark Digits with two adaptation problems between USPS (Hull, 1994) and MNIST (LeCun et al., 1998), (ii) a synthetic to real images adaptation benchmark VisDA12 (Peng et al., 2017) and (iii) two object categorizations problems
Office31 (Saenko et al., 2010), OfficeHome (Venkateswara et al., 2017) with respectively six and twelve adaptation problems.
The original datasets have fairly balanced classes, thus source and target label distributions are similar.
This is why we subsample our datasets to make label proportions dissimilar across domains as detailed in Appendix Table 8.
For Digits , we subsample the target domain and investigate three settings - balanced, mild and high as Rakotomamonjy et al.
For other datasets, we modify the source domain by considering 30 % of the samples coming from the ﬁrst half of their classes as Combes et al.
We compare OSTAR against a Source baseline trained using only source samples without adaptation and to various UDA methods: two CoS methods and three recent SOTA GeTarS models.
Chosen UDA methods learn invariant representations with reweighting in GeTarS models or without reweighting in other baselines.
The two CoS baselines are DANN (Ganin et al., 2016) which approaches H -divergence and WD β =
(Shen et al., 2018) which computes Wasserstein distance.
The GeTarS baselines are Wu et al. Rakotomamonjy et al. ; Combes et al.
We use Wasserstein distance to learn invariant representations such that differences lie mostly on the strategy to account for label shift.
Wu et al.
(2019), denoted WD β , performs assymetric alignment with parameter β , for which we test different values ( β ∈ { 1 , 2 } ).
The remaining models, MARSc , MARSg (Rakotomamonjy et al., 2020) and
IW-WD (Combes et al., 2020), estimate target proportions respectively with optimal assignment or with the estimator in Lipton et al.
(2018) also used in OSTAR .
We report DI-Oracle , an oracle which learns invariant representations with Wasserstein distance and makes use of true class-ratios.
Finally, we report the performance of OSTAR with and without IM. All baselines are reimplemented for a fair comparison with the same NN architectures detailed in Appendix G.
Results We report in Table 1 mean and standard deviations for balanced accuracy over 10 runs.
It corresponds to the average recall obtained on each class and is suited for imbalanced problems (Brodersen et al., 2010).
For better visibility, results are aggregated over each dataset and over all imbalance settings (”aver. subsampled” in Table 1).
Full results are provided in Appendix Table 3. Additionally, due to space limits, we report in Figure 4 in the Appendix the (cid:96) 1 error between true and estimated target proportions for GeTarS baselines and OSTAR+IM .
First, we note that low estimation error of p YT is correlated to high accuracy for all models and that DI-Oracle , which uses true class-ratios, upper-bounds domain-invariant approaches.
This shows the importance of [Table] correctly estimating p YT .
Second, we note that without IM OSTAR improves the Source baseline (column 2) and is competitive w.r.t.
IW-WD (column 9) on VisDA , Office31 and OfficeHome and MARSg (column 7) on Digits although it keeps target representations ﬁxed unlike these two methods.
OSTAR+IM (column 11) is less prone to initial target discriminativity and clearly outperforms or equals the baselines on both balanced accuracy and proportion estimation.
It even improves DI-Oracle (column 12) for balanced accuracy despite not using true class-ratios.
This (i) shows the beneﬁts of not constraining domain-invariance which may degrade target discriminativity especially under label estimation errors; (ii) validates our theoretical results which show that OSTAR controls the target risk and recovers target proportions.
Finally, we visualize how OSTAR aligns source and target representations in Appendix Figure 3.
Ablation studies We perform two studies.
We ﬁrst measure the role of IM in our model .
In
Appendix Table 4, we show the contribution of (SS) (column 3) and (SSg) (column 4) to (CAL) (column 2).
We also evaluated the effect of adding IM to our baselines in Appendix Table 5, even if this is not part of their original work.
IM generally improves performance, marginally on Digits , more signiﬁcantly on VisDA and Office .
However, the performance remains below the ones of OSTAR+IM .
Finally, we measure the impact of IM on our upper-bound in (2) in Appendix Table 6, assuming target conditionals are known to compute term (L).
We observe that term (C), related to target discriminativity at optimum of alignment and the alignment terms (A) and (L) are reduced.
This explains the improvements due to IM and shows empirically that IM helps better optimize the three functions φ, g, f N involved in our upper-bound.
The second study measures the effect of the OT transport cost in our objective (CAL).
Proposition 1 shows that the OT formulation guarantees recovering target proportions and matching conditionals.
In Table 2, we consider MNIST → USPS under various shifts (Table 2a) and initialization gains i.e. the standard deviation of the weights of the NN (Table 2b).
In Table 2a, we note that λ OT (cid:54) =
in problem (CAL) improves balanced accuracy (left) and (cid:96) 1 estimation error (middle) over λ OT = 0 over all shifts, especially high ones.
This improvement is correlated with lower mean and standard deviation of the normalized transport cost per sample (right).
We observe the same trends when changing initialization gains in Table 2b.
This conﬁrms our theoretical results and shows the advantages of OT regularization biases for performance and stability.
In Appendix Table 7, we test more values of λ OT and show that OSTAR recovers the Source model under high λ OT as the induced transport cost constrains φ ≈ Id .
R ELATED W ORK
UDA Existing approaches train a classiﬁer using source labels while handling distribution shifts.
We review two main approaches: the ﬁrst learns invariant representations and the second learns a map between ﬁxed samples from source and target domains.
While domain-invariant approaches are
SOTA, mapping-based approaches avoid structure issues posed by the invariance constraint which may degrade target discriminativity (Liu et al., 2019; Chen et al., 2019).
For CoS , domain-invariant methods directly match marginal distributions in latent space (Ganin et al., 2016;
Shen et al., 2018;
Long et al., 2015), while mapping-based approaches learn a mapping in input space (Courty et al., 2017b; Hoffman et al., 2018).
For TarS and GeTarS , label shift requires estimating p YT to reweight source samples by estimated class-ratios (Zhao et al., 2019).
An alternative is to use a ﬁxed weight (Wu et al., 2019).
When conditionals are unchanged i.e. TarS , p YT can be recovered without needs for alignment (Lipton et al., 2018; Redko et al., 2019).
Under GeTarS , there is the additional difﬁculty of matching conditionals. The SOTA methods for GeTarS are domain-invariant with
[Table] [Table] [Table]
[Table]
sample reweighting (Rakotomamonjy et al., 2020; Combes et al., 2020; Gong et al., 2016).
An earlier mapping-based approach was proposed in Zhang et al.
(2013) to align conditionals, also under reweighting.
Yet, it is not ﬂexible, operates on high dimensional input spaces and does not scale up to large label spaces as it considers a linear map for each pair of conditionals.
Estimators used in
GeTarS are confusion-based in Combes et al.
Shui et al.
(2021); derived from optimal assignment in Rakotomamonjy et al.
(2020) or from the minimization of a reweighted MMD between marginals in Zhang et al.
; Gong et al.
OSTAR is a new mapping-based approach for
GeTarS with improvements over these approaches as detailed in this paper.
The improvements are both practical (ﬂexibility, scalability, stability) and theoretical.
CTC (Gong et al., 2016) also operates on representations, yet OSTAR simpliﬁes learning by clearly separating alignment and encoding operations, intertwined in CTC as both encoder and maps are trained to align.
OT approaches for UDA They usually apply linear programming (LP) to compute a transport plan between empirical distributions.
LP is used in CoS to align source and target joint distributions (Courty et al., 2017a; Damodaran et al., 2018) or to compute a barycentric mapping in input space (Courty et al., 2017b); and in TarS to compute a reweighted Wasserstein distance between source and target marginals whose minimum yields target proportions estimates (Redko et al., 2019).
An alternative to LP is to learn invariant representation by minimizing a dual Wasserstein-1 distance with adversarial training; this is done for CoS in Shen et al.
and, more recently, for GeTarS in Rakotomamonjy et al.
Shui et al.
Rakotomamonjy et al.
(2020) formulates two separate OT problems for class-ratio estimation and conditional alignment and Shui et al.
(2021) is the OT extension of Combes et al.
(2020) to multi-source UDA.
OSTAR is the ﬁrst OT approach which does not learn invariant representations for GeTarS and has several beneﬁts: (i) OSTAR keeps representation separate which avoids deteriorating target discriminativity, (ii) it solves a single OT problem unlike Rakotomamonjy et al.
(2020), (iii) it implements the OT map with a NN which generalizes beyond training samples and scales up with the number of samples unlike barycentric OT maps; (iv) it adds encoding which improves efﬁciency of matching by improving discriminativity and reducing dimensionality, unlike Courty et al.
(2017b).
C ONCLUSION
We introduce OSTAR , a new general approach to align pretrained representations under GeTarS , which does not constrain representation invariance.
OSTAR learns a ﬂexible and scalable map between conditional distributions in the latent space.
This map, implemented as a ResNet, solves an
OT matching problem with native regularization biases.
Our approach provides strong generalization guarantees under mild assumptions as it explicitly minimizes a new upper-bound to the target risk.
Experimentally, it challenges recent invariant GeTarS methods on several UDA benchmarks.
Reproducibility Statement For theoretical results, we provide explanations of our assumptions in Section 2.3 and provide our proofs in
Appendix E. The datasets used in our experiments are public benchmarks and we provide a complete description of the data processing steps and NN architectures in Appendix G.
We provide a link to a downloadable source code https://www.
dropbox.com/sh/y418sskov5vdec4/AADCnxWXgXQCpIHZFcRogCj_a?dl=0 .
A A DDITIONAL VISUALISATION
We visualize how OSTAR maps source representations onto target ones under GeTarS .
In these visualizations, IM is used to improve target discriminativity.
We note that OSTAR (i) maps source conditionals to target ones (blue and green points are matched c.f. left), (ii) matches conditionals of the same class (”v” and ”o” of the same colour are matched c.f. right).
[Figure]
[Figure]
B A DDITIONAL RESULTS
We report our full results below. Aggregated results for balanced accuracy over a dataset and imbalance scenarios are reported in Table 1. Preﬁx ”s” corresponds to subsampled datasets deﬁned in Table
[Table] [Table] [Figure] Additional ablation studies We detail the full results for our ablation studies.
[Table] [Table]
( ↓ ) and term (L) ( ↓ ) without and with IM in OSTAR .
Best results are in bold .
Terms (A) and (L) are computed with the primal formulation of OT using the POT package.
[Table] [Table]
C D ETAILS ON O PTIMAL T RANSPORT
Background OT was introduced to ﬁnd a transportation map minimizing the cost of displacing mass from one conﬁguration to another (Villani, 2008).
For a comprehensive introduction, we refer to Peyr´e & Cuturi (2019).
Formally, let α and β be absolutely continuous distributions compactly supported in R d and c : R d × R d → R a cost function.
Consider a map φ : R d → R d that satisﬁes φ # α = β , i.e. that pushes α to β .
We remind that for a function f , f # ρ is the push-forward measure f # ρ ( B )
= ρ (cid:0)
f − 1 ( B ) (cid:1) , for all measurable set B .
The total transportation cost depends on the contributions of costs for transporting each point x to φ ( x ) and the Monge OT problem is:
[Equation]
induces the p -Wasserstein distance, W p ( α, β ) =
[Equation]
C monge (
[Equation] [Equation]
p
[Equation]
When p = 1 , W 1 can be expressed in the dual form W 1 ( α, β ) = sup
[Equation]
where || v ||
L is the Lipschitz constant of function v .
Relationship between (OT) and the Monge OT problem (9) (OT) is the extension of (9) to the setting where p YS (cid:54) =
p YT with p YT unknown.
This extension aims at matching conditional distributions regardless of how their mass differ and learns a weighting term p YN for source conditional distributions which addresses label shift settings.
When p YS = p YT , these two formulations are equivalent under Assumption 1 if we ﬁx p YN
[Equation]
D D ISCUSSION
Our four assumptions are required for deriving our theoretical guarantees.
All GeTarS papers that propose theoretical guarantees also rely on a set of assumptions, either explicit or implicit.
Assumptions 1 and 4 are common to several papers.
Assumption 1 is easily met in practice since it could be forced by training a classiﬁer on the source labels.
Assumption 4 is said to be met in high dimensions (Redko et al., 2019; Garg et al., 2020).
Assumption 3 says that source and target clusters from the same class are globally (there is a sum in the condition) closer one another than clusters from two different classes.
This assumption is required to cope with the absence of target labels.
Because of the sum, it could be considered as a reasonable hypothesis.
It is milder than the hypotheses made in papers offering guarantees similar to ours (Zhang et al., 2013;
Gong et al., 2016).
Assumption 2 is new to this paper.
It states that φ maps a j source conditional to a unique k target conditional i.e. it guarantees that mass of a source conditional will be entirely transferred to a target conditional and will not be split across several target conditionals.
This property is key to show that
OSTAR matches source conditionals and their corresponding target conditionals, which is otherwise very difﬁcult to guarantee under GeTarS as both target conditionals and proportions are unknown.
This assumption has some restrictions, despite being milder than existing assumptions in GeTarS .
First, mass from a source conditional might in practise be split across several target conditionals.
In practise, our optimization problem in (CAL) mitigates this problem by learning how to reweight source conditionals to improve alignment.
We could additionally apply Laplacian regularization (Ferradans et al., 2013; Carreira-Perpi˜n´an & Wang, 2014) into our OT map φ
but this was not developed in the paper.
Second, it assumes a closed-set UDA problem i.e. label domains are the same Y S
= Y T .
The setting where Y S (cid:54) =
Y T is more realistic in large scale image pretraining and is another interesting follow-up.
Note that OSTAR can address empirically open-set UDA ( Y T ⊂ Y S ) by simply applying L1 regularization on p YN in our objective function (CAL).
This forces sparsity and allows ”loosing” mass when mapping a source conditional.
It avoids the unwanted negative transfer setting when source clusters, with labels absent on the target, are aligned with target clusters.
E P ROOFS
Proposition ( 1 ) .
For any encoder g which deﬁnes Z satisfying Assumption 1, 2, 3, 4, there is an unique solution ( φ, p Y N ) to (OT) and φ # ( p S ( Z | Y )) =
p T ( Z | Y ) and p Y N = p Y T .
Proof.
Fixing Z satisfying Assumption 1, 3 and 4, we ﬁrst show that there exists a solution ( φ, p YN ) to (OT).
Following Brenier (1991) as Z ⊂ R d , we can ﬁnd K unique Monge maps { (cid:98) φ ( k ) }
Kk = s.t.
∀ k (cid:98) φ ( k )# ( p S ( Z |
Y = k ))
=
p T ( Z | Y = k ) with respective transport costs W 1 ( p S ( Z | Y = k ) , p T ( Z | Y = k )) .
Let’s deﬁne (cid:98) φ as ∀ k (cid:98)
φ |Z ( k ) S = (cid:98) φ ( k ) where ∪ Kk =1 Z ( k ) S is the partition of Z S in
Assumption 1.
( (cid:98) φ, p YT ) satisﬁes the equality constraint to (OT), thus we easily deduce existence.
Now, let ( φ, p YN ) be a solution to (OT), let’s show unicity.
We ﬁrst show that φ = (cid:98) φ .
Under Assumption 2, (OT) is the Monge formulation of the optimal assignment problem between { p S ( Z | Y = k ) }
Kk =1 and { p T ( Z | Y = k ) }
Kk =1 with C the cost matrix deﬁned by C ij =
W 2 ( p S ( Z |
Y
= i ) , p T ( Z
| Y = j )) .
At the optimum, the transport cost is related to the Wasserstein distance between source conditionals and their corresponding target conditionals i.e. C ( φ ) =
(cid:80)
Kk =1 W 2 ( p S ( Z | Y
=
k ) , φ # ( p S ( Z | Y = k ))) .
Suppose ∃ ( i, j ) , j (cid:54)
=
i s.t.
φ # ( p S ( Z |
Y = i ))
=
p T ( Z | Y = j ) and φ # ( p S ( Z | Y = j ))
=
p T ( Z | Y
=
i ) and ∀ k (cid:54)
=
i, j, φ # ( p S ( Z | Y = k ))
=
p T ( Z | Y = k ) .
Assumption 3 implies (cid:80)
Kk =1 W 2 ( p S ( Z | Y
=
k ) , p T ( Z | Y = k )) ≤ (cid:80) k
(cid:54)
=
i,j W 2 ( p S ( Z | Y = k ) , p T ( Z | Y = k ))
+ W 2 ( p S ( Z |
Y
= i ) , p T ( Z
| Y = j )) + W 2 ( p S ( Z |
Y
=
j ) , p T ( Z | Y = i )) .
Thus C ( (cid:98) φ, Z ) ≤ C ( φ, Z ) whereas φ , solution to (OT), has minimal transport cost.
Thus φ = (cid:98) φ .
Now let’s show p YN
= p
YT under Assumption 4.
We inject φ # ( p S ( Z | Y ))
=
p T ( Z | Y ) into (OT),
K (cid:88)
[Equation]
Theorem ( 1 ) .
Given a ﬁxed encoder g deﬁning a latent space Z , two domains N and T satisfying cyclical monotonicity in Z , assuming that we have ∀ k, p Y =
k N > 0 , then ∀ f N ∈ H where H is a set of M -Lipschitz continuous functions over Z , we have
[Equation]
Proof.
We ﬁrst recall that (cid:15) gD ( f N ) =
E ( z ,y ) ∈
p D ( Z,Y ) L ( f N ( z ) , y ) where L is the 0/1 loss.
For conciseness, ∀ z ∈ Z , p z | Y T , p z | Y N , L z ,k will refer to the vector of [ p T ( z | k )]
Kk =1 , [ p N ( z | k )]
Kk =1 , [ L ( f N ( z ) , k )]
Kk =1 respectively.
In the following, (cid:12) denotes the element-wise product operator between two vectors of the same size.
[Equation]
[Table] [Equation]
We now introduce a preliminary result from Shen et al.
∀ f N ∈ H M -Lipschitz continuous,
[Equation]
Assuming that h is M -Lipschitz continuous we apply this result in the following
[Equation]
where p
[Equation]
Thus, ∀ f N M -Lipschitz continuous
[Equation]
We rewrite the second term to involve directly latent marginals.
Proposition 2 in Rakotomamonjy et al.
(2020) shows that under cyclical monotonicity, if ∀ k, p Y =
k N > 0 ,
[Equation]
This allows to write
K min
[Equation]
We then use the triangle inequality for the Wasserstein distance W
[Equation]
Derivation of the reweighted classiﬁcation loss (C) (cid:15) g N ( f N ) Let L ce be the cross-entropy loss.
Given a classiﬁer h , feature extractor g and domain N , the mapping of domain S by ( φ, p Y N ) , (cid:15) [Equation] f
[Equation]
(cid:90) [Equation] p
[Equation] F P SEUDO - CODE AND RUNTIME / COMPLEXITY ANALYSIS We detail in Algorithm 1 our pseudo-code and in Algorithm 2 how we minimize (CAL) with respect to ( φ, f N ) using the dual form of Wasserstein-1 distance (6).
Our method is based on a standard backpropagation strategy with gradient descent and uses gradient penalty (Gulrajani et al., 2017).
Training :
[Equation] [Equation]
[Equation] [Equation] for n do Compute with
[Equation] [Equation]
[Equation]
[Equation] [Equation]
Average p with cumulative moving average 7: if n epoch ≤ N g then Train φ, v, f with (
S, T
[Equation]
SS) [Equation]
r [Equation] f N 8: else Train φ, v, f N , with ( S,
T ) (cid:46) (CAL)
+ ( ) w.r.t. φ
[Equation]
f N Inference: Score x T with f N ◦ g
( x T )
Algorithm 2 Minimize (CAL) w.r.t.
( φ, f N ) (cid:98) S
= { x ( i ) S , y ( i ) S } ni =1 , (cid:98) T
= { x ( i ) T } mi =1 , g feature extractor, φ domain-mapping, v critic, f N classiﬁer.
Parameters of φ, v, f N : θ φ , θ v , θ f N and learning rates α φ , α v , α f N .
N iter : batches per epoch, N b : batch size, N v : critic iterations 1: for n iter <
N iter do 2:
Sample minibatches x BS , y BS
=
{ x ( i ) S , y ( i ) S } N b
i =1 , x BT
= { z ( i ) T } N b
i =1 from (cid:98) S, (cid:98) T 3:
Compute z BS =
g ( x BS ) , z BN =
φ ◦ g ( x BS ) and z BT = g ( x BT ) 4:
Compute class ratios: w Y = p
YN / p YS 5: for n v <
N v do 6:
Sample random points z B (cid:48) from the lines between ( z BN , z BT ) pairs 7:
Compute gradient penalty L grad with z BN , z BT , z B (cid:48) (Gulrajani et al., 2017) 8:
Compute L gwd = (cid:80) N b i =1 w y ( i ) S v ( z ( i ) N ) − 1 N b (cid:80) N b i =1 v ( z ( i ) T ) (6) 9: θ v ← θ v − α v ∇ θ v (cid:104)
L g wd − L grad (cid:105) 10:
Compute L gOT =
(cid:80)
Kk =  # { y ( i ) S = k } i ∈{ 1 ...N b } (cid:80) y ( i ) S = k, i ∈{ 1 ...N b } || φ
( z ( i ) S )
− z ( i ) S ||11: θ φ ← θ φ − α φ ∇ θ φ (cid:104)
L gwd + L gOT (cid:105) 12:
Compute L gc ( f N , N ) =
1 N b (cid:80) N b i =1 w y ( i ) S L ce ( f N ◦ φ ◦ g ( x ( i ) S ) , y ( i ) S ) 13: θ f N ← θ f N − α f N ∇ θ fN L gc ( f N , N )
Complexity / Runtime analysis In practise on USPS → MNIST, the runtimes in seconds on a
NVIDIA Tesla V100 GPU machine are the following: DANN : 22.75s, WD β =0 : 59.25s, MARSc : 72.87s, MARSg : 2769.06s, IW-WD : 74.17s, OSTAR+IM : 89.72s.
We observe that (i) computing
Wasserstein distance ( WD β =0 ) is slower than computing H -divergence ( DANN ), (ii) runtimes for domain-invariant GeTarS baselines are slightly higher than for WD β =0 as proportions are additionally estimated, (iii) domain-invariant GeTarS baselines have similar runtimes apart from MARSg which uses GMM, (iv) our model, OSTAR+IM , has slightly higher runtime than GeTarS baselines other than MARSg . We now provide some further analysis on computational cost and memory in OSTAR . We denote K the number of classes, d the dimension of latent representations, n and m the number of source and target samples.
• Memory:
Proportion estimation is based on the method in Lipton et al.
and requires storing the confusion matrix ˆ C and predictions ˆ p YT with a memory cost of O
( K 2 ) .
Encoding is performed by a deep NN g into R d and classiﬁcation by a shallow classiﬁer from R d to R K .
Alignment is performed with a ResNet φ : R d → R d in the latent space which has an order magnitude less parameters than g .
Globally, memory consumption is mostly deﬁned by the number of parameters in the encoder g .
• Computational cost comes from: (i) proportion estimation, which depends on K, n + m and is solved once every 5 epochs with small runtime; (ii) alignment between source and target representations, which depends on d, n + m and N v (the number of critic iterations).
This step updates less parameters than domain-invariant methods which align with g instead of φ ; this may lead to speedups for large encoders.
The transport cost L gOT depends on n, d and adds small additional runtime; (iii) classiﬁcation with f N using labelled source samples, which depends on d, K, n .
In a second stage, we improve target discriminativity by updating the encoder g with semi-supervised learning; this depends on d, K, n + m .
G E XPERIMENTAL SETUP
Datasets We consider the following UDA problems:
• Digits is a synthetic binary adaptation problem.
We consider adaptation between MNIST and USPS datasets.
We consider a subsampled version of the original datasets with the following number of samples per domain: 10000-2609 for MNIST → USPS, 5700for USPS → MNIST.
The feature extractor is learned from scratch.
• VisDA12 is a 12-class adaptation problem between simulated and real images.
We consider a subsampled version of the original problem using 9600 samples per domain and use pre-trained ImageNet ResNet-50 features http://csr.bu.edu/ftp/visda17/clf/ .
• Office31 is an object categorization problem with 31 classes.
We do not sample the original dataset.
There are 3 domains: Amazon (A), DSLR (D) and WebCam (W) and we consider all pairwise source-target domains.
We use pre-trained ImageNet ResNetfeatures https://github.com/jindongwang/transferlearning/blob/master/ data/dataset.md .
• OfficeHome is another object categorization problem with 65 classes.
We do not sample the original dataset.
There are 4 domains: Art (A), Product (P), Clipart (C), Realworld (R) and we consider all pairwise source-target domains.
We use pre-trained ImageNet ResNet-50 features https://github.com/jindongwang/ transferlearning/blob/master/data/dataset.md .
Imbalance settings We consider different class-ratios between domains to simulate label-shift and denote with a ”s” preﬁx, the subsampled datasets.
For Digits , we explicitly provide the classratios as Rakotomamonjy et al.
(2020) (e.g. for high imbalance, class 2 accounts for the 7% of target samples while class 4 accounts for 22% of target samples).
For Visda12 , Office31 and
OfficeHome , subsampled datasets only consider a small percentage of source samples for the ﬁrst half classes as Combes et al.
(2020) (e.g. Office31 considers 30% of source samples in classes below 15 and uses all source samples from other classes and all target samples).
[Table]
Hyperparameters Domain-invariant methods weight alignment over classiﬁcation; we tuned the corresponding hyperparameter for WD β =0 in the range [10 − 4 , 10 − 2 ] and used the one that achieves the best performance on other models.
We also tuned λ
OT
in problem (CAL) and ﬁxed it to 10 −on Digits and 10 − 5 on VisDA12 , Office31 and OfficeHome .
Batch size is N b = 200 and all models are trained using Adam with learning rate tuned in the range [10 − 4 , 10 − 3 ] .
We initialize
NN for classiﬁers and feature extractors with a normal prior with zero mean and gain 0.02 and φ with orthogonal initialization with gain 0.02.
Training procedure We ﬁx N e the number of epochs to 50 on Digits , 150 on VisDA12 and 100 on Office31 , OfficeHome ; OSTAR requires smaller N e to converge.
Critic iterations are ﬁxed to N v = 5 which worked best for all baseline models; for OSTAR higher values performed better.
For all models, we initialize f S , g for 10 epochs with (3).
Then, we perform alignment either through domain-invariance or with a domain-mapping until we reach the total number of epochs.
GeTarS models IW-WD , MARSc , MARSg , OSTAR perform reweighting with estimates refreshed every N u = 2 epochs in the ﬁrst 10 alignment epochs, every N u = 5 epochs after.
OSTAR minimizes (CAL) + (SS) for 10 epochs on Digits , Office31 , OfficeHome and 5 epochs on
VisDA12 , then minimizes (CAL) + (SSg) for remaining epochs.
Architectures For Digits , our feature extractor g is composed of three convolutional layers with respectively 64, 64, 128 ﬁlters of size 5 × 5 interleaved with batch norm, max-pooling and ReLU.
Our classiﬁers ( f S , f N ) are three-layered fully-connected networks with 100 units interleaved with batch norm, ReLU.
Our discriminators are three-layered NN with 100 units and ReLU activation.
For VisDA12 and Office31 , OfficeHome , we consider pre-trained 2048 features obtained from a ResNet-50 followed by 2 fully-connected networks with ReLU and 100 units for VisDA12 , 256 units for Office31 , OfficeHome .
Discriminators are 2-layer fully-connected networks with respectively 100/1 units on VisDA12 , 256/1 units on Office31 , OfficeHome interleaved with
ReLU.
Classiﬁers are 2-layer fully-connected networks with 100/ K units on VisDA12 , single layer fully-connected network with K units on Office31 , OfficeHome .
φ is a ResNet with 10 blocks of two fully-connected layers with ReLU and batch-norm.
Implementation of target proportion estimators OSTAR and IW-WD use the confusion based estimator in Lipton et al.
and solve a convex optimization problem ((4) in Combes et al.
and CAL w.r.t p YN for OSTAR ) which has an unique solution if the soft confusion matrix C is of full rank.
We implement the same optimization problem using the parallel proximal method from Pustelnik et al.
(2011) instead of cvxopt 2 used in Combes et al.
MARSc and MARSg (Rakotomamonjy et al., 2020) use linear programming with POT 3 to estimate proportions with optimal assignment between conditional distributions.
Target conditionals are obtained with hierarchical clustering or with a Gaussian Mixture Model (GMM) using sklearn 4 .
MARSg has some computational overhead due to the GMM.