Method, device and medium for constructing network structure

By using a mutual game method in the GAN network to adjust the weights of the generator and the discriminator, the problem of failing to balance the structure of the generator and the discriminator in the existing technology is solved, the efficiency and accuracy of the construction method are improved, and the image processing is realized. The application effect in the generation field is improved.

CN112508179BActive Publication Date: 2024-10-15SHANGHAI YITU NETWORK SCI & TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202011494199.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-17
Publication Date
2024-10-15
Estimated Expiration
2040-12-17

AI Technical Summary

Technical Problem

During the training process of the GAN network, the search algorithm is slow because it fails to effectively balance the structure and weight of the generator and the discriminator, and the existing methods fail to consider the balance between the generator and the discriminator in the network structure design, which affects Improve construction efficiency and accuracy.

Method used

The weights of the generator and the discriminator of the GAN network are adjusted through mutual games so that the weight of the generator tends to be the smallest and the weight of the discriminator tends to be the largest, thereby maintaining the relationship between the generator and the discriminator in the process of determining the GAN network structure. Balanced to improve the efficiency and accuracy of construction methods.

Benefits of technology

It achieves the balance between the generator and the discriminator when building a GAN network, improves the efficiency and accuracy of the construction method, reduces the search space, and significantly improves the application effect in the field of image generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112508179B_ABST
    Figure CN112508179B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device and medium for constructing a network structure. The method includes: constructing a network structure, where the network structure can be a GAN network, and the GAN network includes a generator and a discriminator; first, training the generator and the discriminator, the generator includes a first generation unit, and the discriminator includes a first discrimination unit; then, adjusting the first generator parameter of the generator and the first discriminator parameter of the discriminator until the first generator parameter is in the first generator numerical range and the first discriminator parameter is in the first discriminator numerical range, using the first generator parameter to update the first generation unit, and using the first discriminator parameter to update the first discrimination unit. The method of the present application can ensure the balance between the generator and the discriminator in the process of determining the structure of the GAN network, and improve the efficiency and accuracy of the construction method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence, and in particular to a method, device and medium for constructing a network structure. Background Art

[0002] Generative Adversarial Networks (GAN) have attracted much attention due to their outstanding performance in generating images. However, the instability of GAN networks during network model training greatly increases the difficulty of architecture design.

[0003] The GAN network includes a generator and a discriminator. Existing methods for building a GAN network are as follows: Figure 1 As shown, the structure and weights for constructing the generator and discriminator are searched from the search space of the generator and discriminator through a search algorithm, and then the performance of the obtained structure and weights of the generator and discriminator is evaluated, that is, the structure and weights of the generator and discriminator are trained to obtain a better structure and weights, and at the same time, the search algorithm is optimized.

[0004] However, in the existing technology, the weights of the generator and discriminator of the searched GAN network are trained separately each time without considering the balance between the structure and weights of the generator and discriminator, which makes the search algorithm very slow. Summary of the invention

[0005] The purpose of the present application is to provide a method, device and medium for constructing a network structure. The method of the present application includes, taking the network structure as a GAN network as an example, adjusting the weights of the generator and the discriminator of the GAN network at the same time through mutual game, thereby optimizing the weights of the generator and the discriminator of the GAN network. The mutual game method here is to make the weight of the generator obtain the smallest possible value, and at the same time, make the weight of the discriminator obtain the largest possible value. Through the method of the present application, the balance between the generator and the discriminator can be guaranteed in the process of determining the structure of the GAN network, and the efficiency and accuracy of the construction method can be improved.

[0006] The first aspect of the present application provides a method for constructing a network structure, characterized in that the method includes: constructing a network structure, the network structure includes a generator and a discriminator; based on random noise and sample data, training the generator and the discriminator, the generator includes a first generation unit, and the discriminator includes a first discriminator unit; obtaining the first generator parameter of the generator and the first discriminator parameter of the discriminator, adjusting the first generator parameter and the first discriminator parameter until the first generator parameter is in the first generator numerical range and the first discriminator parameter is in the first discriminator numerical range, using the first generator parameter to update the first generation unit, and using the first discriminator parameter to update the first discriminator unit.

[0007] In a possible implementation of the first aspect above, adjusting the first generator parameter and the first discriminator parameter until the first generator parameter is within the first generator value range and the first discriminator parameter is within the first discriminator value range is implemented by the following formula,

[0008]

[0009] Among them, α is the first generator parameter, β is the first discriminator parameter, and p data is the sample data, p z is random noise, and the minmax function is used to make the first generator parameter in the first generator value range and the first discriminator parameter in the first discriminator value range.

[0010] That is, in the embodiment of the present application, the network structure may be a GAN network, and E may be the loss of the GAN network. The minmax function is used to minimize α and maximize β.

[0011] In a possible implementation of the first aspect above, based on random noise and sample data, a generator and a discriminator are trained, the generator includes a first generation unit, and the discriminator includes a first discrimination unit, including: based on random noise and sample data, the generator and the discriminator are trained, the generator is used to generate a first image based on random noise, and the discriminator is used to distinguish the first image from the sample data.

[0012] In a possible implementation of the first aspect, after updating the first generator unit using the first generator parameter and updating the first discriminator unit using the first discriminator parameter, the method includes: acquiring a second generator parameter of the generator and a second discriminator parameter of the discriminator;

[0013] Adjust the second generator parameters and the second discriminator parameters until the second generator parameters are within the second generator value range and the second discriminator parameters are within the second discriminator value range, use the second generator parameters to update the second generation unit, and use the second discriminator parameters to update the second discriminator unit.

[0014] In a possible implementation of the first aspect, the generator and the discriminator each include at least two generation units and a discrimination unit.

[0015] In a possible implementation of the first aspect, the minmax function is used to make the first generator parameter and the first discriminator parameter compete with each other to determine the structure of the generator. And the structure of the discriminator

[0016] In a possible implementation of the first aspect above, the mutual game between the first generator parameter and the first discriminator parameter is a minimum-maximum game.

[0017] In a possible implementation of the first aspect, the minimum-maximum game is used to minimize the first generator parameter while maximizing the first discriminator parameter.

[0018] A second aspect of the present application provides a device, comprising:

[0019] A memory storing instructions;

[0020] The processor is coupled to the memory, and when the program instructions stored in the memory are executed by the processor, the device executes the method for constructing a network structure as described in the first aspect above.

[0021] A third aspect of the present application provides a readable medium, in which instructions are stored. When the instructions are executed on the readable medium, the readable medium executes the method for constructing a network structure as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 An example diagram showing a method for constructing a network structure;

[0023] Figure 2 An exemplary diagram showing a method for constructing a network structure in an embodiment of the present application is shown;

[0024] Figure 3 A structural diagram of a generator and a discriminator of a network structure in an embodiment of the present application is shown;

[0025] Figure 4 A structural diagram of an upsampling unit of a generator of a network structure in an embodiment of the present application is shown;

[0026] Figure 5 A flowchart showing a method for constructing a network structure in an embodiment of the present application is shown;

[0027] Figure 6 A block diagram of a network structure construction device in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0028] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0029] In order to solve the problem of the construction method of the network structure of the present application, an algorithm for step-by-step search from shallow to deep layers is adopted, and the network structure here can be a GAN network. The method of the present application includes: first searching for shallow units of the generator and discriminator constituting the GAN network from the search space, and once the shallow units are determined, the searched units are fixed; at the same time, the units of the next layer of the generator and the discriminator are continued to be searched until the structure of the generator and the discriminator is finally determined; at the same time, when determining the searched units, the construction method optimizes the weights of the generator and the discriminator of the GAN network by letting the weights of the generator and the discriminator of the GAN network compete with each other, and further determines the structure of the searched generator and the discriminator. That is, for the weights of the generator and the discriminator, the weight of the generator is made to obtain the smallest possible value, and at the same time, the weight of the discriminator is made to obtain the largest possible value. After calculating and obtaining the results of the weights of the generator and the discriminator, the weights of the generator and the discriminator are kept balanced.

[0030] Therefore, the network structure construction method of the present application can reduce the search space at each stage in the process of determining the structure of the GAN network, while ensuring the balance between the generator and the discriminator, thereby improving the efficiency and accuracy of the construction method.

[0031] The network structure of the present application can be applied in the field of artificial intelligence, especially in the field of image generation, that is, using the GAN network for image generation, such as: virtual digital humans; automatic art creation; image editing; image super-resolution; video interpolation; image completion, etc.

[0032] The following takes image generation as an example to introduce the method for constructing the network structure of this application.

[0033] Since the embodiments of the present application involve the application of a large number of neural networks, in order to facilitate understanding, the relevant terms and concepts of the neural networks that may be involved in the embodiments of the present application are first introduced below.

[0034] (1) A GAN network is a deep learning model. A GAN network can be composed of a generator (G), which can also be called a generative network, and a discriminator (D), which can also be called a discriminative network. The structure of the final GAN ​​network is obtained by adjusting the weights of the generator and the discriminator. It can be understood that the generator can generate an image by inputting uniform noise or Gaussian random noise (0, 1), and the discriminator judges the input image to determine whether it is a real image or an image generated by the generator. For example, the discriminator outputs a probability value in the range of 0-1. When the probability value is 0, it indicates that the input image is a real image. When the probability value is 1, it indicates that the input image is a non-real image (for example, an image generated by the generator).

[0035] (2) Loss Function

[0036] The loss function here is used to evaluate the degree of difference between the model's predicted value and the true value. The better the loss function, the better the model's performance. Different models generally use different loss functions. Common loss functions include 0-1 loss function, absolute value loss function, log loss function, square loss function, Hinge loss function, perceptual loss function, and cross entropy loss function.

[0037] (3) Activation function

[0038] The function that runs on the neurons of the neural network is responsible for mapping the input of the neuron to the output. The activation function introduces nonlinear characteristics into the network, allowing the neural network to arbitrarily approximate any nonlinear function. Activation functions include Sigmoid function, Tanh function, ReLU function, etc.

[0039] (4) Search space

[0040] The GAN network is a model based on a multi-level search strategy. The generator and discriminator can be composed of a series of units, and the collection of these units constitutes the search space of the generator and discriminator. The unit here is used to receive input values ​​and generate output values, where there can be connections between units, that is, the input of the latter unit can be the output of the previous unit. The GAN network establishes connections between a series of units in the search space of the generator and the discriminator through a search algorithm, that is, it continuously searches in the search space of the generator and the discriminator to form the structure of the generator and the discriminator. The units here constitute the structure of the generator and the discriminator described above.

[0041] (5) Neural Architecture Search (NAS) is a method of machine learning that obtains the structure of a neural network through a construction method.

[0042] like Figure 2 As shown, an embodiment of the present invention proposes a method for constructing a network structure.

[0043] First, the structures of the generator and discriminator are generated through their respective search spaces.

[0044] When the structure of the generator 101 is determined by searching the first search space 103, the discriminator 102 will calculate the adversarial loss of the first parameter α of the structure of the generator 101 through the first evaluation module 105. The adversarial loss here can be a loss function, which is used to evaluate the performance of the structure of the generator 101 through gradient descent, and then adjust the structure of the generator 101.

[0045] Secondly, search the second search space 104 to determine the structure of the discriminator 102. The generator 101 can be used to evaluate the structure of the discriminator 102, including: the second evaluation module 106 of the generator 101 calculates the adversarial loss of the second parameter β of the structure of the discriminator 102, and the adversarial loss is used to evaluate the performance of the structure of the discriminator 102 through gradient descent, and then adjust the structure of the discriminator 102.

[0046] At the same time, for the parameters α and β of the generator 101 and the discriminator 102, the parameter α is made to obtain the smallest possible value, and the parameter β is made to obtain the largest possible value. After calculating and obtaining the results of the parameters α and β, a balance is maintained between the parameters α and β.

[0047] Figure 3 FIG. 1 shows a structural diagram of the generator 101 and the discriminator 102 in an embodiment of the present invention. Figure 3 As shown,

[0048] The generator includes at least one upsampling unit, and the discriminator includes at least one downsampling unit. The upsampling unit of the generator 101 is used to generate an image by inputting uniform noise or Gaussian random noise of (0, 1), and the downsampling unit of the discriminator 102 is used to discriminate the input image to determine whether it is from a real image or an image generated by the generator. For example, if the image input to the discriminator is a real image, the discriminator outputs "1", and if it is an image generated by the generator, the discriminator outputs "0".

[0049] Figure 4 The structure diagram of the up-sampling unit or down-sampling unit in the generator 101 or the discriminator 102 is shown as follows: Figure 4 As shown, taking generator 101 as an example, an upsampling unit included therein may be composed of N ordered nodes. Here, N may be a natural number. Each node takes the image feature of the image as an input value and outputs the processed image feature. Figure 4 The upsampling unit group shown consists of 4 nodes, each of which can be obtained by selecting its previous node from candidate units through a search algorithm, wherein there can be a connection between two nodes. When there is a connection between the two nodes, the latter node can use the output value of the previous node connected to it as an input value.

[0050] That is, an operation is selected for each connection through the search algorithm. The operation here will be described below. The node here refers to the intermediate result. The connection refers to the operation. The search process is to select the best operation for each connection. After the selection, the final GAN ​​network structure can be extracted. If there is no connection between two nodes, that is, the two nodes are disconnected, the topology of the GAN network can be changed.

[0051] For the downsampling unit of the discriminator 102, the number of nodes it includes may be the same as that of the upsampling unit of the generator 101.

[0052] In addition to the nodes for constituting the upsampling unit of the generator 101 and the downsampling unit of the discriminator 102, the search space also includes the following seven operations between the nodes of the upsampling unit of the generator 101:

[0053] 1) No connection operation: there is no connection between nodes; 2) Skip connection operation: nodes are directly connected without any operation; 3) 1×1 convolution operation, where the dilation rate = 1; 4) 3×3 convolution operation, where the dilation rate = 1; 5) 3×3 deep convolution operation, where the dilation rate = 2; 6) 5×5 convolution operation, where the dilation rate = 1; 7) 5×5 convolution operation, where the dilation rate = 2.

[0054] The no-connection operation here means that there is no operation between two corresponding nodes, which is used to change the topological structure of the unit to which the unit belongs. The skip-layer connection operation means skipping the connection operation. When the step size of the operation is 1, they can maintain the spatial resolution.

[0055] Operations 3) to 7) here represent candidate convolution operations, where the convolution operation with a dilation rate of 1 refers to a normal convolution, and the convolution operation with a dilation rate of 2 refers to a dilated convolution, which is used to increase the receptive field of the operation. Taking the input data as the original image as an example, the receptive field here refers to the size of the receptive range of the different nodes of the GAN network to the input original image through the dilated convolution, or the size of the area mapped by the pixel points on the intermediate result of each node on the original image.

[0056] For generator 101, the search space may also include a series of upsampling operations: 1) 3x3 transposed convolution; 2) nearest neighbor interpolation; 3) bilinear interpolation, where the nearest neighbor interpolation and bilinear interpolation are both specific upsampling operations.

[0057] For the discriminator 102, the search space may include a series of downsampling operations: 1) an average pooling operation; 2) a maximum pooling operation; 3) a 3x3 convolution operation with a dilation rate = 1; 4) a 3x3 convolution operation with a dilation rate = 2; 5) a 3x3 deep convolution operation with a dilation rate = 1; 6) a 5x5 convolution operation with a dilation rate = 2.

[0058] In an embodiment of the present invention, the size of the search space of the generator 101 and the discriminator 102 can be 10 38 It can be understood that the size of the search space here is calculated. 38 Indicates the number of search spaces for the GAN network structure that can be selected.

[0059] The following introduces the search algorithm of the generator 101 and the discriminator 102 of the GAN network for word image generation. Figure 5 The process of the search algorithm is shown, including:

[0060] S501: Collect image data sets and select images for use as training data.

[0061] The image datasets in the embodiments of the present invention may be the CIFAR-10 dataset and the STL-10 dataset. CIFAR-10 is a color image dataset containing common objects, and contains a total of 10 categories of RGB color images. Each category of STL-10 has less calibrated training data than CIFAR-10, but has a very large amount of unlabeled data. These include: natural images, images that have not been processed by the GAN network; non-natural images, images that have been processed by the GAN network. Training images, images for training the GAN network. Original images, images used for discrimination by the GAN network, are natural images.

[0062] Here, some images can be randomly selected from the CIFAR-10 dataset and the STL-10 dataset as training data.

[0063] S502: Construct generator 101, input training samples into generator 101 to obtain output images.

[0064] For the search algorithm in the upsampling unit of the generator 101, the node x in the nth upsampling unit can be calculated through a function and interconnected nodes. n,j , that is, x n,j =∑ i馐j f n,i,j (x n,i ). Here f n,i,j It can be a method of discrete distribution sampling. As shown in formula (1):

[0065]

[0066] Among them, f is a uniform distribution of noise (it can also be a distribution of random noise, such as a Gaussian distribution), that is, the sample value in the upsampling unit used to train the generator 101. τ is the activation probability (softmaxtemperature) in the activation function, that is, the learning rate used for training, which can also be the distribution of discrete probabilities obtained by the search algorithm, and exp is an exponential function with the natural constant e as the base.

[0067] For example, in the embodiment of the present application, o can be generated by Gumbel (0, 1) (Gumbel distribution) f . is the node x at the nth upsampling unit n,j The discrete probability of selecting a specific connection from the connection i to j. Each connection can contain a probability vector The distribution of this discrete probability p f It can also be calculated by the following softmax function.

[0068]

[0069] Among them, α is a parameter that can be obtained through training, that is, a parameter of the generator 101. Therefore, through formula (1), the method of searching and obtaining the structure of the generator 101 can be converted into a set of optimal probability vectors for each connection between nodes of the upsampling unit contained in the structure of the generator 101 through the trainable parameter α, and the structure of the generator 101 can be derived from the probability vector.

[0070] S503: Construct the discriminator 102 to determine whether the image input to the discriminator 102 is an image generated by the generator 101 or is from a real image.

[0071] In addition, a downsampling unit of the discriminator 102 is constructed from the search space using a search algorithm at the same time. Here, the same method as in step S402 can be adopted to obtain the structure of the discriminator 102 using another learnable parameter β.

[0072]

[0073] Here, the search algorithm for the downsampling unit of the discriminator 102 is shown in formula (2). The same as in step S402 is: is the node x at the nth downsampling unit n,j The discrete probability of selecting a specific connection from the connection i to j. The distribution of this discrete probability is also calculated by the softmax function.

[0074]

[0075] S504: Determine the adversarial loss between the generator 101 and the discriminator 102, and train the generator 101 and the discriminator 102 by making the generator 101 and the discriminator 102 compete with each other.

[0076] Through the above two search algorithms, the parameters α and β can be trained in a differentiable manner, and the upsampling units and downsampling units of the generator 101 and the discriminator 102 can be obtained by retaining the highest probability connection between units in the search space. The n in the above S502 and S503 can be the nth upsampling unit and downsampling unit corresponding to each other in the generator 101 and the discriminator 102, and can also be understood as the structure of the nth layer of the generator 101 and the discriminator 102. After determining the structure of the nth layer of the generator 101 and the discriminator 102, the parameters α and β corresponding to the structures of the generator 101 and the discriminator 102 are calculated to obtain the optimized structures of the generator 101 and the discriminator 102.

[0077] In the embodiment of the present application, in order to ensure the balance between the generator 101 and the discriminator 102, while obtaining the parameter α of the generator 101, the optimal weight w corresponding to the parameter α of the generator 101 is obtained by formula (3): * (α).

[0078]

[0079] In formula (3), the training data, namely the validation set val and the training set train, are used to obtain the optimal weight w corresponding to the parameter α of the generator 101. *(α). L val and L train Here, the argmin function is used to indicate that the value of a given expression reaches its minimum value. Similarly, the argmax function is used to indicate that the value of a given expression reaches its maximum value. Combined with formula (3), by minimizing the loss function L of the validation set, val (w * , α), and by minimizing the training set loss L train (w, α) determines the parameter α of generator 101 to obtain the optimal weight w of the current structure of generator 101 * (α). It is understood that the optimal weight can also be optimized by the gradient descent method, Newton method and quasi-Newton method. It should be noted that in the embodiment of the present invention, there is no restriction on the optimization method used in the optimization process.

[0080] After determining the optimal weight w of the current structure of generator 101 * (α), in the embodiment of the present application, by using the mutual game between the structures of the generator 101 and the discriminator 102, that is, by playing a game between the parameters α and β, the balance between the generator 101 and the discriminator 102 is maintained, so as to obtain the optimal weights of the generator 101 and the discriminator 102, and to optimize the GAN network. The algorithm for playing a game between the values ​​V(α, β) of the parameters α and β is shown in formula (4). The mutual game between the parameters α and β can be achieved by the minmax algorithm. For the parameters α and β, the minmax algorithm will make the parameter α obtain the smallest possible value, and at the same time, make the parameter β obtain the largest possible value. After calculating and obtaining the results of the parameters α and β, the parameters α and β are balanced.

[0081]

[0082] st

[0083]

[0084]

[0085] Among them, p data (x) is the data distribution (i.e., the data distribution of real images in the training data), for example, it can be the training set train mentioned above, and p z It is a uniform noise distribution (i.e., a distribution of random noise, such as a Gaussian distribution), which is used to extract a random vector as an input of the GAN network, that is, an input of the generator 101. represents the optimal weight of the discriminator 102 under the parameter β. E represents the loss of the GAN network, that is, the adversarial loss. It can be determined by the maximum value of the loss of real data and the loss of uniform noise distribution, where the form of D(G()) is used to describe the image quality corresponding to the image generated by the generator 101 by the discriminator 102, such as the authenticity of the image, which can be determined by a probability value in the range of 0-1. represents the optimal weight of generator 101 under parameter α. It can be determined by minimizing the loss of real data. and The minimum-maximum game between and That is, Get the smallest possible value, and at the same time, make The maximum possible value is obtained to obtain the final parameters α and β of the generator 101 and the discriminator 102.

[0086] It can be understood that the two weights W of the generator 101 and the discriminator 102 {α, β} G (α) and W D When (β) is not the optimal weight, it can also be calculated by W D and W G The minimum-maximum game between them makes the generator 101 and the discriminator 102 reach a balance, and its algorithm is shown in formula (5).

[0087]

[0088] In some embodiments of the present application, the internal optimization of the structure of the generator 101 can also be achieved by training approximation To achieve this, the corresponding weight can be obtained through the above formula (5).

[0089] For the generator 101, it is usually hoped that the value of formula (5) is as small as possible. The smaller the value of formula (5), the closer the image generated by the generator 101 is to the real image. For the discriminator 102, it is hoped that the value of formula (5) is as large as possible. The larger the value of formula (5), the more accurately the discriminator 102 can distinguish between the generated image and the real image.

[0090]

[0091] Table 1

[0092] Table 1 shows the performance parameters of IS (Inception Score) and FID (Frechet Inception Distance Score) of the GAN network construction method (AdversarialNAS network) of this application and some existing construction methods. Compared with other methods, the search space of AdversarialNAS has a maximum number of 10 38 , which is several orders of magnitude larger than the search space of AutoGAN. In addition, the proposed GAN network construction method takes 1 GPU day to obtain the optimal architecture, while the AGAN method takes 1200 GPU days to obtain the optimal architecture in the same search space.

[0093] For the CIFAR-10 dataset, the AdversarialNAS network has a distance score of (10.87) and a starting score of (8.74±0.07), which is close to the starting score of Progressive GAN (8.80±0.05) and better than the starting score of AutoGAN (8.55±0.10). At the same time, for the STL-10 dataset, the starting score (9.63) and distance score (26.98) of the AdversarialNAS network are also far better than other methods.

[0094]

[0095] Table 2

[0096] Table 2 lists the performance parameters of the GAN network construction method of this application compared with some existing construction methods on IS and FID. Random Search represents random search; SingalNAS represents a simple search algorithm; AutoGAN-D, SNGAN-D, Super-D and Searched-D represent the type of discriminator, automatic GAN network, normalized GAN network, multi-dimensional GAN ​​network and the GAN network of this application respectively.

[0097] Reference now Figure 6 , shown is a block diagram of a device 600 according to an embodiment of the present application. Figure 6 An example electronic device 600 is schematically illustrated in accordance with various embodiments. In one embodiment, the electronic device 600 may include one or more processors 604, a system control logic 608 coupled to at least one of the processors 604, a system memory 612 coupled to the system control logic 608, a non-volatile memory (NVM) 616 coupled to the system control logic 608, and a network interface 620 coupled to the system control logic 608.

[0098] In some embodiments, the processor 604 may include one or more single-core or multi-core processors. In some embodiments, the processor 604 may include any combination of a general-purpose processor and a dedicated processor (e.g., a graphics processor, an application processor, a baseband processor, etc.). In an embodiment of the present application, the processor 604 is used to execute a method for constructing a GAN network.

[0099] In some embodiments, system control logic 608 may include any suitable interface controller to provide any suitable interface to at least one of processors 604 and / or any suitable device or component in communication with system control logic 608 .

[0100] In some embodiments, the system control logic 608 may include one or more memory controllers to provide an interface to a system memory 612. The system memory 612 may be used to load and store data and / or instructions. In some embodiments, the memory 612 of the electronic device 600 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).

[0101] NVM / memory 616 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, NVM / memory 616 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a HDD (Hard Disk Drive), a CD (Compact Disc) drive, and a DVD (Digital Versatile Disc) drive.

[0102] NVM / storage 616 may include a portion of storage resources on a device on which electronic device 600 is installed, or it may be accessible by the device but not necessarily a portion of the device. For example, NVM / storage 616 may be accessed over a network via network interface 620.

[0103] In particular, system memory 612 and NVM / storage 616 may include, respectively, a temporary copy and a permanent copy of instructions 624. Instructions 624 may include instructions that, when executed by at least one of processors 604, cause the electronic device 600 to perform the above-described method. In some embodiments, instructions 624, hardware, firmware, and / or software components thereof may be additionally / alternatively placed in system control logic 608, network interface 620, and / or processor 604.

[0104] The network interface 620 may include a transceiver for providing a radio interface for the electronic device 600, thereby communicating with any other suitable device (such as a front-end module, an antenna, etc.) through one or more networks. In some embodiments, the network interface 620 may be integrated with other components of the electronic device 600. For example, the network interface 620 may be integrated with at least one of the processor 604, the system memory 612, the NVM / storage 616, and a firmware device (not shown) having instructions. When at least one of the processors 604 executes the instructions, the electronic device 600 implements the following. Figure 4 The method shown.

[0105] The network interface 620 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 620 may be a network adapter, a wireless network adapter, a telephone modem and / or a wireless modem.

[0106] In one embodiment, at least one of the processors 604 may be packaged together with logic for one or more controllers of the system control logic 608 to form a system in package (SiP). In one embodiment, at least one of the processors 604 may be integrated on the same die with logic for one or more controllers of the system control logic 608 to form a system on a chip (SoC).

[0107] The electronic device 600 may further include an input / output (I / O) device 632. The I / O device 632 may include a user interface to enable a user to interact with the electronic device 600; the design of the peripheral component interface enables the peripheral components to interact with the electronic device 600. In some embodiments, the electronic device 600 further includes a sensor for determining at least one of an environmental condition and location information related to the electronic device 600.

[0108] In some embodiments, the user interface may include, but is not limited to, a display (e.g., an LCD display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., a still image camera and / or a video camera), a flashlight (e.g., an LED flash), and a keyboard.

[0109] In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.

[0110] In some embodiments, the sensors may include, but are not limited to, gyroscope sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of or interact with the network interface 1420 to communicate with components of a positioning network (e.g., global positioning system (GPS) satellites).

[0111] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.

[0112] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC), or a microprocessor.

[0113] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0114] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Therefore, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.

[0115] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0116] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.

[0117] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0118] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be apparent to those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims

1. A method for constructing a network structure, characterized in that: The method comprises: Constructing the network structure, wherein the network structure includes a generator and a discriminator; Based on random noise and sample data, the generator and the discriminator are trained, wherein the generator includes a first generation unit and the discriminator includes a first discrimination unit; Obtaining a first generator parameter of the generator and a first discriminator parameter of the discriminator, adjusting the first generator parameter and the first discriminator parameter until the first generator parameter is within a first generator value range and the first discriminator parameter is within a first discriminator value range, updating the first generating unit using the first generator parameter, and updating the first discriminator unit using the first discriminator parameter; Assume that α is the first generator parameter, and β is the first discriminator parameter; the algorithm for the mutual game between the values ​​of parameters α and β V(α, β) is shown in formula (4); the mutual game between parameters α and β is realized by the minmax algorithm. For parameters α and β, the minmax algorithm will make parameter α obtain the smallest possible value, and at the same time, make parameter β obtain the largest possible value; after calculating and obtaining the results of parameters α and β, a balance is maintained between parameters α and β; Among them, p data (x) is the data distribution, that is, the data distribution of real images in the training data, which is used to extract random vectors as the input of the GAN network, that is, the input of the generator; represents the optimal weight of the discriminator under parameter β; E represents the loss of the GAN network, that is, the adversarial loss; It is determined by the maximum value of the loss of the real data and the loss of the uniform distribution of noise, where the form of D(G()) is used to describe the image quality corresponding to the image generated by the generator by the discriminator; represents the optimal weight of the generator under parameter α, can be determined by minimizing the loss of real data; and The minimum-maximum game between and Keep a balance between G (α) and W D (β) are the two weights of the generator and discriminator {α, β} respectively.

2. The construction method according to claim 1, characterized in that: Adjusting the first generator parameter and the first discriminator parameter until the first generator parameter is within the first generator value range and the first discriminator parameter is within the first discriminator value range is achieved by the following formula, Among them, α is the first generator parameter, β is the first discriminator parameter, and p data is the sample data, p z is the random noise, and the minmax function is used to make the first generator parameter in the first generator value range and the first discriminator parameter in the first discriminator value range.

3. The construction method according to claim 2, characterized in that: Based on random noise and sample data, the generator and the discriminator are trained, the generator includes a first generation unit, and the discriminator includes a first discrimination unit, including: based on random noise and sample data, the generator and the discriminator are trained, the generator is used to generate a first image based on the random noise, and the discriminator is used to distinguish the first image from the sample data.

4. The construction method according to claim 3, characterized in that: After updating the first generator unit using the first generator parameter and updating the first discriminator unit using the first discriminator parameter, the method includes: acquiring a second generator parameter of the generator and a second discriminator parameter of the discriminator; Adjust the second generator parameters and the second discriminator parameters until the second generator parameters are within the second generator numerical range and the second discriminator parameters are within the second discriminator numerical range, use the second generator parameters to update the second generation unit, and use the second discriminator parameters to update the second discriminator unit.

5. The construction method according to claim 1, characterized in that: The generator and the discriminator each include at least two generating units and a discriminating unit.

6. The construction method according to claim 2, characterized in that: The minmax function is used to make the first generator parameters and the first discriminator parameters compete with each other to determine the structure of the generator And the structure of the discriminator 7. The construction method according to claim 1, characterized in that: The minimum-maximum game is used to minimize the first generator parameter while maximizing the first discriminator parameter.

8. A device for constructing a network structure, characterized in that: include: A memory storing instructions; A processor is coupled to a memory, and when the program instructions stored in the memory are executed by the processor, the device executes the method for constructing a network structure according to any one of claims 1 to 7.

9. A readable medium having instructions stored therein, characterized in that: When the instructions are executed on the readable medium, the readable medium is caused to execute the method for constructing a network structure according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Blink video generation method based on guided generative adversarial network

    CN111062899A

  • IES incomplete data load prediction method and system based on C-GAN transfer learning

    CN111191835A

  • Single image shadow removing method and system based on generative adversarial network

    CN111652822A

  • Multi-band image synchronous fusion and enhancement method based on improved WGA-GP

    CN111696066A

  • Data processing method and device, image generation method and electronic equipment

    CN111914945A