An optimized deployment system and method based on a MAD-GAN algorithm
Patent Information
- Application Number
- CN202410185638.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-20
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2044-02-20
AI Technical Summary
其隐式的训练方式给软件加速带来困难,同时GAN存在模式崩溃问题,即生成器倾向于生成特定类型数据来骗过判别器导致失去多样性样本生成能力
[0016]本发明的优点在于:本发明充分利用了MAD-GAN中生成器和判别器不完全同步的特点设计流水,可以显著加速MAD-GAN算法训练速度,但对存储容量提出较高要求。此外,该设计从硬件上保证了GAN网络建议的交替运算模式,而不需要软件进行额外设计,进一步提高了模型友好性。
Smart Images

Figure CN118333111B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an optimized deployment system and method based on the MAD-GAN algorithm, belonging to the field of artificial intelligence technology. Background Technology
[0002] Classification and generation are two important application areas of artificial intelligence. Classification involves adding labels to input data according to standards, while generation involves generating complete audio, images, or other content based on feature tensors input by the user. Classification and generation models can be built in various ways, among which GAN models have great potential in end-to-end generation tasks, while also producing excellent discriminators (special classifiers) as byproducts.
[0003] GANs consist of a generator and a discriminator. They train G by mutually improving each other through a game-like interaction, ultimately reaching a Nash equilibrium. This training method can significantly improve training accuracy and speed, but it also has many problems. Its implicit training method makes software acceleration difficult, and GANs suffer from pattern collapse, where the generator tends to generate specific types of data to fool the discriminator, resulting in a loss of the ability to generate diverse samples. Currently, there is a lack of effective solutions to these problems. Summary of the Invention
[0004] The purpose of this invention is to provide an optimized deployment system and method based on the MAD-GAN algorithm, which improves training speed and ensures the portability and scalability of the model.
[0005] To achieve the above objectives, the present invention employs the following technical solution: Includes: bus control unit, discriminator, and generator; The bus control unit is configured to control the half-duplex generator data bus, half-duplex gradient data bus, mode selection bus, data status bus, parameter status bus, and global reset interrupt signal; and to receive the generator sample write enable and parameter transmission completion flag generated by the generator, and the parameter write flag and sample transmission completion flag generated by the comparator. The generator monitors the changes in the data state bus, parameter state bus, and mode selection bus, and generates samples based on generator parameters and randomly generated noise vectors. It then sends the sample data to the half-duplex generator data bus. The generator reads the perceived value of the generated samples from the half-duplex gradient data bus and updates the generator parameters using a gradient descent strategy based on the generator parameter update strategy. Finally, it generates a sample write enable flag and a parameter transmission completion flag. The comparator monitors the changes in the data status bus, parameter status bus, and mode selection bus, reads sample data from the half-duplex generator data bus, calculates the evaluation value and the perceived value of the generated sample based on the current comparator parameters and softmax parameters, writes the perceived value of the generated sample into the half-duplex gradient data bus according to the status of the parameter status bus, and generates a parameter write flag and a sample transmission completion flag.
[0006] Preferably, the generator includes: a generator control core, a generator parameter storage unit, a generator pulse matrix calculation acceleration unit, and a generator gradient acceleration unit.
[0007] Preferably, the generator control core is used to monitor the changes in the data status bus and parameter status bus, generate a noise vector, and the noise vector is random noise or conditional noise; control the sample generation mode and parameter update according to the control mode selection signal in the mode selection bus; the generator control core can also perform a partial reset of the entire generator. The generator gradient acceleration unit is used to acquire the perceived value of the generated sample on the half-duplex gradient data bus and update the generator parameters according to the generator parameter update strategy using the gradient descent strategy, and store the generator parameters in the generator parameter storage unit. The generator parameter storage unit is used to store generator parameters; The generator matrix calculation unit calculates the sample data using the noise vector and generator parameters.
[0008] Preferably, the discriminator includes: a discriminator control core, a discriminator parameter storage unit, a discriminator gradient cache unit, a dataset storage unit, a discriminator matrix calculation unit, and a discriminator gradient acceleration unit.
[0009] Preferably, the discriminator control core is used to monitor the changes in the data status bus and parameter status bus; The discriminator parameter storage unit stores the comparator parameters and the softmax parameter; The dataset storage unit stores the actual samples; The matrix calculation unit reads the sample data in the half-duplex generator data bus according to the changes in the data state bus monitored by the discriminator, accesses the actual sample and the current mode comparator parameters and softmax parameters, calculates the evaluation value and the perceived value of the generated sample; sends the evaluation value to the discriminator gradient cache unit, and sends the perceived value of the generated sample to the half-duplex gradient data bus. The discriminator gradient caching unit is used to cache the evaluation values; The discriminator gradient acceleration unit is used to obtain the evaluation value and update the discriminator parameters using a gradient descent strategy according to the discriminator parameter update strategy, and store the discriminator parameters in the discriminator parameter storage unit.
[0010] A method for optimizing a deployment system based on the MAD-GAN algorithm, comprising: Initialize; divide the requirements and generate samples into k modes, set the system to the default state, where the data bus data is in an undefined state, the data state bus and parameter state bus are set to 0, and the mode selection bus is set to 0; The generator generates samples; the generator monitors the data status bus, parameter status bus and mode selection bus status in real time, accesses the generator parameters and randomly generates noise vectors in memory access mode i, and obtains sample data through the matrix calculation unit; the sample data is written to the half-duplex generator data bus. Discriminator evaluation; The discriminator monitors the data status bus, parameter status bus and mode selection bus status in real time, reads the data in the half-duplex generator data bus, and accesses the comparator parameters and softmax parameters in the current mode. Through the matrix calculation unit, it obtains the evaluation value and the perceived value of the generated sample, performs gradient operation on the evaluation value and caches it, and writes the perceived value of the generated sample into the half-duplex gradient data bus. Discriminator update; update the discriminator parameters, and then proceed to the next cycle after the update is complete.
[0011] Preferably, the generator sample generation method is as follows: The generator monitors the data status bus, parameter status bus, and mode selection bus status in real time. If the mode selection bus is detected to be non-zero and transition to mode i, the mode selection signal is set to i, and the generator parameters in mode i are accessed from the memory parameter storage unit. At the same time, a noise vector is randomly generated. Used for sample generation; Will and Input matrix calculation unit to generate samples ; If the monitored data status bus is 0, then pull the sample write enable high and... Write to the half-duplex generator data bus. After writing is complete, pull the sample write enable low again. The bus control unit pulls the data status bus high and sets the value of the mode selection bus to i+1. When the value of the mode selection bus is greater than k, set the value of the mode selection bus to 0. If the parameter status bus is detected as 1, then read the perceived value of the generated sample from the half-duplex gradient data bus. After the reading is complete, the generator control core sends a parameter transmission completion flag pulse to the bus control unit. The bus control unit then pulls the parameter status bus low. The generator updates the generator parameters for mode i using a gradient descent strategy according to the generator parameter update strategy. For the mode i generator, its objective function is... , where E represents expectation.
[0012] Preferably, the discriminator evaluation method is as follows: The discriminator monitors the data status bus, parameter status bus, and mode selection bus status in real time. If the data status bus is detected to be 1, it reads the data status from the half-duplex generator's data bus. After the data is received, the judgment control core generates a sample transmission completion flag pulse to the bus control unit, and the bus control unit pulls the data status bus low. The discriminator distinguishes whether a sample comes from an actual sample or a generator. The discriminator perceptron is a k+1 dimensional vector, where the first k dimensions correspond to the probabilities of the sample coming from k generators, and the parameters are the comparator parameters. The (k+1)th dimension represents the probability that the sample comes from the actual dataset, and is a softmax parameter. .
[0013] The comparator parameters in the current mode of the judgment access are... and softmax parameters The evaluation value is obtained through the matrix calculation unit. and the perceived value of the generated sample The evaluated values are then cached after gradient calculation. If the parameter state bus is 0, then write to the half-duplex gradient data bus. After the transmission is completed, the judgment controller core generates a parameter write flag pulse to the bus control unit, and the bus control unit pulls the parameter status bus high. Preferably, the discriminator is updated in the following specific way: Sample data of pattern k Transmitted to the discriminator and an evaluation value is generated. Then, the mode selection bus is 0, the parameter update of the discriminator is entered, and reading data on the half-duplex generator data bus is prohibited; The discriminator samples actual samples in the dataset storage unit. After passing through the matrix calculation unit, the actual sample is obtained. Perceived value The discriminator parameters are then updated according to the gradient ascent strategy. Based on the discriminator-based perceptron, its objective function is to minimize the cross-entropy between the D and δ functions, specifically: ;in, These are the network parameters of the discriminator perceptron; Once all k+1 parameters have been updated, the reading of the half-duplex generator data bus will resume, and the entire system will enter the next cycle.
[0014] Preferably, when the bus controller detects that the sample write enable has been pulled high, it means that the current generator has completed sample generation. If the sample write enable is pulled low again, it indicates that the generator has completed its write access to the half-duplex generator data bus. Therefore, the data status bus is pulled high to allow the discriminator to read the half-duplex generator data bus data, and the mode selection bus value is incremented by 1. The generator for the next mode begins sample generation. If the mode selection bus value is greater than k, the mode selection bus is set to 0. When a sample transmission completion flag pulse is detected, it indicates that the transmission is complete and the half-duplex generator data bus is idle. The data status bus is then pulled low, and the generated samples for the next mode are allowed to enter the bus.
[0015] Regarding the parameters, when a parameter write flag pulse is detected, it indicates that a gradient function needs to be received by the generator. The generator then raises the parameter state bus, allowing it to access the half-duplex gradient data bus. When a parameter transmission completion flag pulse is detected, it indicates that the gradient function has been received. The generator then lowers the parameter state bus and waits again for the discriminator to write the gradient function.
[0016] The advantages of this invention are as follows: This invention fully utilizes the characteristic of the generator and discriminator not being completely synchronized in MAD-GAN to design a pipeline, which can significantly accelerate the training speed of the MAD-GAN algorithm, but places higher demands on storage capacity. Furthermore, this design guarantees the alternating computation mode proposed by the GAN network from a hardware perspective, without requiring additional software design, further improving model friendliness. Attached Figure Description
[0017] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0018] Figure 1 A schematic diagram of the deployment platform system.
[0019] Figure 2 This is a schematic diagram of the state machine transitions of the generator.
[0020] Figure 3 This is a schematic diagram of the state machine transition of the discriminator.
[0021] Figure 4 This is the state machine transition diagram for the bus controller.
[0022] Figure 5 This is a timing diagram of the platform deployment pipeline.
[0023] Figure 6 A flowchart illustrating the methods for optimizing system deployment. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Example 1 like Figure 6 As shown, a method for optimizing a deployment system based on the MAD-GAN algorithm includes: S1: Initialization; Divide the requirements to generate k samples in different modes, set the system to the default state, where the data bus data is in an undefined state, STATUS_D and STATUS_P are pulled down to 0, indicating that DATA_G and PARA buses are both writable, and ADDR is set to 0, meaning the current working mode is mode 0.
[0026] S2: Generator sample generation; The generator monitors the STATUS_D, STATUS_P and ADDR status in real time, the generator parameters of memory access mode i and randomly generate noise vectors, and obtains sample data through the matrix calculation unit; The sample data is written to DATA_G.
[0027] Specifically, the solution in this embodiment is as follows: Figure 2 As shown, the generator sample generation method is as follows: The generator monitors the STATUS_D, STATUS_P, and ADDR states in real time. If a non-zero ADDR value is detected, the generator transitions to mode i. Then, the mode selection signal is set to i, and the generator parameters for mode i are stored in the memory access parameter storage unit. At the same time, a noise vector is randomly generated. Used for sample generation.
[0028] Will and Input matrix calculation unit to generate samples .
[0029] If STATUS_D is detected to be 0, then WR_EN_D is pulled high, and... Write DATA_G. After writing, pull WR_EN_D low again and pull STATUS_D high. At the same time, set the value of ADDR to i+1. If the value of ADDR is greater than k, set the value of ADDR to 0.
[0030] If STATUS_P=1 is detected, then read the perceived value of the generated sample from the PARA bus. After reading, the generator control core generates a DONE_P pulse to the bus control unit and pulls STATUS_P low. The generator updates the generator parameters of mode i according to the generator parameter update strategy, using a gradient descent strategy. For the mode i generator, its objective function is... , where E represents expectation.
[0031] S3: Discriminator evaluation; The discriminator monitors the STATUS_D, STATUS_P and ADDR states in real time, reads the data in DATA_G, and accesses the comparator parameters and softmax parameters in the current mode. Through the matrix calculation unit, it obtains the evaluation value and the perceived value of the generated sample. After performing gradient calculation on the evaluation value, it is cached, and the perceived value of the generated sample is written to PARA.
[0032] Specifically, the solution in this embodiment is as follows: Figure 3 As shown, the discriminator is evaluated in the following way: The discriminator monitors the STATUS_D, STATUS_P, and ADDR status in real time. If STATUS_D is detected as 1, it reads the data from DATA_G. After receiving the data, the judgment controller core generates a DONE_D pulse to the bus control unit and pulls STATUS_D low.
[0033] The discriminator distinguishes whether a sample comes from an actual sample or a generator. The discriminator perceptron is a k+1 dimensional vector, where the first k dimensions correspond to the probabilities of the sample coming from k generators, and the parameters are the comparator parameters. The (k+1)th dimension represents the probability that the sample comes from the actual dataset, and is a softmax parameter. .
[0034] The comparator parameters in the current mode of the judgment access are... and softmax parameters The evaluation value is obtained through the matrix calculation unit. and the perceived value of the generated sample The evaluation values are then cached after gradient calculation.
[0035] If STATUS_P is 0, then write to PARA. After the transmission is completed, the judgment controller core generates a WR_EN_P pulse to the bus control unit and pulls STATUS_P high.
[0036] S4: Discriminator update; Update the discriminator parameters, and enter the next loop cycle after the update is completed.
[0037] Specifically, the solution in this embodiment is as follows: Figure 4 As shown, the discriminator is updated in the following specific way: Sample data of pattern k Transmitted to the discriminator and an evaluation value is generated. Afterwards, ADDR is 0, and the parameter update of the discriminator is initiated, prohibiting the reading of data on DATA_G.
[0038] The discriminator samples actual samples in the dataset storage unit. After passing through the matrix calculation unit, the actual sample is obtained. Perceived value The discriminator parameters are then updated according to the gradient ascent strategy.
[0039] Based on the discriminator-based perceptron, its objective function is to minimize the cross-entropy between the D and δ functions, specifically: ;in, These are the network parameters of the discriminator perceptron.
[0040] The discriminator parameters are updated according to the gradient ascent strategy, when After all the dimension parameters have been updated, the reading of DATA_G will resume, and the entire system will enter the next cycle.
[0041] When the bus controller detects WR_EN_D going high, it means the current generator has completed sample generation. If WR_EN_D is pulled low again, it indicates the generator has completed writing to DATA_G. Therefore, STATUS_D is pulled high to allow D to read DATA_G data, and ADDR is set to ADDR+1. The next generator mode begins sample generation. If ADDR>k, ADDR is set to 0. When the DONE_D pulse is detected, it indicates the transfer is complete and the DATA_G bus is idle. STATUS_D is then pulled low, allowing the next generator mode's sample to enter the bus.
[0042] Regarding the parameters, when a WR_EN_P pulse is detected, it indicates that a gradient function needs to be received by the generator, so STATUS_P is pulled high, allowing the generator to access PARA. When a DONE_P pulse is detected, it indicates that the gradient function has been received, so STATUS_P is pulled low, and the generator waits again for D to write the gradient function.
[0043] It should be noted that when the bus control unit detects WR_EN_D going high, it indicates that the current generator has completed sample generation. If WR_EN_D is pulled low again, it means that the generator has completed its write access to DATA_G. Therefore, STATUS_D is pulled high to allow D to read DATA_G data, and ADDR is set to ADDR+1. The generator for the next mode begins sample generation. If ADDR>k, then ADDR=0. When the DONE_D pulse is detected, it indicates that the transmission is complete and the DATA_G bus is idle. STATUS_D is then pulled low, allowing the generated samples for the next mode to enter the bus.
[0044] Regarding the parameters, when a WR_EN_P pulse is detected, it indicates that a gradient function needs to be received by the generator, so STATUS_P is pulled high, allowing the generator to access PARA. When a DONE_P pulse is detected, it indicates that the gradient function has been received, so STATUS_P is pulled low, and the generator waits again for D to write the gradient function.
[0045] like Figure 5 As shown, the core idea of the entire system is to design a pipeline structure that leverages the k:1 parameter update frequency of the generator and discriminator in MAD-GAN to maximize the utilization of each unit. The pipeline time diagram is shown below.
[0046] This timing diagram assumes that the computational complexity of each pattern sample is the same. Although the diagram does not consider latency due to factors such as transmission, it can be seen that each cycle reverts to a relatively regular pipeline. Furthermore, since the discriminator performs end-to-end feature comparisons, the actual discriminator-related operations should be faster than the generator operations.
[0047] Since the data between the various pipelines in the design are interdependent and there are enable signals, transmission delays, and computation time deviations, these factors will only affect the overall computation speed of the pipeline and will not affect the functionality.
[0048] The timing misalignment of the generator matrix calculation unit in the second cycle diagram is due to the fact that after the M0 sample is generated, the sample data is uploaded to the bus, and the matrix calculation unit buffer is cleared. Although the bus state machine waits for the DONE_G signal for further transition, the generator state machine has already entered the second cycle, generated the M1 sample for the next mode, and stored it in the generator buffer. If the discriminator has not yet finished receiving the M0 sample data at this time, the generator state machine will stop transitioning due to the high level of STATUS_D until the reception is complete, thus preventing functional and data errors.
[0049] This design fully leverages the non-synchronous nature of the generator and discriminator in MAD-GAN to create a pipeline, significantly accelerating the training speed of the MAD-GAN algorithm, but placing high demands on storage capacity. Furthermore, this design guarantees the alternating computational pattern proposed by the GAN network from a hardware perspective, without requiring additional software design, further improving model friendliness.
[0050] Example 2 like Figure 1 As shown, an optimized deployment system based on the MAD-GAN algorithm includes: a bus control unit, a discriminator, and a generator.
[0051] The bus control unit is configured to control the half-duplex generator data bus DATA_G, the half-duplex gradient data bus PARA, the mode selection bus ADDR, the data status bus STATUS_D, the parameter status bus STATUS_P, and the global reset interrupt signal RESET_GLOBAL; and to receive the generator's generated sample write enable WR_EN_D, the parameter transmission completion flag DONE_P, the comparator's generated parameter write flag WR_EN_P, and the sample transmission completion flag DONE_D.
[0052] The generator monitors the changes in STATUS_D, STATUS_P, and ADDR, generates samples based on generator parameters and randomly generated noise vectors, and sends the sample data to DATA_G; it reads the perceived value of the generated samples on PARA and updates the generator parameters using a gradient descent strategy based on the generator parameter update strategy; and it generates a sample write enable flag and a parameter transmission completion flag.
[0053] The comparator monitors the changes in STATUS_D, STATUS_P, and ADDR, reads the sample data of DATA_G, and calculates the evaluation value and the perceived value of the generated sample based on the current comparator parameters and softmax parameters. Based on the state of STATUS_P, it writes the perceived value of the generated sample into PARA; and generates a parameter write flag and a sample transmission completion flag.
[0054] The generator includes a generator control core, a generator parameter storage unit, a generator impulse matrix calculation acceleration unit, and a generator gradient acceleration unit. The generator control core monitors the changing states of STATUS_D and STATUS_P, generates a noise vector (random or conditional noise), and controls the sample generation mode and parameter updates according to the control mode selection signal in ADDR. The generator control core can also perform a local reset of the entire generator. The generator gradient acceleration unit acquires the perceived values of the generated samples on PARA and updates the generator parameters using a gradient descent strategy according to the generator parameter update strategy, storing the generator parameters in the generator parameter storage unit. The generator parameter storage unit stores the generator parameters. The generator matrix calculation unit calculates the sample data using the noise vector and the generator parameters.
[0055] The discriminator includes: a discriminator control core, a discriminator parameter storage unit, a discriminator gradient cache unit, a dataset storage unit, a discriminator matrix calculation unit, and a discriminator gradient acceleration unit. The discriminator control core monitors the changes in STATUS_D and STATUS_P. The discriminator parameter storage unit stores comparator parameters and softmax parameters. The dataset storage unit stores actual samples. The matrix calculation unit reads sample data from DATA_G based on the changes in STATUS_D monitored by the discriminator, accesses the actual samples and the current mode comparator parameters and softmax parameters, and calculates the evaluation value and the perceived value of the generated samples. The evaluation value is sent to the discriminator gradient cache unit, and the perceived value of the generated samples is sent to PARA. The discriminator gradient cache unit caches the evaluation value. The discriminator gradient acceleration unit obtains the evaluation value and updates the discriminator parameters using a gradient descent strategy according to the discriminator parameter update strategy, and stores the discriminator parameters in the discriminator parameter storage unit.
[0056] This disclosure also provides an optimized deployment apparatus based on the MAD-GAN algorithm, including a processor and a memory. Optionally, the apparatus may further include a communication interface and a bus. The processor, communication interface, and memory can communicate with each other via the bus. The communication interface can be used for information transmission. The processor can call logical instructions in the memory to execute the optimized deployment method based on the MAD-GAN algorithm described in the above embodiments.
[0057] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.
[0058] Memory, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor executes the program instructions / modules stored in the memory to perform functional applications and data processing, thereby realizing the optimized deployment method based on the MAD-GAN algorithm in the above embodiments.
[0059] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory may include high-speed random access memory and may also include non-volatile memory.
[0060] This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to execute the aforementioned optimized deployment method based on the MAD-GAN algorithm.
[0061] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0062] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code. It can also be a transient storage medium.
[0063] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An optimized deployment method based on the MAD-GAN algorithm, characterized in that, include: Initialization includes dividing the requirements to generate samples into k modes, setting the system to the default state, where the data bus data is in an undefined state, the data state bus and parameter state bus are set to 0, and the mode selection bus is set to 0; The generator sample generation includes real-time monitoring of the changes in the state of the data state bus, parameter state bus, and mode selection bus, and accessing the generator parameters and randomly generated noise vector of mode i. The generator parameters and randomly generated noise vector of mode i are used to obtain sample data through the matrix calculation unit. The sample data is also written to the half-duplex generator data bus. The discriminator evaluation includes real-time monitoring of the discriminator's data status bus, parameter status bus, and mode selection bus status; reading data from the half-duplex generator data bus; and accessing the comparator parameters and softmax parameters in the current mode. The comparator parameters and softmax parameters are processed by the matrix calculation unit to obtain the evaluation value and the perceived value of the generated sample. The evaluation value is cached after gradient operation, and the perceived value of the generated sample is written to the half-duplex gradient data bus. Discriminator update includes updating discriminator parameters, and after the update is completed, the next cycle begins; the specific method of discriminator update is as follows: Sample data of pattern k Transmitted to the discriminator and an evaluation value is generated. Then, the mode selection bus is 0, the parameter update of the discriminator is entered, and reading data on the half-duplex generator data bus is prohibited; The discriminator samples actual samples in the dataset storage unit. Actual sample After the matrix calculation unit, the actual sample is obtained. Perceived value The discriminator parameters are then updated according to the gradient ascent strategy. Based on the structure of the discriminator perceptron, its objective function is to maximize the following objective function: ; in, Here are the network parameters of the discriminator perceptron, and E represents the desired value. This indicates that an evaluation value has been obtained; Once all k+1 parameters have been updated, the reading of the half-duplex generator data bus will resume, and the entire system will enter the next cycle.
2. The optimized deployment method based on the MAD-GAN algorithm according to claim 1, characterized in that, The specific method for generating samples by the generator is as follows: The generator monitors the data status bus, parameter status bus, and mode selection bus status in real time. If the mode selection bus is detected to be non-zero and transition to mode i, the generator sets the mode selection signal to i and accesses the generator parameters stored in the parameter storage unit under mode i. At the same time, a noise vector is randomly generated. Used for sample generation; Will and Input matrix calculation unit to generate samples ; If the monitored data status bus is 0, then pull the sample write enable high and... Write to the half-duplex generator data bus. After writing is complete, pull the sample write enable low again. The bus control unit pulls the data status bus high and sets the value of the mode selection bus to i+1. When the value of the mode selection bus is greater than k, set the value of the mode selection bus to 0. If the parameter state bus is detected to be 1, then read the perceived value of the generated sample from the half-duplex gradient data bus. After the reading is complete, the generator control core sends a parameter transmission completion flag pulse to the bus control unit. The bus control unit then pulls the parameter status bus low. The generator updates the generator parameters for mode i using a gradient descent strategy according to the generator parameter update strategy. For the mode i generator, its objective function is: , Where E represents expectation.
3. The optimized deployment method based on the MAD-GAN algorithm according to claim 2, characterized in that, The specific evaluation method of the discriminator is as follows: The discriminator monitors the changes in the data status bus, parameter status bus, and mode selection bus in real time. If the data status bus is detected to be 1, it reads the data from the half-duplex generator's data bus. After the data is received, the judgment control core generates a sample transmission completion flag pulse to the bus control unit, and the bus control unit pulls the data status bus low. The discriminator distinguishes whether a sample comes from an actual sample or a generator. The discriminator perceptron is a k+1 dimensional vector, where the first k dimensions correspond to the probabilities of the sample coming from k generators, and the parameters are the comparator parameters. The (k+1)th dimension represents the probability that the sample comes from the actual dataset, and is a softmax parameter. ; Discriminator accesses comparator parameters in current mode and softmax parameters The evaluation value is obtained through the matrix calculation unit. and the perceived value of the generated sample The evaluated values are then cached after gradient calculation. If the parameter state bus is 0, then write to the half-duplex gradient data bus. After the transmission is completed, the judgment controller core generates a parameter write flag pulse to the bus control unit, and the bus control unit pulls the parameter status bus high.
4. The optimized deployment method based on the MAD-GAN algorithm according to claim 3, characterized in that, When the bus controller detects that the sample write enable has been pulled high, it indicates that the current generator has completed sample generation. If the sample write enable is pulled low again, it means that the generator has completed the write access to the half-duplex generator data bus. Therefore, the data status bus is pulled high to allow the discriminator to read the half-duplex generator data bus data, and the mode selection bus value is incremented by 1. The generator of the next mode starts sample generation. If the mode selection bus value is greater than k, the mode selection bus value is set to 0. When the sample transmission completion flag pulse is detected, it indicates that the transmission is complete and the half-duplex generator data bus is idle. Then, the data status bus is pulled low, and the generated sample for the next mode is allowed to enter the bus. Regarding the parameters, when a parameter write flag pulse is detected, it indicates that there is a gradient function that the generator needs to receive. In this case, the parameter state bus is pulled high, allowing the generator to access the half-duplex gradient data bus. When a parameter transmission completion flag pulse is detected, it indicates that the gradient function has been received. In this case, the parameter state bus is pulled low, and the generator waits again for the discriminator to write the gradient function.
5. An optimized deployment system based on the MAD-GAN algorithm using the method described in any one of claims 1-4, characterized in that, include: Bus control unit, discriminator, and generator; The bus control unit is configured to control the half-duplex generator data bus, the half-duplex gradient data bus, the mode selection bus, the data status bus, the parameter status bus, and the global reset interrupt signal. It also receives the generated sample write enable and parameter transmission complete flag generated by the generator, and the parameter write flag and sample transmission complete flag generated by the discriminator. The generator monitors the changes in the data state bus, parameter state bus, and mode selection bus, and generates samples based on generator parameters and randomly generated noise vectors, and sends the sample data to the half-duplex generator data bus; it reads the perceived value of the generated samples on the half-duplex gradient data bus and updates the generator parameters using a gradient descent strategy based on the generator parameter update strategy. Generate a write enable flag for generated samples and a flag indicating that parameter transmission is complete; The discriminator reads sample data from the half-duplex generator data bus by monitoring the changes in the data state bus, parameter state bus, and mode selection bus, and calculates the evaluation value and the perceived value of the generated sample based on the current comparator parameters and softmax parameters. Based on the state of the parameter state bus, the perceived value of the generated sample is written into the half-duplex gradient data bus. Generate parameter write flag and sample transmission complete flag.
6. The optimized deployment system based on the MAD-GAN algorithm according to claim 5, characterized in that, The generator includes: a generator control core, a generator parameter storage unit, a generator pulse matrix calculation acceleration unit, and a generator gradient acceleration unit.
7. The optimized deployment system based on the MAD-GAN algorithm according to claim 6, characterized in that, The generator control core is used to monitor the changes in the data status bus and parameter status bus, and generate a noise vector, which includes random noise or conditional noise. In addition, the generator control core also performs a partial reset of the entire generator based on the control mode selection signal in the mode selection bus to control the sample generation mode and parameter update. The generator gradient acceleration unit is used to acquire the perceived value of the generated sample on the half-duplex gradient data bus and update the generator parameters according to the generator parameter update strategy using the gradient descent strategy, and store the generator parameters in the generator parameter storage unit. The generator parameter storage unit is used to store generator parameters; The generator pulse matrix calculation acceleration unit calculates sample data using noise vectors and generator parameters.
8. The optimized deployment system based on the MAD-GAN algorithm according to claim 7, characterized in that, The discriminator includes: a discriminator control core, a discriminator parameter storage unit, a discriminator gradient cache unit, a dataset storage unit, a discriminator matrix calculation unit, and a discriminator gradient acceleration unit.
9. The optimized deployment system based on the MAD-GAN algorithm according to claim 8, characterized in that, The discriminator control core is used to monitor the changes in the data status bus and parameter status bus. The discriminator parameter storage unit stores the comparator parameters and the softmax parameter; The dataset storage unit stores the actual samples; The discriminator matrix calculation unit reads sample data from the half-duplex generator data bus according to the changes in the data state bus monitored by the discriminator, accesses the actual sample and the current mode comparator parameters and softmax parameters, calculates the evaluation value and the perceived value of the generated sample; sends the evaluation value to the discriminator gradient cache unit, and sends the perceived value of the generated sample to the half-duplex gradient data bus. The discriminator gradient caching unit is used to cache the evaluation values; The discriminator gradient acceleration unit is used to obtain the evaluation value and update the discriminator parameters using a gradient descent strategy according to the discriminator parameter update strategy, and store the discriminator parameters in the discriminator parameter storage unit.
Citation Information
Patent Citations
Data processing system with two processing units
EP0048972A2
Communication system
JP1991239036A