# US 2020/0349447 A1 · Optimizing Unsupervised Generative Adversarial Networks via Latent Space Regularizations

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2020/0349447 A1
- Document ID: US20200349447A1
- Status: Published application
- Kind: A1
- Application number: 16/661,982
- Filed: 2019-10-23
- Published: 2020-11-05
- Earliest claimed: 2019-05-02
- Assignees: Agora Lab, Inc.
- Applicants: Agora Lab, Inc.
- Inventors: Sheng Zhong; Shifu Zhou
- Web page: https://patentgrep.com/patent/US20200349447A1

## CPC

- G06N 3/088: Non-supervised learning, e.g. competitive learning
- G06N 3/045: Combinations of networks
- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/047: Probabilistic or stochastic networks
- G06N 3/0475: Generative networks
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/0895: Weakly supervised learning, e.g. semi-supervised or self-supervised learning
- G06N 3/094: Adversarial learning
- G06N 20/20: Ensemble learning
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Training a generator G of a GAN includes generating, by G and in response to receiving a first input Z, a first output G(Z); generating, by an encoder E of the GAN and in response to receiving the first output G(Z) as input, a second output E(G(Z)); generating, by G and in response to receiving the second output E(G(Z)) as input, a third output G(E(G(Z))); generating, by E and in response to receiving the third output G(E(G(Z))) as input, a fourth output E(G(E(G(Z)))); training E to minimize a difference between the second output E(G(Z)) and the fourth output E(G(E(G(Z)))); and using the second output E(G(Z)) and fourth output E(G(E(G(Z)))) to constrain a training of the generator G. G(Z) is an ambient space representation Z. E(G(Z)) is a latent space representation of G(Z). G(E(G(Z))) is an ambient space representation of E(G(Z)). E(G(E(G(Z)))) is a latent space representation of G(E(G(Z))).

## Claims

### Claim 1

A method of training a generator G of Generative Adversarial Network (GAN), comprising:
generating, by the generator G and in response to receiving a first input Z, a first output G(Z), wherein the first output G(Z) being a first ambient space representation of the first input Z;
generating, by an encoder E of the GAN and in response to receiving the first output G(Z) as input, a second output E(G(Z)), wherein the second output E(G(Z)) being a first latent space representation of the first output G(Z);
generating, by the generator G and in response to receiving the second output E(G(Z)) as input, a third output G(E(G(Z))), wherein the third output G(E(G(Z))) being a second ambient space representation of the second output E(G(Z));
generating, by the encoder E and in response to receiving the third output G(E(G(Z))) as input, a fourth output E(G(E(G(Z)))), wherein the fourth output E(G(E(G(Z)))) being a second latent space representation of the third output G(E(G(Z)));
training the encoder E to minimize a difference between the second output E(G(Z)) and the fourth output E(G(E(G(Z)))); and
using the second output E(G(Z)) and fourth output E(G(E(G(Z)))) to constrain a training of the generator G.

### Claim 2 (depends on 1)

The method of claim 1, wherein training the encoder E to minimize the difference between the second output E(G(Z)) and the fourth output E(G(E(G(Z)))) comprising:
updating the encoder E by descending, for m samples, a gradient
∇
θ
E

1
m

∑
i
=
1
m


E
θ
E

(
G
θ
G

(
z
i
)
)
-
E
θ
E

(
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)
)

,
wherein the m samples comprising m random samples {z1, z2, . . . , zm} selected from a noise prior distribution pg(z) and m target data {y1, y2, . . . , ym} selected from a real data distribution pdata(y),
wherein EθE(GθG(zi)) is the second output E(G(Z)) of the encoder E given first current weight values θE of the encoder E and a GθG(zi), wherein GθG(zi) is the first output of the generator G in response to the generator G receiving the first input zi given second current weight values θG of the generator G, and
wherein EθE(GθG(EθE(GθG(zi)))) is the fourth output E(G(E(G(Z)))) of the encoder E given the first current weight values θE and the second current weight values θG and the first input zi.

### Claim 3 (depends on 1)

The method of claim 1, wherein using the second output E(G(Z)) and fourth output E(G(E(G(Z)))) to constrain the training of the generator G comprising:
using the second output E(G(Z)) and fourth output E(G(E(G(Z)))) in a loss function that is used to update weights of the generator G.

### Claim 4 (depends on 1)

The method of claim 1, wherein the GAN further comprises a discriminator D, and wherein using the second output E(G(Z)) and fourth output E(G(E(G(Z)))) to constrain the training of the generator G, comprising:
updating the generator G by descending, for m samples, a gradient
∇
θ
G

1
m

∑
i
=
1
m

[
log

(
1
-
D
θ
D

(
G
θ
G

(
z
i
)
)
)
+
μ
1
*

G
θ
G

(
z
i
)
-
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)

-
μ
2
*

E
θ
E

(
G
θ
G

(
z
i
)
)
-
E
θ
E

(
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)
)

]
,
wherein μ1 and μ2 are hyperparameters,
wherein the m samples comprising m random samples {z1, z2, . . . , zm} selected from a noise prior distribution pg(z) and m target data {y1, y2, . . . , ym} selected from a real data distribution pdata(y),
wherein θE are first current weight values of the encoder E,
wherein θG are second current weight values of the generator G,
wherein θD are third current weight values of the discriminator D, and
wherein DθD (GθG (zi) indicates whether the discriminator D considers the first output GθG(zi) to be real.

### Claim 5 (depends on 1)

The method of claim 1, wherein the generator G is trained by applying a Lipschitz condition so as to upper bound a first difference between the output G(Z) and the third output G(E(G(Z))) to a second difference between the second output E(G(Z)) and fourth output E(G(E(G(Z)))).

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
receiving, by a discriminator D of the GAN, the first output G(Z) and the third output G(E(G(Z))); and
updating the discriminator D by ascending, for m samples, a gradient
∇
θ
D

1
m

∑
i
=
1
m

[
log

(
D
θ
D

(
y
i
)
)
+
log

(
1
-
D
θ
D

(
G
θ
G

(
z
i
)
)
)
+
log

(
1
-
D
θ
D

(
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)
)
)
]
,
wherein the m samples comprising m random samples {z1, z2, . . . , zm} selected from a noise prior distribution pg(z) and m target data {y1, y2, . . . , ym} selected from a real data distribution pdata(y),
wherein θE are first current weight values of the encoder E,
wherein θG are second current weight values of the generator G,
wherein θD are third current weight values of the discriminator D,
wherein DθD (yi) indicates whether the discriminator D considers the target datum zi to be real,
wherein DθD(GθG(zi) indicates whether the discriminator D considers the first output GθG(zi) to be real, and
wherein DθD (GθG(EθE (GθG(zi)))) indicates whether the discriminator D considers the third output GθG (EθE (GθG(zi))) to be real.

### Claim 7 (depends on 1)

The method of claim 1, wherein the encoder E comprising a neural network.

### Claim 8 (depends on 7)

The method of claim 7,
wherein the neural network comprising an upscaling layer, and
wherein each of the second output E(G(Z)) and the fourth output E(G(E(G(Z)))) of the encoder E having a first size equal to a second size of first input Z.

### Claim 9

A system for training a generator G of Generative Adversarial Network (GAN), comprising:
a processor; and
a memory, the processor is configured to executed instructions stored in the memory to:
generate, by the generator G and in response to receiving a first input Z, a first output G(Z), wherein the first output G(Z) being a first ambient space representation of the first input Z;
generate, by an encoder E of the GAN and in response to receiving the first output G(Z) as input, a second output E(G(Z)), wherein the second output E(G(Z)) being a first latent space representation of the first output G(Z);
generate, by the generator G and in response to receiving the second output E(G(Z)) as input, a third output G(E(G(Z))), wherein the third output G(E(G(Z))) being a second ambient space representation of the second output E(G(Z));
generate, by the encoder E and in response to receiving the third output G(E(G(Z))) as input, a fourth output E(G(E(G(Z)))), wherein the fourth output E(G(E(G(Z)))) being a second latent space representation of the third output G(E(G(Z)));
train the encoder E to minimize a difference between the second output E(G(Z)) and the fourth output E(G(E(G(Z)))); and
use the second output E(G(Z)) and fourth output E(G(E(G(Z)))) to constrain a training of the generator G.

### Claim 10 (depends on 9)

The system of claim 9, wherein to train the encoder E to minimize the difference between the second output E(G(Z)) and the fourth output E(G(E(G(Z)))) comprises to:
update the encoder E by descending, for m samples, a gradient
∇
θ
E

1
m

∑
i
=
1
m


E
θ
E

(
G
θ
G

(
z
i
)
)
-
E
θ
E

(
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)
)

,
wherein the m samples comprising m random samples {z1, z2, . . . , zm} selected from a noise prior distribution pg(z) and m target data {y1, y2, . . . , ym} selected from a real data distribution pdata(y),
wherein EθE(GθG(zi)) is the second output E(G(Z)) of the encoder E given first current weight values θE of the encoder E and a GθG(zi), wherein GθG(zi) is the first output of the generator G in response to the generator G receiving the first input zi given second current weight values θG of the generator G, and
wherein EθE(GθG(EθE(GθG(zi)))) is the fourth output E(G(E(G(Z)))) of the encoder E given the first current weight values θE and the second current weight values θG and the first input zi.

### Claim 11 (depends on 9)

The system of claim 9, wherein to use the second output E(G(Z)) and fourth output E(G(E(G(Z)))) to constrain the training of the generator G comprises to:
use the second output E(G(Z)) and fourth output E(G(E(G(Z)))) in a loss function that is used to update weights of the generator G.

### Claim 12 (depends on 9)

The system of claim 9, wherein the GAN further comprises a discriminator D, and wherein to use the second output E(G(Z)) and fourth output E(G(E(G(Z)))) to constrain the training of the generator G, comprises to:
update the generator G by descending, for m samples, a gradient
∇
θ
G

1
m

∑
i
=
1
m

[
log

(
1
-
D
θ
D

(
G
θ
G

(
z
i
)
)
)
+
μ
1
*

G
θ
G

(
z
i
)
-
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)

-
μ
2
*

E
θ
E

(
G
θ
G

(
z
i
)
)
-
E
θ
E

(
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)
)

]
,
wherein μ1 and μ2 are hyperparameters,
wherein the m samples comprising m random samples {z1, z2, . . . , zm} selected from a noise prior distribution pg(z) and m target data {y1, y2, . . . , ym} selected from a real data distribution pdata(y),
wherein θE are first current weight values of the encoder E,
wherein θG are second current weight values of the generator G,
wherein θD are third current weight values of the discriminator D, and
wherein DθD (GθG (zi)) indicates whether the discriminator D considers the first output GθG(zi) to be real.

### Claim 13 (depends on 9)

The system of claim 9, wherein the generator G is trained by applying a Lipschitz condition so as to upper bound a first difference between the output G(Z) and the third output G(E(G(Z))) to a second difference between the second output E(G(Z)) and fourth output E(G(E(G(Z)))).

### Claim 14 (depends on 9)

The system of claim 9, wherein the instructions further comprise instructions to:
receive, by a discriminator D of the GAN, the first output G(Z) and the third output G(E(G(Z))); and
update the discriminator D by ascending, for m samples, a gradient
∇
θ
D

1
m

∑
i
=
1
m

[
log

(
D
θ
D

(
y
i
)
)
+
log

(
1
-
D
θ
D

(
G
θ
G

(
z
i
)
)
)
+
log

(
1
-
D
θ
D

(
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)
)
)
]
,
wherein the m samples comprising m random samples {z1, z2, . . . , zm} selected from a noise prior distribution pg(z) and m target data {y1, y2, . . . , ym} selected from a real data distribution pdata(y),
wherein θE are first current weight values of the encoder E,
wherein θG are second current weight values of the generator G,
wherein θD are third current weight values of the discriminator D,
wherein DθD (yi) indicates whether the discriminator D considers the target datum zi to be real,
wherein DθD(GθG(zi)) indicates whether the discriminator D considers the first output GθG(zi) to be real, and
wherein DθD (GθG(EθE (GθG(zi)))) indicates whether the discriminator D considers the third output GθG (EθE (GθG(zi))) to be real.

### Claim 15 (depends on 9)

The system of claim 9, wherein the encoder E comprising a neural network.

### Claim 16 (depends on 15)

The system of claim 15,
wherein the neural network comprising an upscaling layer, and
wherein each of the second output E(G(Z)) and the fourth output E(G(E(G(Z)))) of the encoder E having a first size equal to a second size of first input Z.

### Claim 17

A method for style transfer, comprising:
receiving, by a generator G, an input corresponding to a source image including a first participant; and
outputting, from the generator G, an output image, wherein the first participant is modified in the output image, wherein the generator G is trained using a Generative Adversarial Network (GAN) by steps comprising:
generating, by the generator G and in response to receiving a first input Z, a first output G(Z), wherein the first output G(Z) being a first ambient space representation of the first input Z;
generating, by an encoder E of the GAN and in response to receiving the first output G(Z) as input, a second output E(G(Z)), wherein the second output E(G(Z)) being a first latent space representation of the first output G(Z);
generating, by the generator G and in response to receiving the second output E(G(Z)) as input, a third output G(E(G(Z))), wherein the third output G(E(G(Z))) being a second ambient space representation of the second output E(G(Z));
generating, by the encoder E and in response to receiving the third output G(E(G(Z))) as input, a fourth output E(G(E(G(Z)))), wherein the fourth output E(G(E(G(Z)))) being a second latent space representation of the third output G(E(G(Z)));
training the encoder E to minimize a difference between the second output E(G(Z)) and the fourth output E(G(E(G(Z)))); and
using the second output E(G(Z)) and fourth output E(G(E(G(Z)))) to constrain a training of the generator G.

### Claim 18 (depends on 17)

The method of claim 17, wherein the GAN further comprises a discriminator D, and wherein using the second output E(G(Z)) and fourth output E(G(E(G(Z)))) to constrain the training of the generator G, comprising:
updating the generator G by descending, for m samples, a gradient
∇
θ
G

1
m

∑
i
=
1
m

[
log

(
1
-
D
θ
D

(
G
θ
G

(
z
i
)
)
)
+
μ
1
*

G
θ
G

(
z
i
)
-
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)

-
μ
2
*

E
θ
E

(
G
θ
G

(
z
i
)
)
-
E
θ
E

(
G
θ
G

(
E
θ
E

(
G
θ
G

(
z
i
)
)
)
)

]
,
wherein μ1 and μ2 are hyperparameters,
wherein the m samples comprising m random samples {z1, z2, . . . , zm} selected from a noise prior distribution pg(z) and m target data {y1, y2, . . . , ym} selected from a real data distribution pdata(y),
wherein θE are first current weight values of the encoder E,
wherein θG are second current weight values of the generator G,
wherein θD are third current weight values of the discriminator D, and
wherein DθD (GθG (zi)) indicates whether the discriminator D considers the first output GθG (zi) to be real.

### Claim 19 (depends on 18)

The method of claim 18, wherein the encoder E comprising a neural network.

### Claim 20 (depends on 19)

The method of claim 19,
wherein the neural network comprising an upscaling layer, and
wherein each of the second output E(G(Z)) and the fourth output E(G(E(G(Z)))) of the encoder E having a first size equal to a second size of first input Z.
