Title: DOMAIN-INVARIANT REPRESENTATIONS: A LOOK ON COMPRESSION AND WEIGHTS

Abstract: Learning Invariant Representations to adapt deep classifiers of a source domain to a new target domain has recently attracted much attention. In this paper, we show that the search for invariance favors the compression of representations. We point out this may have a bad impact on adaptability of representations expressed as a minimal combined domain error. By considering the risk of compression, we show that weighting representations can align representation distributions without impacting their adaptability. This supports the claim that representation invariance is too strict a constraint. First, we introduce a new bound on the target risk that reveals a trade-off between compression and invariance of learned representations. More precisely, our results show that the adaptability of a representation can be better controlled when the compression risk is taken into account. In contrast, preserving adaptability may overestimate the risk of compression that makes the bound impracticable. We support these statements with a theoretical analysis illustrated on a standard domain adaptation benchmark. Second, we show that learning weighted representations plays a key role in relaxing the constraint of invariance and then preserving the risk of compression. Taking advantage of this trade-off may open up promising directions for the design of new adaptation methods.

1. INTRODUCTION:

In a standard Supervised Learning setup, we consider that training data is representative of testing data. This ideal framework is often violated in practical applications since the data generative process can be altered during the application phase e.g. different pre-processing, sample rejection, imbalanced classes, condition of data collection, time evolving data... This so-called Distributional Shift situation (Quionero-Candela et al. (2009) ; Kull & Flach (2014) ) is recognized as a major challenge in Machine Learning (Amodei et al. (2016) ). Domain Adaptation (DA) (Pan & Yang (2009) ) is a widely adopted strategy to mitigate its effects. It consists in leveraging unlabeled testing data (the target domain) in order to transfer knowledge learned on labeled training data (the source domain).

A first line of study, named Importance Sampling (IS), assumes some stationarity in distributions in order to approximate the risk in the target domain by weighting sample contribution (Shimodaira (2000) ; Huang et al. (2007) ). To be applied, IS needs statistical support sharing across domains limiting its range of application when addressing high dimensional data. In that challenging context, Ganin & Lempitsky (2015) have shown that deep classifiers can be adapted to a new target domain by learning domain Invariant Representations (IR) and find theoretical support in the work of Ben-David et al. (2007; 2010) . It assumes that a classifier trained on representations of labeled data sampled from both domains will achieve a negligible combined error (adaptability). However, enforcing distribution invariance in the representation space can badly impact its adaptability, for instance in the context of Target Shift (Zhao et al. (2019) ) or when the support of the distributions do not overlap enough (Johansson et al. (2019) ). In the most general case of DA, it is not clear how IR helps aligning domains and removing spurious correlations as pointed by Arjovsky et al. (2019) .

In the present work, we show that the search of invariance favors learning representations with a significant loss of information from the original features. We refer to this phenomenon as the risk of Compression. In our understanding, this risk is not addressed in the original work from Ben-David et al. (2007; 2010) . We demonstrate that taking into account this risk has two major advantages. First, it provides a better control on (non-trainable) terms involving the labels in the target domain. Second, it introduces a new trainable term which embodies a risk of Compression and then may open-up the path to new learning methods. We provide a theoretical analysis illustrated with experiments on a standard Domain Adaptation benchmark. We underline that a better control on non-trainable terms may lead to an over-pessimistic risk of compression. This brings to light an inherent trade-off when learning representations for domain adaptation: How much compression risk is acceptable in order to obtain invariance? As a first try to answer to this question, we point that Learning Weighted Representations plays a key role in aligning representation distributions in order to obtain invariance. More precisely, we show that under a constraint of strong source risk conservation, weighting representations does not impact its adaptability.

2. BACKGROUND 2.1 A DECADE OF DOMAIN ADAPTATION:

The classical setup for modelling distributional shift is to introduce two domains: the source domain i.e. dataset where the model is trained with supervision and the target domain i.e. where the model is tested or applied. Formally, for two random variables (X, Y ) of a given space X × Y, we introduce two distributions on X × Y: the source distribution P s (X, Y ) and the target distribution P t (X, Y ). We use the exponent notation s and t to differentiate source and target terms. We define the hypothesis space H as a subset of functions from X to Y. The distributional shift situation is then characterized by the shift: P s (X, Y ) = P t (X, Y ). Learning under Distributional Shift (Quionero-Candela et al. (2009) ) consists in minimizing the risk on the target domain

EQUATION

Roughly speaking, this equation shows that it is possible to minimize the target risk using data (x s i , y s i ) 1≤i≤n s sampled from the source domain (i.e. (x i , y i ) ∼ P s (X, Y )) while re-weighting their contribution in the source expectation with a factor w(x i , y i ) (Importance Sampling). The difficulty of Learning under distributional shift arises when w(x i , y i ) is not tractable. The first reason is that data sampled from P t (X, Y ) is often not easily available. In order to get a reasonable estimation of w, practitioners are used to reformulate the problem as Unsupervised Domain Adaptation.

Definition 1 (Unsupervised Domain Adaptation). Given a loss , an hypothesis class H, a source domain (X ×Y, P s (X, Y )) and a target domain (X ×Y, P t (X, Y )), Unsupervised Domain Adaptation consists in minimizing the target risk (i.e. finding h = arg min h∈H E t [ (h(X), Y )]) with finite labeled sampling of (x s i , y s i ) ∼ P s (X, Y ) of the source domain and a finite unlabeled sampling (x t j ) ∼ P t (X) of the target domain.

If unlabeled samples in the target domain are available, a first idea is then to approximate w(X, Y ) by w(X) = P t (X)/P s (X). This is equivalent to assuming that conditional distributions are conserved across domains (i.e. P s (Y |X) = P t (Y |X)), a situation known as Covariate Shift, that has already been the subject of an extensive literature (Sugiyama et al. (2008) ; Huang et al. (2007) ). This formulation becomes ill-posed when feature domains (X , P s (X)) and (X , P t (X)) suffer from non-overlapping support: w(X) is then undefined. To address this issue, Invariant Representations learning (Long et al. (2015) ) performs adaptation by looking for a representation Z = ϕ(X) whose distribution is conserved across domains P s (Z) = P t (Z). A common strategy consists in extracting features Z to learn labels Y in the source domain while controlling representation invariance. That is formulated as follows:

Learning Objective 1 (Learning Invariant Representations for Domain Adaptation).

g , ϕ = arg min

(g,ϕ)∈G×Φ (1 -α) • ε s (g • ϕ) + α • D (s,t) (ϕ) (2)

where G is the set of classifiers and Φ is the set of representations. The hypothesis space is then defined as H = {g • ϕ : g ∈ G, ϕ ∈ Φ}. D (s,t) (ϕ) is a distance between distributions P s (Z) and P t (Z) and α is a trade-off parameter.

The choice of D (s,t) (ϕ) has been the object of an extensive literature including fdivergence measures such as domain adversarial learning (Ganin & Lempitsky (2015) ; 

2.2. THEORETICAL GUARANTEES OF DOMAIN ADAPTATION:

We consider the set of representations Φ and classifiers G. The hypothesis space is denoted H = {g • ϕ : g ∈ G, ϕ ∈ Φ}. We introduce the loss : Y × Y → R + which is assumed symmetric and verifies the triangular inequality. We note the risk ε(h

) = E[ (Y, h(X))] for h ∈ H and ε(h, h ) = E[ (h(X), h (X))] for (h, h ) ∈ H 2 . To emphasize the role of a representation Z = ϕ(X), we introduce f (Z) = E[Y |Z] and H = {g • ϕ : g ∈ G} ⊂ H.

We underline that • quantities depend on ϕ where, for the ease of reading, this dependence is omitted in notations when it is not ambiguous. Ben-David et al. (2007; 2010) have derived a theoretical bound of the additional risk when using a representation Z = ϕ(X) rather than raw features X: Inequality 1 (Ben- David et al. (2007; 2010) ). For a given ϕ ∈ Φ and g ∈ G, there is:

EQUATION

The inequality 1 ensures that the target risk is bounded by the sum of the source risk, the disagreement risk between two classifiers from representations (d( H∆ H) named H∆ H distance), and a third term (λ( H)) which quantifies the ability to perform well in both domains from representations.

In the rest of the paper, we refer to the latter as the adaptability.

Since E t [Y |X] is unknown, λ( H) is

intractable in practical applications. By conveniently assuming that λ( H) is negligible, it is possible to derive a Learning Objective 1 which minimizes εs (g •ϕ)+ 1 2 d( H∆ H). Indeed, minimizing D (s,t) on ϕ leads to learn representations Z = ϕ(X) such that P s (Z) = P t (Z), where such situation is sufficient to ensure that d( H∆ H) = 0.

2.3. THE CURSE OF INVARIANCE IN DOMAIN ADAPTATION:

Compressing representations is an easy way to achieve invariance. Assume X s ∼ N (0, 1), X t ∼ U(-1, 1) and Y = 1 X>0 then a trivial way to obtain representations invariance while separating source data is to consider ϕ : x → 1 x>0 . The main drawback is a potential loss of information from the original feature space. To explain this phenomenon, we first introduce formally the notion of Hypothesis space compression: Definition 2 (Hypothesis space compression).

Let (ϕ 1 , ϕ 2 ) ∈ Φ 2 , ϕ 1 compresses more H if H(ϕ 1 ) ⊂ H(ϕ 2 )

. By language abuse, we will say that

Z 1 = ϕ 1 (X) is more compressed than Z 2 = ϕ 2 (X).

Second, we build two possible solutions (g 1 , ϕ 1 ) and (g 2 , ϕ 2 ) of Learning Objective 1 by considering the following compositions

X → ϕ Z 1 → ψ Z 2 → g Ŷ such that ϕ and ψ • ϕ are both in Φ and g and g • ψ are both in G. We set g 1 = g • ψ, ϕ 1 = ϕ and g 2 = g, ϕ 2 = ψ • ϕ. These solutions are chosen to ensure that g 1 • ϕ 1 = g 2 • ϕ 2 and Z 2 = ϕ 2 (X) is more compressed than Z 1 = ϕ 1 (X).

In the case when D (s,t) is the Jensen divergence, the data processing inequality (see Lemma 4.6 in Zhao et al. (2019) ) implies that (g 2 , ϕ 2 ) is a better optimum than (g 1 , ϕ 1 ) according to Learning Objective 1 since ε s,t) (ϕ 1 ). To conclude, learning under objective 1 will favor compressed representations to enforce invariance. However, as noted in Johansson et al. (2019) ; Zhao et al. (2019) ; Liu et al. (2019) , more compressed representations will degrade adaptability. Indeed,

s (g 1 • ϕ 1 ) = ε s (g 2 • ϕ 2 ) and D (s,t) (ϕ 2 ) ≤ D (

EQUATION

since H(ϕ 1 ) ⊂ H(ϕ 2 ). A question which remains not addressed in the literature (except in Johansson et al. (2019) under the Covariate Shift assumption) is:

How compression may increase the risk of bad adaptability? Labels in domains are not necessary for the analysis but, for a better understanding, we draw ϕ which separates well labels in the source domain since our analysis will consider representations trained by unsupervised domain adaptation. (Left) Illustration of the source conservation where ϕ and ϕ are two source equivalent representations and h = g • ϕ and h = g • ϕ for a given g ∈ G. Since

1 2 1 2 3 1 2 3 3 ' ' 0 Source Target h = g ' h 0 = g ' 0 Positive Negative 1 3 ' ' 0 123 2 3 1 1 2 Source Target Positive Negative h = g ' 2 H h = g ' 0 2 Hs

x 1 ∈ D s ∩ D t we have ϕ(x 1 ) = ϕ (x 1

). Note that ϕ(x 3 ) may differ with ϕ (x 3 ) since x 3 / ∈ D s . This is also the case for x 2 even if ϕ(x 2 ) ∈ Ds since x 2 / ∈ D s . (Right) Illustration of the projected hypothesis for a given h ∈ Hs with h = g • ϕ and g ∈ G. ϕ embeds x 1 , x 2 and x 3 closely in the representation space. The source risk conservation enforces to have h = h on D s . Since x 1 and x 2 are in D s ∩ D t , ϕ and ϕ coincide on these points. ϕ modifies x 3 and changes its output for g. Then h can not fit this switch of output for x 3 without changing outputs of both x 1 and x 2 illustrating the impact of compression of ϕ.

3. THEORETICAL ANALYSIS OF COMPRESSION:

3.1 WORKING PLAN Our strategy aims to compare a representation ϕ with representations ϕ which act similarly on the source domain but differently on the target domain (source equivalence). First, by allowing to compute the minimal combined error on source equivalent representations ϕ , we limit the risk of bad adaptability of a fixed representation. Through an inequality called Target Compression, we show this new control of adaptability comes at the cost of a new risk which embodies the Compression. This is done by studying the projection of an hypothesis defined as its best approximation from representations in the target domain among those that conserve the source domain error (source conservation). Second, we rely on the H∆ H inequality (Ben-David et al. (2007; 2010) ) for stating a new bound of the target risk (Invariant and Compressed Representations inequality). Finally, we expose the particular interest of this bound: it allows a better control on adaptability by considering compression. This is formulated by the Invariance -Compression trade-off.

3.2. NOTATIONS AND DEFINITIONS:

In the following, we fix a given ϕ ∈ Φ. We restrict our analysis to the case of : (y, y ) ∈ Y 2 → (yy ) 2 as a convenient choice for manipulating properly

f (Z) = E[Y |Z].

Note that in the binary classification case (Y = {0, 1}), is the accuracy. We define the set of representations which act similarly on the source domain but differently in the target domain:

Definition 3 (Source equivalence). We introduce the set of source equivalent representations Φs = {ϕ ∈ Φ, ϕ = ϕ on D s } (where D s = supp(P s (X))) and the source equivalent hypothesis space Hs = {g • ϕ : g ∈ G, ϕ ∈ Φs }. Two elements of Φs are said source equivalent.

The source equivalent hypothesis space Hs is an extension of H adding hypothesis built using representations which are source equivalent to ϕ. For a given h ∈ Hs , we exhibit an interesting subset of H considering hypothesis with the same source error than h. Definition 4 (Source conservation). For a given h ∈ Hs , we note Hh = {h ∈ H :

ε s (h, h ) = 0}.

It is worth noting that for all h ∈ Hs , Hh is not empty (see Appendix A for details). We are now ready to introduce the projection of an hypothesis h ∈ Hs and to this purpose, we note ϕ ∈ Φs and g ∈ G such that h = g • ϕ . Intuitively, the projection of h is defined as its best approximation from ϕ in the target domain among those which verify the source conservation i.e. from hypothesis g • ϕ with g ∈ G such that ε s (g • ϕ, h) = 0.

Definition 5 (Projection). π : Hs → H is defined as follows: π(h) = arg min h ∈ Hh ε t (h, h ) for h ∈ Hs . π(h) is called the projected hypothesis. If there is no uniqueness of the minimum, any solution works.

Illustrations of introduced definitions are provided in Figure 1 . If h = g • ϕ ∈ H, the projection aims to map h to g • ϕ with g = g both in source and target L 2 norms. If, h = g • ϕ with ϕ ∈ Φ, the projection aims to map h to g • ϕ such that g = g in source L 2 norm while g • ϕ achieves a minimal distance with g • ϕ in target L 2 norm. We can observe that ∀h ∈ H s , π • π(h) = π(h) in both source and target L 2 norms hence the (abusive) analogy with projection.

For ease of reading, we remind the notations and definitions in appendix B.

3.3. OUR CONTRIBUTION:

In the following, we fix a given H • such that H ⊂ H • ⊂ Hs . We are now ready to state a new bound of the target risk:

Inequality 2 (Target Compression). Given g ∈ G and noting h = π(h), we have:

EQUATION

Proof. See Appendix A.

This inequality introduces two interesting terms γ(H • ) and λt (H • ) with opposite roles; the former involves a supremum while the latter involves an infremum on H • . The term λt (H • ) is very similar to the adaptability λ( H) from Inequality 1 and will be further investigated. Before, we focus on the term γ(H • ) which reflects the possibility of finding hypotheses in H • that can not be well approximated from target representations. The more information is lost from raw features, the higher the risk, hence its name Compression. This can be formally stated as follows:

Theorem 1 (γ embodies the risk of compression).

Let (ϕ 1 , ϕ 2 ) ∈ Φ 2 two source equivalent source representations. If ϕ 1 is more compressed than ϕ 2 , then γ(ϕ 1 , H • ) ≥ γ(ϕ 2 , H • ). Proof. If ϕ 1 is more compressed than ϕ 2 , there is H(ϕ 1 ) ⊂ H(ϕ 2 ) ⊂ Hs then ∀h ∈ Hs , Hh (ϕ 1 ) ⊂ Hh (ϕ 2 ). The projection involves an infremum then ε t (h, h(ϕ 2 )) ≤ ε t (h, h(ϕ 1 )) where h(ϕ) = arg min h ∈ Hh (ϕ) ε t (h, h ).

The supremum on h ∈ H • conserves the inequality.

We now focus our attention on λt (H • ). It differs with λ( H) in two ways. First, the source labelling function is involved only with the intermediate

f s (Z) = E s [Y |Z].

Second, the risk associated with it (ε t ( h, f s •ϕ)) involves a target expectation. In order to obtain a comparable bound with Inequality 1, we state a new bound of the target risk which is our main contribution:

Inequality 3 (Invariant and Compressed Representations). Given g ∈ G and noting h = π(h), β = 2 inf h∈ H ε s (h) + ε t (h, f s ), we have:

EQUATION

Proof. See AppendixA. The main idea is to bound ε t (h, f s • ϕ) and ε t ( h, f s ) using H∆ H inequality. This introduces respectively ε s (h, f s • ϕ) and ε s ( h, f s • ϕ) with residual terms1 2 d( H∆ H) + 1 2 β (two times). We use the source risk conservation to bound ε

s ( h, f s • ϕ) ≤ ε s (h, f s • ϕ). Then we bound ε s (h, f s • ϕ) ≤ ε s (h) leveraging the Pythagorean theorem since is the L 2 norm.

We are now ready to show the better control of the adaptability of the representation ϕ:

Theorem 2 (Better control of adaptability). λ(H • ) ≤ λ( H).

The proof is given by the infremum on H • ⊃ H. Compression γ(H • ) and adaptability λ(H • ) have an opposite behavior. This reflects an interesting trade-off:

Theorem 3 (Invariance and Compression trade-off). With H 1

• and

H 2 • such that H ⊂ H 1 • ⊂ H 2 • ⊂ Hs , there is λ(H 1 • ) ≥ λ(H 2 • ) and γ(H 1 • ) ≤ γ(H 2 • ).

The proof is obtained by observing that

H 1 • ⊂ H 2 • .

Even if invariance may have a bad impact on adaptability, our bound shows it is possible to have a better control of the adaptability while conserving the same degree of invariance. This control comes at the cost of an additional term involving compression of representations. The trade-off between invariance and compression emphasizes than the more control there is over adaptability, the higher the risk associated with compression. Furthermore, this new bound has a particular interest in providing theoretical support for the construction of new learning objectives. The difficulty in DA comes from in the fact that the adaptability is not trainable since it uses the labelling function in the target domain. Our study shows that better control of adaptability (i.e. making the adaptation more reliable) is possible. The two additional terms β and γ(H • ) can indeed be trained in an Unsupervised Domain Adaptation setting 1 .

4. EXPERIMENTS:

We are now conducting an experimental analysis on a widely used DA benchmark of digits recognition (MNIST, USPS). We study two tasks M→U and U→M under the Learning Objective 1. The representation ϕ is a convolutional neural network with a LeNet architecture (LeCun et al. (1998) ). We set the dimension of representations to 50 and G is the set of linear classifiers from the representation space to classes (with a softmax layer on top) and the Domain Adversarial Neural Network (DANN Ganin & Lempitsky (2015) ) for D (s,t) . We use the implementation from Long et al. (2018) for good reproductibility. Models are trained during 30 epochs and we note φ the learned representation. In the following, we note CE the cross-entropy.

We suggest to study the trade-off between compression and invariance with the family:

H η • = {g • ϕ ∈ Hs : E t ||ϕ (X) -ϕ(X)|| ≤ ηE t ||ϕ(X)||}, η > 0 (7)

We interpret this choice as a method for testing robustness of the learned representation to adversarial attacks in the target domain.

Enforcing h ∈ H η • . Enforcing h ∈ H η • is challenging in practrice.

We suggest to rely on a penalization L • to promote ϕ ≈ φ (in the sense of P s ) and ||ϕ -φ|| η • || φ|| (in the sense of P t ). We define the penalization L • as follows:

EQUATION

Source conservation. For a given h, the projected hypothesis is defined as h = g • φ where g is obtained by minimizing on g:

EQUATION

with λ π = 0.9 for enforcing the source conservation.

Estimation of λ(H • ). We suggest to minimize on (g, ϕ) ∈ H the following loss:

Λ(g, ϕ) = CE t (g • ϕ(X), Y ) + CE s (g • ϕ(X), Y ) + λ • • L • (ϕ) (10) with λ • = 10 2 . CE t (g • ϕ(X), Y ) and CE s (g • ϕ(X), Y ) are respectively two proxies of ε t (h) and ε s (h). L • (ϕ) promotes h ∈ H η • .

Estimation of γ(H • ). We follow an adversarial training procedure alternating between 1. maximizing an objective Γ(g, ϕ)

on h = g • ϕ ∈ H • (sup step)

2. computing the projected hypothesis (inf step)

During experimentation, we have observed that simply setting

Γ(g, ϕ) = -Π(ĝ• φ, g•ϕ)+λ • L • (ϕ)

(where ĝ • φ is an estimation of the projected hypothesis) leads to learn noisy labels. We suggest to prevent such pathological solutions by enforcing a low entropy adding to Γ a regularizer λ ent • CE(h(X), Ŷ ) with ( Ŷ = y) = 1(h(X) = y) with λ ent = -1. Then, we set:

EQUATION

Furthermore, for a fair comparison, we correct γ by comparing it with a baseline. This baseline is allowed to train representations to fit the adversary.

Analysis We build new target domains modifying the label distribution which is known to badly impact λ( H) (Johansson et al. (2019) ; Zhao et al. (2019) ). For a given target dataset D with classes balanced, we define D 1 ⊂ ... ⊂ D 6 as follows: for 1 ≤ i ≤ 6, D i is obtained by removing half of digit < i from D i-1 and setting D 0 = D. Main results are reported in Figure 2 . Although estimator are trained using cross-entropy, the results are reported computing the accuracy on a test set in order to be consistent with our theoretical analysis.

We can observe that stronger the adversary is (α → 1) (and the more the target shift (i → 6 for D i )), the more significant the difference between λ( H) and λ(H • ). This demonstrates a better control over adaptability especially when IR fails to perform adaptation. By playing with the value of η, we see that the better control on adaptability is paid to the cost of a higher γ. In our example, the risk of compression is estimated to a potential drop of performances from ∼12.5% to ∼27.5% of accuracy in the target domain while the gain on adaptability is marginal by reducing it of ∼4%. To conclude, a better control on adaptability is obtained with a pessimistic estimation of the risk of compression.

5. WEIGHTS FOR INVARIANCE RELAXATION:

The fact that compression and invariance are conflicting objectives supports the point from Wu et al. (2019) which claims that invariance is too strict a constraint. In this section, we show that invariance can be relaxed leveraging Weighted Representations. More specifically, we show that taking into account the risk of compression leads to introduce an adaptability term which does not depend on learned weights. Then, weighting representations can reduce the discrepancy between the source and the target distributions without impacting the adaptability. We introduce the set of weights W, a subset of functions w : X → R + such that E s [w(X)] = 1 and we note for w ∈ W, P w•s (X) := w(X)P s (X). The condition E s [w(X)] = 1 ensures that P w•s (X) is a distribution. We state a similar result than Inequality 1.

Inequality 4 (Weighted version of Inequality1). For a given ϕ ∈ Φ and g ∈ H,

EQUATION

with d w ( H∆ H) = sup (h,h )∈ H |ε w•s (h, h ) -ε t (h, h )| and λ w = inf h∈ H ε t (h) + ε w•s (h).

Interestingly, w and ϕ play similar role in inequality 4 since they are actionable parameters to minimize ε w•s (g • ϕ) + 1 2 d w ( H∆ H) while we can not quantify their impact on λ w ( H). We show that taking advantage of compression leads to an adaptability which does not depend on weights. This needs to introduce some definitions: • ) with η = 1. ∆(λ) ≥ 0 which supports Theorem 2. More the adversary is strong in LO 1 (α → 1), more ∆(λ) increases (similar analysis for D 1 to D 5 ). Down: Illustration of the trade-off from Theorem 3 in the particular case of D 4 with α = 0.75 on U → M. Both γ and its correction are reported. When η increases, the risk of compression increases while the adaptability assumption is better controlled. Better in color.

Definition 6 (Strong source conservation). For a given h ∈ Hs , we note Hh = {h ∈ H : h = h on D s } where D s = supp(P t (X)).

Definition 7 (Strong projection). Π : Hs → H is defined as follows π(h) = arg min h ∈ Hh ε t (h, h ) for h ∈ Hs . If there is no uniqueness of the minimum, any solution works.

We are now ready to state the role of weights as a relaxed invariance for a lower compression: Inequality 5 (Weighting Invariant and Compressed Representations). Given g ∈ G and noting h = Π(h), β w = 2 inf h∈ H ε w•s (h) + ε t (h, f s ), we have:

ε t (g•ϕ) ≤ inf w∈W ε w•s (g • ϕ) + 1 2 d w ( H∆ H) + 1 2 β w + sup h∈H• ε t (h, h)+ inf h∈H• ε t (h)+ε t (h, f s •ϕ)

Proof. This is a straightforward extension of inequality 2 applied to P w•s . Furthermore,

inf h∈H• ε t (h) + ε t (h, f s • ϕ)

does not depend on w due to strong risk conservation (risk conservation would have been dependent on w through the constraint ε w•s (h, h) = 0).

Adding weights exposes to the risk of increasing the variance of estimators when considering finite sampling analysis (see Cortes et al. (2010) for an extensive theoretical analysis of Importance Sampling). In inequality 5, this can be controlled with a good choice of W e.g. by considering weights w ≤ M for a given M > 0.

6. RELATED WORK:

Generalization bounds for DA have been the object of an extensive literature for both Importance Sampling Cortes et al. (2010) and Invariant Representations Ben-David et al. (2007; 2010) ; Mansour et al. (2009) . It has attracted a lot of attention in order to understand failure cases observed when using IR (Zhao et al. (2019) ; Johansson et al. (2019) ). The theoretical analysis in Johansson et al. (2019) is the work closest to ours. They introduce a loss information metric which quantifies the risk of using non-invertible representations. The present work differs in three ways. First, our work follows the formalism introduced in Ben-David et al. ( 2007) which is widely adopted in the community. Second, contrary to the information loss, our theory provides a tractable risk of compressing representations. Finally, we do not rely on the Covariate Shift assumption which gives our work a broader range of applications.

7. CONCLUSION:

By addressing domain generalization under the perspective of compression, we have bounded the target risk by a sum of trainable terms (ε s (g • ϕ) + d( H∆ H) + β + γ(H • )) and a term λ(H • ) which embeds a new adaptability criterion of representations. We have shown that λ(H • ) can be better controlled by enriching the hypothesis class H • . This control comes at a cost of a higher risk of compression underlying a trade-off between invariance and compression when learning IR for DA. Through an empirical study on a standard benchmark, we have exhibited the better control of adaptability. Furthermore, we have shown how our framework can be applied for studying adaptation robustness to adversarial attacks. Finally, as an attempt to obtain representation distributions invariance with a lower compression, we have emphasized the role of weighted representations for relaxing the constraint of invariance.

Achieving representation invariance can reduce the generalization gap between two domains. However, all invariances will not have the same guarantees for better generalization. Our work shows that we will look for representations which preserve the best the information in the original target features spaces. We leave both the design on new Domain Adaptation methods which incorporate such consideration and relevant design of H • as future works.

Promising directions (1) Our analysis is restricted to the comparison among source equivalent representations of a given representation ϕ ∈ Φ. Then, for two given representations ϕ 1 and ϕ 2 of Φ which does not verify the source equivalence, our analysis does not allow to state if ϕ 1 presents, or not, better guarantees on the success of the adaptation. Understanding how the source equivalence can be relaxed can provide to the present work a broader range of applications. ( 2 2016)) or by finding Optimal Transport between the source and the target domains (Courty et al. (2016; 2017) ). ( 4) The Covariate Shift assumption can be stated as H • = {h ∈ H, ε s (h, ĥ) = 0 with ĥ = arg min h∈H ε s (h)}. Such H • may provide a new framework for addressing the case of non-overlapping supports in Covariate Shift adaptation.

A MAIN PROOFS:

Proposition 1 (The source conservation hypothesis is not empty). For a given ϕ ∈ Φ and h ∈ Hs , Hh is not empty.

Proof.

If h ∈ Hs , it exists g ∈ G and ϕ ∈ Φ such that h = g • ϕ . We set h = g • ϕ ∈ H, there is ε s (h, h ) = ε s (g • ϕ , g • ϕ) = ε s (g • ϕ, g • ϕ) = 0 since ϕ = ϕ on D s then h ∈ Hh .

Inequality 6 (Target Compression). Given ϕ ∈ Φ, g ∈ G and noting h = π(h), there is for any H

EQUATION

This is a succession of triangular inequalities which involve respectively f s • ϕ, h and h. The last inequality is a convenient arrangement of terms. We bound ε t (h, h) by its supremal value for

h ∈ H • , then ε t (g • ϕ) ≤ ε t ( f s • ϕ, g • ϕ) + sup h∈H• {ε t (h, h)} + ε t (h) + ε t ( h, f s • ϕ). Since this holds for all h ∈ H • , we bound ε t (g • ϕ) by the infremum for h ∈ H • .

Inequality 7 (Invariant and Compressed Representations). Given ϕ ∈ Φ, g ∈ G and noting h = π(h), β = 2 inf h∈ H ε s (h) + ε t (h, f s ), there is for any H • such that H ⊂ H • ⊂ Hs :

EQUATION

Proof. First of all, we recall the H∆ H inequality from Ben-David et al. (2007; 2010) , for any f s and f t , there is:

EQUATION

A particular case of that inequality applied to f s = f t = f s • ϕ leads to bound:

ε t (g • ϕ, f s • ϕ) ≤ ε s (g • ϕ, f s • ϕ) + 1 2 d( H∆ H) + inf h∈ H ε s (h, f s • ϕ) + ε t (h, f s • ϕ) ≤ ε s (g • ϕ) + 1 2 d( H∆ H) + inf h∈ H ε s (h) + ε t (h, f s • ϕ) (20) where bounding ε s (g • ϕ, f s • ϕ) ≤ ε s (g • ϕ) is a direct property of (y, y ) = (y -y ) 2 and f s (Z) = E s [Y |Z]: ε s (g • ϕ) = ε s (g • ϕ, f s • ϕ) + ε s ( f s • ϕ).

Note that, it is not possible to do so for ε t (g • ϕ, f s • ϕ) since the expectation is computed in the target domain. We define

β = 2 inf h∈ H ε s (h) + ε t (h, f s • ϕ).

We apply a second time H∆ H inequality, there is for any h ∈ H • :

EQUATION

which is licit since h ∈ H. Relying on the projected hypothesis h allows us to preserve the invariance: even

if h ∈ H • , d( H∆ H) is involved, not d(H • ∆H • ).

Then, we use the property of source risk conservation h ∈ H which enforces ε s ( h, h) = 0 for noting that ε s ( h) ≤ ε s (h) + ε s (h, h) = ε s (h) then:

ε t ( h, f s • ϕ) ≤ ε s (h) + 1 2 d( H∆ H) + inf h∈ H ε t (h, f s ) + ε s (h)

Finally, taking the infremum:

EQUATION

Combining all inequalities leads to the stated one.

Theorem 4 (Better control on the adaptability). λ(H • ) ≤ λ( H).

Proof. We simply use the fact that H ⊂ H • then using the property of the infremum:

EQUATION

Theorem 5 (γ embodies the risk of compression). Let (ϕ 1 , ϕ 2 ) ∈ Φ 2 two source equivalent representations. If ϕ 1 is more compressed than ϕ 2 , then γ(ϕ 1 , H • ) ≥ γ(ϕ 2 , H • ) for H ⊂ H • ⊂ Hs .

Proof. If ϕ 1 and ϕ 2 are two equivalent representations, there is H(ϕ 1 ) ⊂ H(ϕ 2 ) ⊂ Hs then ∀h ∈ Hs , ( H(ϕ 1 ) ∩ {h ∈ H : ε s (h, h ) = 0}) ⊂ ( H(ϕ 2 ) ∩ {h ∈ H : ε s (h, h ) = 0}) which guarantees Hh (ϕ 1 ) ⊂ Hh (ϕ 2 ). Finally ε t (h, h(ϕ 2 )) ≤ ε t (h, h(ϕ 1 ))

invoking the property of the infremum where h(ϕ) = arg min h ∈ Hh (ϕ) ε t (h, h ). The supremum on h ∈ H • conserves the inequality.

Proposition 2 (β is trainable from the data). Let (g n , ϕ n ) n∈N a sequence such that α • εs (g n • ϕ n ) + (1α) • D(ϕ n ) → 0 then β n → 0.

Proof. First of all, since D(ϕ n ) → 0 then P t (ϕ n (X)) → P s (ϕ n (X)). We note that for any n ∈ N,

β ≤ 2•(ε s (g n •ϕ n )+ε t (g n •ϕ n , f s n •ϕ n )) ≤ 2•(2•ε s (g n •ϕ n )+(ε t (g n •ϕ n , f s n •ϕ n )-ε s (g n •ϕ n ))) Since ε s (g n • ϕ n ) → and (ε t (g n • ϕ n , f s ) -ε s (g n • ϕ n )) → 0 (because P t (ϕ n (X)) → P s (ϕ n (X))) there is β n → 0.

B NOTATIONS:

• Φ is the set of representations.

• G is the set of classifiers. • Equivalence. For a given ϕ ∈ Φ, the set of source equivalent representations Φs (ϕ) = {ϕ ∈ Φ, ϕ = ϕ on D s } (where D s = supp(P s (X))) and the source equivalent hypothesis space Hs (ϕ) = {g • ϕ : g ∈ G, ϕ ∈ Φs }. Two elements of Φs are said source equivalent. When there is no ambiguity, we note Φs and Hs . • Conservation.

-For a given h ∈ Hs , we note Hh = {h ∈ H : ε s (h, h ) = 0}.

-For a given h ∈ Hs , we note Hh = {h ∈ H : h = h on D s } where D s = supp(P t (X)). • Projection.

π : Hs → H is defined as follows: π(h) = arg min h ∈ Hh ε t (h, h ) for h ∈ Hs .

π(h) is called the projected hypothesis. If there is no uniqueness of the minimum, any solution works. -Π : Hs → H is defined as follows π(h) = arg min h ∈ Hh ε t (h, h ) for h ∈ Hs . If there is no uniqueness of the minimum, any solution works.

:

The trainability of β is shown in Appendix A

Figures and Tables:

Figure1: We fix ϕ ∈ Φ and we note D d = supp(P d (X)) and Dd = supp(P d (ϕ(X))) with d = s, t. Labels in domains are not necessary for the analysis but, for a better understanding, we draw ϕ which separates well labels in the source domain since our analysis will consider representations trained by unsupervised domain adaptation. (Left) Illustration of the source conservation where ϕ and ϕ are two source equivalent representations and h = g • ϕ and h = g • ϕ for a given g ∈ G. Since x 1 ∈ D s ∩ D t we have ϕ(x 1 ) = ϕ (x 1 ). Note that ϕ(x 3 ) may differ with ϕ (x 3 ) since x 3 / ∈ D s . This is also the case for x 2 even if ϕ(x 2 ) ∈ Ds since x 2 / ∈ D s . (Right) Illustration of the projected hypothesis for a given h ∈ Hs with h = g • ϕ and g ∈ G. ϕ embeds x 1 , x 2 and x 3 closely in the representation space. The source risk conservation enforces to have h = h on D s . Since x 1 and x 2 are in D s ∩ D t , ϕ and ϕ coincide on these points. ϕ modifies x 3 and changes its output for g. Then h can not fit this switch of output for x 3 without changing outputs of both x 1 and x 2 illustrating the impact of compression of ϕ.

Figure 2: Up: We report the ∆(λ) = λ( H) -λ(H η • ) with η = 1. ∆(λ) ≥ 0 which supports Theorem 2. More the adversary is strong in LO 1 (α → 1), more ∆(λ) increases (similar analysis for D 1 to D 5 ). Down: Illustration of the trade-off from Theorem 3 in the particular case of D 4 with α = 0.75 on U → M. Both γ and its correction are reported. When η increases, the risk of compression increases while the adaptability assumption is better controlled. Better in color.

) Obtaining a robust estimation of γ(H • ) by following an adversarial training procedure appeared to be challenging in practice. Finding fast and robust estimations of γ(H • ) (or a proxy of it) may help to derive new learning objectives or policy for model selection. For instance, Information Theory gives better suited devices for modelling the phenomenon of compression. (3) A strategy may to enforce invariance directly in the target domain by transporting source samples. Formally, assuming D s ∩ D t = ∅, we set ϕ such that ϕ(X) = X on D t and ϕ(D s ) ⊂ D t . If ϕ is fixed in the source domain (i.e. ϕ |D s is fixed) the optimal representation from the compression perspective is ϕ |D t (X) = X. This consideration is connected with two recent trends which perform adaptation by generating cross domain samples(Sankaranarayanan et al. (2018);Hoffman et al. (2018);Bousmalis et al. (

H is the hypothesis spaceH = G • Φ • For a given ϕ ∈ Φ, we note H(ϕ) = {g • ϕ : g ∈ G} = G • ϕ. When there is no ambiguity, we note H(ϕ) = H. • For a given h ∈ H, we note ε(h) = E[(Yh(X)) 2 ]. For d = s, t, we note a domain risk ε d (h) = E d [(Yh(X)) 2 ].• For d = s, t and a given ϕ ∈ Φ, we note the conditional expectationf d (Z) = E d [Y |Z]with Z = ϕ(X).

Peer review (iclr2020):
This submission provides a new theoretical framework for domain adaptation. In order to tackle the adaptability term in the classical domain adaptation theory, this submission proposes a new upper bound that enlarge the hypothesis space in the adaptability term. A weighted version of this theory is also given. Authors further support their conclusion by empirical results. Pros: 1. This submission studies an important problem in domain adaptation. 2. This submission proposes new theoretical insight about compression and adaptability. 3. The conclusions of this paper can be partially proved by the empirical results. Cons: 1. As the author says in their future work, the source constraint is too strong that need to control the feature unchanged across all source domain. For this condition is not build on samples but on the support of source domain. It seems that authors use to constrain phi’ to have same value with phi on source dataset, which may be only a small part with zero measure of source support set. 2. There is no generalization error analysis for these upper bounds. This submission provides weighted version of the main theory in the section 5. It seems that weighted version of upper bound could be further minimized by find a good weight. But add weight will add variance in the complexity term [A]. 3. This submission adds _x0008_eta term to change the adaptability term of into the adaptability term of . The reason why _x0008_eta can be estimated from finite sample is not clarified, which is the premise of being trainable and should be mainly discussed in this paper. We can see that to estimate _x0008_eta is a domain adaptation problem under the fact that the labeled functions are same. _x0008_eta is a term that can’t be computed from small finite samples if there is no more assumption: It is not easy to approximate uniformly, otherwise the estimation of _x0008_eta will suffer from distribution shift. This submission claimed that the term can be trainable by giving Proposition 2, a proof of the consistency. However, this proposition is built on the assumption that there exists a series of phi minimizing the distribution distance to zero. But this is impossible for finite sample estimation, when there will always be generalization error of estimating the distribution distance. Furthermore, it is usually impossible to make the two embedded distributions completely the same in empirical. In addition, if there is a series of phi, how to control other terms in the upper bound? Every phi will induce new and which will change all other terms. In summary, the main theory in this submission changes the unknown adaptability to a new term that is very hard to estimate. And there is no sufficient empirical or theoretical evidence in this paper that could support the fact that _x0008_eta is small. The contribution is therefore limited. 4. The theory also fails to give upper bounds on compression term and adaptability term, or some explicit upper bounds for certain hypothesis spaces as examples. Readers could not have a clear image of how large will these terms be. Furthermore, if the support sets of source and target domain coincide a lot, the adaptability of will not be too smaller than the previous one. 5. The organization of the submission makes it hard to read: a) The symbol of this submission is chaotic. For example, , , are defined based on , is defined based on , but all these facts are not revealed in their symbols. b) For clarity, all loss functions defined in Section 4 should be stated in a independent line. The Section 5 should be moved to the front of Experiment part. c) I recommend the authors to restate all new defined symbols as a list on the top of appendix. It really troubles me during checking the proof. I think this submission discusses about an important problem and provides new insight, but it is not a thorough theoretical work because of above reasons. So, I vote for rejecting this paper. [A] Cortes, Corinna, Yishay Mansour, and Mehryar Mohri. *Learning bounds for importance weighting.* Advances in neural information processing systems. 2010.