• 沒有找到結果。

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

• g (Xi;α): the output of the generator: ”initial generated picture”

The result of equations (3) is the difference between ”initial generated picture” and

”revised generated picture”. This can also mean how better our generator has already learned. The Generator loss can help us to update α(generator’s variables). Parameter α will keep changing in the learning process. And we will let the loss between ”initial generated picture” and ”revised generated picture” be minimized to match our target.

This is also the target generator that we want.

Our training target is trying to minimize the generator(α) loss between ”initial gen-erated picture” and ”revised gengen-erated picture”, and minimize the descriptor(θ) loss be-tween ”revised generated picture” and ”real picture”. Next paragraph we will introduce the algorithm steps of our model.

4.3 CycleCoopNet algorithm

Algorithm 1 are the details steps for our works.

Figure 10: The overview flow of our model

Figure 10 show how our Algorithm step 1-6, we will generate 6 pictures.

Algorithm 1: Convert-Style Cooperative Learning Algorithm Input :

1. two training datasets with several examples 2. numbers of Langevin steps `

3. number of learning iterations T Output :

1. A2B and B2A generator’s parameters α 2. A2B and B2A descriptor’s parameters θ 3. synthetic example Y0

1: Let t ← 0, initialize θ and α.

2: repeat following Steps

3: Step 0: random choose two different domain picture

4: Step G1A2B: use A2B Generator to generate B domain picture from A

5: Step D1A2B: use A2B Langevin revision to revise the picture generated from step 1 by equations (1)

6: Step R1A2B: use B2A Generator to revert the B domain picture we generated in step 1 to A domain

7: Step G2A2B: update A2B Generator from generator lossA2B by equations (2)

8: Step D2A2B: update A2B descriptor from descriptor lossA2B by equations (3)

9: Step R2A2B: update A2B Generator from cycle-consistency lossA2Bv by L1 distance

10: Step G1B2A: use B2A Generator to generate B domain picture from A

11: Step D1B2A: use B2A Langevin revision to revise the picture generated from step 4 by equations (1)

12: Step R1B2A: use A2B Generator to revert the A domain picture we generated in step 4 to B domain

13: Step G2B2A: update B2A Generator from generator lossB2A by equations (2)

14: Step D2B2A: update B2A descriptor from descriptor lossB2A by equations (3)

15: Step R2B2A: update B2A Generator from cycle-consistency lossB2A by L1 distance

16: Let t ← t + 1

17: until t = T

4.3.1 Step 0: random choose two different domain picture

In step 0, we randomly choose a labeled picture as our input of our generator. Later our generator can help us to generate a target picture form the original label picture.

4.3.2 Step G1: use Generator to generate B, A domain picture from A, B

We had already got the original label picture in step 0, we use this picture as our input and put it into our generator. We use our generator to change this original label picture to target picture by generator neural networks. The details of the generator you can see in Figure 5. Figure 5 shows the convolution and transpose-convolution of how we do in these steps. Then we will get an ”initial generated picture” as output in this step.

4.3.3 Step D1: use Langevin revision to revise the picture generated from step 1, 4

In step 3, we will revise our ”initial generated picture” by the Langevin revision dynamics algorithm. The details of the Langevin revision algorithm shows in equation 1. We will get the revised versions of the picture, ”revised generated picture”. This will be the output of this step.

4.3.4 Step R1: use another Generator to revert the B, A domain picture we generated in step 1, 4 to A, B domain

We had already got the original label picture in step 0, we use this picture as our input and put it into our generator. We use our generator to change this original label picture to target picture by generator neural networks. The details of the generator you can see in Figure 5. Figure 5 shows the convolution and transpose-convolution of how we do in these steps. Then we will get an ”initial generated picture” as output in this step.

Figure 11 show how our Algorithm step 7-12, we will update our generator and de-scriptor.

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

Figure 11: The update steps of our model

4.3.5 Step G2: update Generator from generator loss

In steps 7, 8, we used another Monte Carlo approximation equations to update our gener-ator parameters α followed by equation 3. The genergener-ator loss calculated by this equation will help us to update our generator variables. The main goal we are trying to minimize the loss between ”initial generated picture” and ”revised generated picture.

After repeatedly learning, we will have nice descriptor results and generator results.

These outcomes will be the main goals of our work. It can help us to do any pictures translation by paired data.

4.3.6 Step D2: update descriptor from descriptor loss

After finish all steps before, we need to update parameter θ, θ is the parameter control how descriptor updated, so our model can learn the features of a picture, and can be improved in next training steps. We use ”revised generated picture” compared with the

”real picture”.

First, We use the descriptor to generate ”described revised picture” from ”revised generated picture” and generate ”described real picture” from the ”real picture”. Figure 7

shows the details of the descriptor structure and how we do it in the layer in this step.

We will have two outputs ”described the revised picture” and ”described real picture”

from our descriptor.

Then, by using the Monte Carlo approximation algorithm to calculate the loss between

”described revised picture” and ”described real picture” following by equation 2. We use the descriptor loss generated by this equation to update our descriptor learning parameter.

4.3.7 Step R2: update Generator from cycle-consistency loss

In steps 7, 8, we used another Monte Carlo approximation equations to update our gener-ator parameters α followed by equation 3. The genergener-ator loss calculated by this equation will help us to update our generator variables. The main goal we are trying to minimize the loss between ”initial generated picture” and ”revised generated picture.

After repeatedly learning, we will have nice descriptor results and generator results.

These outcomes will be the main goals of our work. It can help us to do any pictures of Image-to-Image translation.