当前位置:网站首页>Gan: generate adversarial networks
Gan: generate adversarial networks
2022-07-29 08:17:00 【The way of code】
1 principle
For generating countermeasure networks GAN, A simple understanding is that it can be seen as the process of game , We can regard the generative model and the discriminant model as two sides of the game , For example, in the process of criminals making counterfeit money and police identifying counterfeit money :
- Generate models G Equivalent to the party making counterfeit money , The purpose is based on the coins seen and the identification technology of the police , Try to generate more real 、 Counterfeit money that the police can't identify .
- Discriminant model D Equivalent to identifying counterfeit money , Its purpose is to identify the counterfeit money made by criminals as much as possible . In this way, through the contest between the counterfeiter and the counterfeiter and the improvement towards the goal , So that the final generation model can be as real as possible 、 Those who can't judge the true and false Nash equilibrium effect ( The probability of true and false currency is 0.5).
2 Training
generator G Our goal is to cheat the discriminator D, The goal is to be able to distinguish between real data and generated data . therefore , When training the generator , We want to maximize the error , At the same time, we want to minimize the error of the discriminator .
2.1 Discriminant model
The objective function is :
m a x D E x − p r [ l o g D ( x ) ] + E z − p g [ l o g ( 1 − D ( x ) ) ] max_D E_{x-p_r} [logD(x)]+E_{z-p_g } [log(1-D(x))] maxDEx−pr[logD(x)]+Ez−pg[log(1−D(x))]
among D(x) It is the output of the discrimination model , It's a 0-1 Real values in the range , The probability used to judge whether the picture is a real picture , among Pr and Pg It represents the distribution of the real image and the data distribution of the generated image , It can be seen that the objective function is to find the discriminant model function that maximizes the sum of the following two formulas D(z), The latter two formulas are an addition form , among :
E x − p r [ l o g D ( x ) ] E_{x-p_r} [logD(x)] Ex−pr[logD(x)]
It refers to putting real data into the discriminant model D(x) The output calculated value and the whole formula value should be as large as possible .
E z − p g [ l o g ( 1 − D ( x ) ) ] E_{z-p_g } [log(1-D(x))] Ez−pg[log(1−D(x))]
Make the fake data put into the discrimination model D(x) The calculated value of the output is as small as possible and the value of the whole formula is as large as possible .
This integration is to make the objective function as large as possible , Therefore, during training, gradient lifting can be carried out according to the objective function .
2.2 Generate models
The goal is to make the discriminant model unable to distinguish between real pictures and generated pictures , The objective function is :
m i n g ( m a x D E x − p r [ l o g D ( x ) ] + E z − p g [ l o g ( 1 − D ( x ) ) ] ) min_g (max_D E_{x-p_r} [logD(x)]+E_{z-p_g } [log(1-D(x))]) ming(maxDEx−pr[logD(x)]+Ez−pg[log(1−D(x))])
That is, find the generating function g(z) Make the objective function of the generated model as small as possible .
Learn more about programming , Please pay attention to my official account :

边栏推荐
- Noise monitoring and sensing system
- torch.Tensor和torch.tensor的区别
- Unity beginner 4 - frame animation and protagonist attack (2D)
- Implementation of simple cubecap+fresnel shader in unity
- Inclination sensor accuracy calibration test
- STM32 MDK (keil5) contents mismatch error summary
- Unicode私人使用区域(Private Use Areas)
- Mysql rownum 实现
- 125kHz wake-up function 2.4GHz single transmitter chip-si24r2h
- Hal learning notes - Advanced timer of 7 timer
猜你喜欢

Temperature acquisition and control system based on WiFi

Solve the problem of MSVC2017 compiler with yellow exclamation mark in kits component of QT
![[academic related] why can't many domestic scholars' AI papers be reproduced?](/img/1a/7b162741aa7ef09538355001bf45e7.png)
[academic related] why can't many domestic scholars' AI papers be reproduced?

Explanation and closing method of server 135, 137, 138, 139, 445 and other ports

Simplefoc parameter adjustment 1-torque control

Simple calculator wechat applet project source code

MySQL中的时间函数
![[beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient](/img/d1/5b980d8b9580b9808b2b3f51d5b9c6.png)
[beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient

Alibaba political commissar system - Chapter 1: political commissars are built on companies

Segment paging and segment page combination
随机推荐
华为无线设备配置利用WDS技术部署WLAN业务
Simplefoc parameter adjustment 3-pid parameter setting strategy
torch.Tensor和torch.tensor的区别
[academic related] why can't many domestic scholars' AI papers be reproduced?
Network Security Learning chapter
Data warehouse layered design and data synchronization,, 220728,,,,
What is Amazon self support number and what should sellers do?
Unity shader learning (VI) achieving radar scanning effect
BiSeNet v2
Cs4344 domestic substitute for dp4344 192K dual channel 24 bit DA converter
Inclination sensor is used for long-term monitoring of communication tower and high-voltage tower
110 MySQL interview questions and answers (continuously updated)
Intelligent temperature control system
[robomaster] control RM motor from scratch (2) -can communication principle and electric regulation communication protocol
Unicode私人使用区域(Private Use Areas)
Arduino uno error analysis avrdude: stk500_ recv(): programmer is not responding
Eps32+platform+arduino running lantern
Simplefoc parameter adjustment 2- speed and position control
STM32 detection signal frequency
Hal library learning notes - 8 concept of serial communication