stanford university cs236: deep generative models - with … · 2019-12-06 · explainable models...

40
Weakly Supervised Disentanglement with Guarantees Rui Shu Joint work with Yining Chen, Abhishek Kumar, Stefano Ermon, Ben Poole

Upload: others

Post on 20-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Weakly Supervised Disentanglement with GuaranteesRui Shu

Joint work with Yining Chen, Abhishek Kumar, Stefano Ermon, Ben Poole

Page 2: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Why

Explainable models

What is in the scene?

Controllable generation

Generate a red ball instead

Blue sky

Pink wall

Small purple ballGreen floor

Decompose data into a set of underlying human-interpretable factors of variation

2

Page 3: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

How: Fully-Supervised

Strategy: Label everything

{dark blue wall, green floor, green oval}

{green wall, red floor, green cylinder}

{red wall, green floor, pink ball}

Controllable generation as label-conditional generative modeling

green wall, red floor, blue cylinder

3

Page 4: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

How: Fully-Supervised

Problem: Some things are hard to label

What kind of glasses?

What kind of hairstyle?

Generate this guy with this hair

4

Page 5: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

How: Unsupervised?

Strategy: Exploit statistical independence assumption + neural net magic

Beta-VAE

TC-VAE

FactorVAE

Swivel the chair

5

Page 6: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

How: Unsupervised?

Problem: Is statistical independence assumption + neural net magic enough?

Z 1: Sha

pe

Z2: Shading

vs

Locatello, et al. Challenging Common Assumptions in the Unsupervised Learning of Disentangled Representations, ICML 2019.

6

Page 7: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

How: Weakly Supervised

Strategy: Leverage “weak” supervision when possible

7

Page 8: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

How: Weakly Supervised

Restricted Labeling: Label what we can

Pink wall

Purple ballGreen floor

8

Size: ¯\_(ツ)_/¯

Page 9: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

How: Weakly Supervised

Match Pairing: Find pairs with known similarities

Same ground color

Real world data: direct intervention to share / change certain factors

9

Page 10: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

How: Weakly Supervised

Rank Pairing: Compare pairs

Which is bigger?

10

Page 11: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

The Plan

1. Definitions: Decompose disentanglement into:a. Consistencyb. Restrictiveness

2. Guarantees: Prove whether weak supervision guarantees consistency, restrictiveness, or both

Departure from existing literature: no end-to-end theoretical framework of disentanglement 11

Page 12: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Definitions

Disentangle: What does it mean when I say Z1 disentangles size?

12

1. When z1 is fixed, is size fixed?2. When we only change z1, does only size change?

Page 13: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Definitions

Disentangle: What does it mean when I say Z1 disentangles size?

13

1. When z1 is fixed, is size fixed? (Consistency)2. When we only change z1, does only size change? (Restrictiveness)

Page 14: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Definitions: Consistency

14

When ZI is fixed, SI is fixed

Oracle encoder

Generative model

Perturbation-based generation

Page 15: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Definitions: Restrictiveness

15

When only ZI is changed, only SI is changed

Equivalently: when Z\I is fixed, S\I is fixed

Oracle encoderGenerative model

Perturbation-based generation

Page 16: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Definitions: Disentanglement

16

ZI is consistent and restricted to SI

Page 17: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Consistency versus Restrictiveness

17

When only ZI is changed, only SI is changed

Equivalently: when Z\I is fixed, S\I is fixed

Page 18: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Consistency versus Restrictiveness

18

Page 19: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Union Rules

19

Consistency Union:

If fixing ZI fixes SI and fixing ZJ fixes SJ then fixing ( ZI , ZJ ) fixes ( SI , SJ )

Restrictiveness Union:

If changing ZI changes only SI and changing ZJ changes only SJ then changing ( ZI , ZJ ) changes only ( SI , SJ )

Page 20: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Intersection Rules

20

Consistency Intersection:

If fixing ZI fixes SI and fixing ZJ fixes SJ then fixing ZV fixes SV

Restrictiveness Intersection:

If changing ZI changes only SI and changing ZJ changes only SJ then changing ZV changes only SV

Page 21: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Disentanglement Rule

21

Disentanglement via Consistency

Consistency on all factors implies disentanglement on all factors

Disentanglement via Restrictiveness

Restrictiveness on all factors implies disentanglement on all factors

Page 22: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Summary of Rules

22

Page 23: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Summary of Rules

23

Page 24: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Strategy for Disentanglement

Dataset 1 → C(1)

Dataset 2 → C(2)

Dataset n → C(n)

Using datasets together (+ right algorithm) guarantees full disentanglement

24

Page 25: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Restricted Labeling Guarantees Consistency

25

sI s\I

x

Distribution MatchzI z\I

x

ZI will be consistent with SI

Page 26: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Match Pairing Guarantees Consistency

26ZI will be consistent with SI

Distribution Match

sI s’\Is\I

x x’

zI z’\Iz\I

x x’

Page 27: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Rank Pairing Guarantees Consistency

27

Distribution Matchs\i si s’\i s’i

x x’y

z\i zi z’\i z’i

x x’y

ZI will be consistent with SI

Page 28: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Summary of Guarantees

28

Page 29: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Targeted Consistency / Restrictiveness

29

Generative model trained via restricted labeling at S5

Evaluated model on consistency of Z0 vs S0

Page 30: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Targeted Consistency / Restrictiveness

30

Consistency:Restricted Labeling

Consistency:Match Pairing

(Share 1 factor)

Restrictiveness:Match Pairing

(Change 1 factor)

Consistency:Rank pairing

Restrictiveness:Intersection

Page 31: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Consistency versus Restrictiveness

31

● Models trained to guarantee only consistency or restrictiveness of one factor

● Strong correlation of consistency vs restrictiveness

Page 32: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Digression: Style-Content Disentanglement

32

z y

x

Observed class label

Unobserved style

Styl

e

Content

Only content-consistency is guaranteedStyle-content disentanglement not guaranteed (but due to neural net magic)

Page 33: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Full Disentanglement

33

Page 34: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Full Disentanglement: Visualizations

34

● Visualize multiple rows of single-factor ablation

● Check for consistency and restrictiveness

Elevation

Azimuth

Page 35: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Full Disentanglement: Visualizations

35

● Visualize multiple rows of single-factor ablation

● Check for consistency and restrictiveness

Ground truth factors: floor color, wall color, object color, object size, object type, and azimuth.

Page 36: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Full Disentanglement: Visualizations

36

● Visualize multiple rows of single-factor ablation

● Check for consistency and restrictiveness

Ground truth factor: object size

Ground truth factor: wall color

Page 37: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Conclusions

37

● Definitions for disentanglement

● A calculus of disentanglement

● Analyzed weak supervision methods

● Demonstrated guarantees empirically

Page 38: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Conclusions

● Definitions for disentanglement

● A calculus of disentanglement

● Analyzed weak supervision methods

● Demonstrated guarantees empirically

38

● Better definitions?

● Do new definitions preserve calculus?

● Analyze other weak supervision methods?

● Cost of weak supervision in real world?

Page 39: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Assumption: X → S is deterministic

Blue sky

Pink wall

Small purple ballGreen floor

39

Page 40: Stanford University CS236: Deep Generative Models - with … · 2019-12-06 · Explainable models What is in the scene? Controllable generation Generate a red ball instead Blue sky

Questions?

40

Entangled Disentangled

[email protected]@_smileyball@smiley._.ball