WO2023014298A2 - 神经网络模型的构建方法及装置 - Google Patents

神经网络模型的构建方法及装置 Download PDF

Info

Publication number
WO2023014298A2
WO2023014298A2 PCT/SG2022/050553 SG2022050553W WO2023014298A2 WO 2023014298 A2 WO2023014298 A2 WO 2023014298A2 SG 2022050553 W SG2022050553 W SG 2022050553W WO 2023014298 A2 WO2023014298 A2 WO 2023014298A2
Authority
WO
WIPO (PCT)
Prior art keywords
verification
neural network
sample
training
value
Prior art date
Application number
PCT/SG2022/050553
Other languages
English (en)
French (fr)
Other versions
WO2023014298A3 (zh
Inventor
谭丞
朱亦博
郭传雄
王剑
Original Assignee
脸萌有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 脸萌有限公司 filed Critical 脸萌有限公司
Publication of WO2023014298A2 publication Critical patent/WO2023014298A2/zh
Publication of WO2023014298A3 publication Critical patent/WO2023014298A3/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • a neural network is a mathematical model or computational model that imitates the structure and function of a biological neural network (the central nervous system of animals, especially the brain), and is used to estimate or approximate functions .
  • a biological neural network the central nervous system of animals, especially the brain
  • Embodiments of the present disclosure provide a method, device and electronic equipment for constructing a neural network model.
  • an embodiment of the present disclosure provides a method for constructing a neural network model, including: obtaining a verification sample from a preset verification data set, inputting the verification sample into a pre-trained candidate neural network, and obtaining a verification value; determining whether the candidate neural network satisfies a preset condition based on the verification value; if the determination result is no, generating a new training sample pair based on the verification value and the verification sample, and adding the new training sample pair to the training
  • the data set is to obtain an updated training data set, the training data set includes a plurality of training sample pairs, and the training sample pairs include training samples and actual values corresponding to the training samples; using the updated training data set to re-execute the candidate neural network training to obtain a neural network that satisfies the preset conditions.
  • an embodiment of the present disclosure provides an apparatus for constructing a neural network model, including: an input unit, configured to obtain a verification sample from a preset verification data set, and input the verification sample into a pre-trained candidate neural network , to obtain a verification value; a determination unit, configured to determine whether the candidate neural network satisfies a preset condition based on the verification value; training A data generation unit, configured to generate a new training sample pair based on the verification value and the verification sample if the determination result is negative, add the new training sample pair to the training data set, obtain an updated training data set, and train
  • the data set includes a plurality of training sample pairs, and the training sample pairs include training samples and actual values corresponding to the training samples; a training unit is configured to use the updated training data set to retrain the candidate neural network to obtain the required A neural network with the above preset conditions.
  • an embodiment of the present disclosure provides an electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more executed by one or more processors, so that the one or more processors realize the method for constructing the neural network model as described in the first aspect.
  • an embodiment of the present disclosure provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the method for constructing a neural network model as described in the first aspect is implemented.
  • FIG. 1 is a flow chart of one embodiment of the construction method of the neural network model according to the present disclosure
  • Fig. 2 is a flow chart of another embodiment of the construction method of the neural network model according to the present disclosure
  • Fig. 3 is shown in Fig. 2
  • FIG. 4 provides a schematic diagram showing verification data and a verification process
  • FIG. 5 is a flowchart of an embodiment of a neural network model construction device according to the present disclosure
  • FIG. 1 is a flow chart of one embodiment of the construction method of the neural network model according to the present disclosure
  • Fig. 2 is a flow chart of another embodiment of the construction method of the neural network model according to the present disclosure
  • Fig. 3 is shown in Fig. 2
  • FIG. 4 provides a schematic diagram showing verification data and a verification process
  • FIG. 5 is a flowchart of an embodiment of a neural network model construction device according to the present disclosure
  • FIG. 6 is An exemplary system architecture to which the method for constructing a neural network model and the apparatus for constructing a neural network model according to an embodiment of the present disclosure can be applied;
  • FIG. 7 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION
  • FIG. 7 is a schematic diagram of a basic structure of an electronic device provided according to an embodiment of the present disclosure.
  • one embodiment means “at least one embodiment”; the term “another embodiment” means “at least one additional embodiment”; the term “some embodiments” means “at least some embodiments”.
  • Relevant definitions of other terms will be given in the following description. It should be noted that concepts such as “first” and “second” mentioned in this disclosure are only used to distinguish different devices, modules or units, not Used to define the sequence or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one” and “multiple” mentioned in the present disclosure are illustrative and not limiting. Those skilled in the art should understand that, unless the context clearly indicates otherwise, it should be understood as “one or more”.
  • FIG. 1 shows the flow of an embodiment of the method for constructing a neural network model according to the present disclosure.
  • the neural network The method for constructing a model includes the following steps: Step 101, obtaining a verification sample from a preset verification data set, inputting the verification sample into a pre-trained candidate neural network to obtain a verification value.
  • the neural network needs to be trained, verified and tested.
  • multiple samples can be prepared to form a sample data set.
  • the verification data set can include multiple verification samples. Each verification sample can correspond to a real value in advance.
  • the above verification samples can be It is determined in advance.
  • the above-mentioned verification samples can not appear in the training sample set of the candidate neural network.
  • the verification samples can be taken out one by one from the preset verification data set to verify the candidate neural network.
  • the number of verification samples in the verification data set can be based on Specific application scenarios are set, and are not limited here.
  • the above-mentioned candidate neural network is a neural network that has been pre-trained through the training data set.
  • the above-mentioned neural network can be various neural networks, artificial neural networks, convolutional neural networks , recurrent neural network, etc.
  • the hyperparameters in the neural network can be initially set.
  • the hyperparameters here include the number of layers of the neural network, the number of neurons in each hidden layer, the neural network The weight parameters of the hidden layer of the network, etc.
  • the trained neural network can be used for image recognition, and the above verification samples can include images of objects to be recognized.
  • the real value of the verification sample above is an identifier used to indicate the object to be identified.
  • the above-mentioned identification may include numbers, symbols and the like.
  • the trained neural network is used for data indexing, and the above-mentioned verification samples may be key values for indexing data.
  • the real value of the verification sample is the storage location of the data corresponding to the index.
  • the above candidate neural network may be trained through the following steps: First, a training sample set is acquired, the training sample set includes a plurality of training sample pairs, and the training sample pairs include training samples and real values corresponding to the training samples.
  • the number of training sample pairs in the training sample set here may be thousands, tens of thousands, and the like.
  • the neural network is a neural network for image recognition
  • the training samples in the above training sample set may include images of objects to be recognized.
  • the above-mentioned number of objects to be identified may include more than one.
  • the aforementioned objects to be identified may be different people.
  • the training sample is used as an input, and the real value is used as an output to train the initial neural network until the preset condition is satisfied, and the candidate neural network is obtained.
  • the preset condition here may be that the number of training times reaches a preset threshold.
  • the preset condition here may be that the value of the preset loss function is the smallest. Step 102, determine whether the candidate neural network satisfies a preset condition based on the verification value.
  • the foregoing preset condition may be that the difference between the verification value and the real value corresponding to the verification sample is less than or equal to a preset threshold.
  • the above verification value may be a probability value for the candidate neural network to map the verification sample to the target object. If the verification sample is an image of the target object, then the true value of the verification sample is lo and it is possible to calculate whether the difference between the above probability value and 1 is less than or equal to the preset threshold. If it is less than or equal to the preset threshold, it is determined that the neural network meets the preset condition; otherwise, it is determined that the neural network does not meet the preset condition.
  • the difference between the verification value corresponding to each verification sample and the real value is less than or equal to a preset threshold, and the above-mentioned neural network verification preset condition can be determined.
  • the verification samples are images A1, A3, A4, and A5 of the target object A.
  • the above-mentioned A1, A3, A4, and A5 may be sequentially input into the candidate neural network.
  • Five verification values of the candidate neural network can be obtained sequentially: VAI, VA2, VA3, VA4, and VA5.
  • the above-mentioned five verification values are probability values for mapping the above-mentioned images A1, A3, A4, and A5 to the target object A, respectively.
  • the above-mentioned verification sample is an image of the target object A, so the real value of the verification sample corresponding to the target object A is lo, and the difference between the above-mentioned verification values VAI, VA2, VA3, VA4, VA5 and 1 can be calculated in turn, if the verification values are respectively Difference from 1 is less than or equal to preset threshold, the neural network meets the preset conditions. If there is at least one verification value greater than the preset threshold, it can be determined that the neural network does not satisfy the preset condition.
  • the average value of the difference between the verification value corresponding to each verification sample and the real value is less than or equal to the preset threshold, and the above example is still used for illustration. If the verification samples A1, A3, A4, and A5 correspond to The difference between the verification value and the real value "1" is qAl, qA2, qA3, qA4, qA5 respectively, if the average value of qAl, qA2, qA3, qA4, qA5 is less than or equal to the threshold, it can be determined that the neural network meets the preset condition, otherwise , it can be determined that the neural network does not satisfy the preset condition.
  • the aforementioned preset condition may be that the difference between the verification value obtained for the verification sample doped with noise and the true value corresponding to the verification sample is less than or equal to a preset threshold.
  • noise may be added to the verification sample, and the noise-added verification sample is input to the candidate neural network. If the difference between the verification value output by the candidate neural network for the verification sample with noise added and the true value of the verification sample is smaller than a preset threshold, it can be determined that the neural network meets the preset condition; otherwise, it is determined that the neural network does not meet the preset condition.
  • the aforementioned verification samples with added noise can add interference factors to the verification samples.
  • the verification sample to which noise is added may be a verification sample formed by flipping, translating, sharpening, adding different colors, etc. to the image of the target object in the image.
  • Step 103 if the determination result is no, generate a new training sample pair based on the verification value and the verification sample, add the new training sample pair to the training data set, and obtain an updated training data set, the training data set includes A plurality of training sample pairs, where the training sample pairs include training samples and actual values corresponding to the training samples. If the determination result of step 102 is negative, that is, the candidate neural network does not satisfy the preset condition, the candidate neural network may be retrained. When retraining the candidate neural network, the training sample data can be updated.
  • the above-mentioned generation of new training samples based on the verification values and verification samples may include: taking verification samples whose verification values are not satisfied with the preset specification as new training samples, and using the true value corresponding to the verification samples as the label of the new training samples , to generate new training sample pairs. Further, the above-mentioned generation of new training samples based on the predicted value and the verification sample also includes: adding preset noise to the verification sample, using the verification sample added with preset noise as a newly added training sample, corresponding to the verification sample The true value of is used as the label of the new training sample, and the new training sample pair is generated.
  • the noise mentioned above may include noise factors added in the validation samples.
  • Step 104 using the updated training data set to retrain the candidate neural network to obtain a neural network satisfying the preset condition.
  • the neural network can automatically adjust the super parameters.
  • the candidate neural network is trained through the updated training data set, so that the retrained neural network can correctly identify the above-mentioned target verification samples added to the training data.
  • a neural network that satisfies preset conditions can be determined through multiple verification and retraining processes.
  • a verification sample is obtained from a preset verification data set, and the verification sample is input into a pre-trained candidate neural network to obtain a verification value; and the candidate is determined based on the verification value.
  • FIG. 2 shows a flow chart of another embodiment of the neural network construction method according to the present disclosure. As shown in FIG. 2,
  • Step 201 acquire a training sample set
  • the training sample set includes a plurality of training sample pairs
  • the training sample pairs include training samples and real values corresponding to the training samples.
  • Neural networks have been widely used in various industries, but they have not been widely used in key systems (such as operating systems, databases, and network systems).
  • key systems such as operating systems, databases, and network systems.
  • One of the difficulties in applying neural networks in these environments is how to ensure that the behavior of neural networks is well-defined and controllable.
  • Neural network verification techniques can be used to verify whether a neural network satisfies a given specification.
  • the above specification may be an expression describing the input-output relationship of the neural network.
  • the specification of the neural network is closely related to the specific function of the neural network.
  • the verification technology is mainly used for testing, and does not involve how to construct a neural network that meets the specifications.
  • the aforementioned preset specification may include preset conditions, such as: an index function, and a deviation between the index value (the index storage location corresponding to the index value) and the real value (the real storage location) is smaller than a preset threshold.
  • the aforementioned index function may be a hash index function or the like.
  • the above training sample set may be provided by the user.
  • the training sample set may include multiple training sample pairs.
  • the training sample pair includes an index value for indexing the data to be indexed, and a real acquisition position (true value) of the data to be indexed;
  • the verification sample includes an index value for indexing the data.
  • Step 202 train the initial neural network with the training sample as input and the real value as output until the preset condition is satisfied, and obtain the candidate neural network.
  • the aforementioned preset conditions include that the number of training times is greater than or equal to a preset number of times threshold. Or the aforementioned preset condition includes that the preset loss function value is less than or equal to a preset threshold.
  • a verification sample is obtained from a preset verification data set, and the verification sample is input into a pre-trained candidate neural network to obtain a verification value, and the candidate neural network is used for data indexing.
  • a verification sample is obtained from a preset verification data set, and the verification sample is input into a pre-trained candidate neural network to obtain a verification value; wherein the neural network is used for data indexing.
  • the neural network of this embodiment is used for data indexing.
  • the aforementioned data index may include one of the following: database storage data index, operating system resource index, and network data center resource allocation index.
  • the above-mentioned neural network is used for database data indexing, and the above-mentioned index value is a key in a key-value pair corresponding to the database.
  • an index value (key) indicating which location corresponds can be generated. Key-value pairs are formed for indexing.
  • the above-mentioned neural network is used for operating system task indexing.
  • a neural network can be used to implement a task scheduling algorithm.
  • the aforementioned preset specification may include a task scheduling function. Each task can correspond to an ID. Task scheduling for operating system tasks can be realized through the neural network.
  • the pair of training samples and the pair of verification samples may include a task identifier and an identifier of a real processing unit (such as a computing unit, a storage unit, etc.) corresponding to the task identifier.
  • the above index value may be an identifier of the task.
  • the above neural network is used for network data center resource allocation index.
  • the preset specification may include a preset resource allocation function.
  • Step 204 determine whether the candidate neural network satisfies a preset condition based on the verification value.
  • the preset condition here may be the preset specification mentioned above.
  • the neural network is a multi-level neural network (hereinafter referred to as a multi-level index network).
  • Each layer of neural network in the multi-level neural network model may include at least one neural network model.
  • the above step 203 includes: inputting the verification sample into a pre-trained multi-level neural network, obtaining an intermediate verification value output by an intermediate level neural network in the multi-level neural network, and the output of the neural network validation value.
  • the above step 204 includes: determining whether the plurality of candidate neural networks satisfy a preset condition based on the intermediate verification value and the verification value.
  • a multi-level neural network applied to data indexing, the above preset specifications include neural The input and output of the network satisfy the preset index function, and the difference between the verification value and the real value is less than the preset value, which may include that the difference between the intermediate verification value and the intermediate real value is less than the preset intermediate value.
  • FIG. 3 shows a schematic structural diagram of the neural network involved in the embodiment shown in FIG. 1 and FIG. 2.
  • Fig. 3 is a schematic diagram of the structure of a two-layer tree structure neural network. As shown in FIG.
  • each node of the two-layer tree structure neural network can be a neural network.
  • the multi-level index network includes a neural network model 301 of the first layer and a neural network model 302 of the second layer.
  • the neural network model 301 of the first layer includes model 1.1, etc.
  • the neural network model 302 of the second layer includes model 2.1, model 2.2, model 2.3, etc.
  • the input of the multi-level index network is the Key (index value) of a database, and the output is the location of the data corresponding to the Key in the storage space.
  • the output of the first layer model 301 model 1.1 can be a neural network model of the second layer neural network model 302 (model 2.1 shown in Figure 3); then the Key will As an input of the model selected by the second-layer neural network model; the final output is the location of the storage space where the key corresponds to the data.
  • the difference between the location in the storage space predicted by the multi-level index network and the location in the real storage space may be smaller than a preset value.
  • the preset numerical value here can be, for example, 10, 50, 100 and so on.
  • the above preset values can be set according to the application scenarios, and there is no limitation this time. Please refer to FIG.
  • the verification data part in Figure 4 is the position (real value) of the Key and the corresponding storage space in the real database, which can be defined as follows:
  • the output result and the real first-layer neural network model can be required
  • the difference between the two-layer neural network models is within 1 position.
  • Key 8, model 2.1 should be selected.
  • the output result that is, the difference between the intermediate verification value and the intermediate real value can be up to 1, that is, Model2.2 can be selected at most; if the verification value is greater than 1, for example, the verification value points to Model2.3, the verification fails and OK
  • the neural network does not meet the preset conditions.
  • the difference between the verification value (the final output result of the neural network) and the position corresponding to the real Key is less than the preset value.
  • the verification value the final output result of the neural network
  • Step 205 if the determination result is no, generate a new training sample pair based on the verification value and the verification sample, add the new training sample pair to the training data set, and obtain an updated training data set, the training data set includes A plurality of training sample pairs, where the training sample pairs include training samples and actual values corresponding to the training samples.
  • Step 206 using the updated training data set to retrain the candidate neural network to obtain a neural network satisfying the preset condition.
  • this embodiment highlights the scheme of verifying the neural network when the neural network is used for data indexing, which is beneficial to expand the application range of the neural network.
  • FIG. 5 as an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a neural network model construction device.
  • the device embodiments correspond to the method embodiments shown in FIG. 1 , and the device specifically It can be applied to various electronic devices.
  • the apparatus for constructing a neural network model in this embodiment includes: an input unit 501, a determination unit 502, a training data generation unit 503, and a training unit 504.
  • the input unit 501 is used to obtain a verification sample from a preset verification data set, and input the verification sample to a pre-trained candidate neural network to obtain a verification value; the determination unit 502 is used to determine the verification value based on the verification value.
  • the training data generation unit 503 is configured to generate a new training sample pair based on the verification value and the verification sample if the determination result is no, and add the new training sample pair to to the training data set to obtain an updated training data set, the training data set includes a plurality of training sample pairs, and the training sample pairs include training samples and actual values corresponding to the training samples; the training unit 504 is configured to use the updated training data set
  • the candidate neural network is retrained to obtain a neural network satisfying the preset condition.
  • the apparatus for constructing the neural network further includes a training unit (not shown in the figure).
  • the training unit is used to: obtain a training sample set, the training sample set includes a plurality of training sample pairs, the training sample pairs include training samples and actual values corresponding to the training samples; the training samples are used as input, and the actual values are used as The output is to train the initial neural network until the preset condition is satisfied, and the candidate neural network is obtained.
  • the preset condition includes: the difference between the verification value and the real value corresponding to the verification sample is less than or equal to a preset threshold.
  • the preset condition includes: the input and output of the neural network satisfy a preset relationship.
  • the neural network construction device further includes a retraining unit (not shown in the figure), and the retraining unit is further configured to: generate a new training sample based on the verification value and the verification sample, It includes: using verification samples whose verification values are not satisfied with the preset specification as new training samples, and using the real values corresponding to the verification samples as labels of the new training samples to generate new training sample pairs.
  • the retraining unit is further used to: verify the Preset noise is added to the sample, the verification sample with preset noise is added as a new training sample, and the real value corresponding to the verification sample is used as the label of the new training sample to generate a new training sample pair.
  • the neural network is used for data indexing, and the training sample pair includes an index value for indexing the data to be indexed, and a real acquisition position of the data to be indexed; the verification sample includes The index value to index the data.
  • the data index includes one of the following: a database storage data index, an operating system task index, and a network data center resource allocation index.
  • the neural network is a multi-level neural network.
  • the preset condition includes: a difference between the storage location corresponding to the verification value and the real storage location corresponding to the verification sample is smaller than a preset value.
  • the input unit 501 is further configured to input the verification sample into a pre-trained multi-level neural network, and obtain an intermediate verification value output by an intermediate level neural network in the multi-level neural network, and a verification value output by the neural network; and the determining unit 502 is further configured to: determine whether the plurality of candidate neural networks satisfy a preset condition based on the intermediate verification value and the verification value.
  • FIG. 6 shows a method for constructing a neural network according to an embodiment of the present disclosure, or an exemplary system architecture in which a neural network construction device can be applied.
  • the system architecture may include terminal devices 601, 602, and 603, a network 604, and a server 605.
  • the network 604 is used to provide a communication link medium between the terminal devices 601, 602, 603 and the server 605.
  • Network 604 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.
  • the terminal devices 601, 602, and 603 can interact with the server 605 through the network 604 to receive or send messages and the like.
  • client applications such as web browser applications, search applications, and news information applications, may be installed on the terminal devices 601, 602, and 603.
  • the client applications in the terminal devices 601, 602, and 603 can receive user instructions, and complete corresponding functions according to the user instructions, for example, send sample data to the server 605o according to the user instructions.
  • the terminal devices 601, 602, and 603 can be hardware, It can also be software.
  • terminal devices 601, 602, and 603 are hardware, they may be various electronic devices that have display screens and support web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, moving picture expert compression standard audio layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, moving picture expert compression standard audio layer 4) player, laptop portable computer and desktop computer, etc.
  • MP3 players Motion Picture Experts Group Audio Layer III, moving picture expert compression standard audio layer 3
  • MP4 Motion Picture Experts Group Audio Layer IV, moving picture expert compression standard audio layer 4
  • laptop portable computer and desktop computer etc.
  • the terminal devices 601, 602, and 603 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple software or software modules (such as software or software modules for providing distributed services), or as a single software or software module. No specific limitation is made here.
  • the server 605 may be a server that provides various services, such as constructing a neural network based on the sample data sent by the terminal devices 601, 602, and 603, and sending the successfully constructed neural network to the terminal devices 601, 602, and 603.
  • the method for constructing the neural network model provided by the embodiments of the present disclosure may be executed by the server 604, and accordingly, the apparatus for constructing the neural network model may be set in the server 604.
  • the method for constructing the neural network model may also be executed by the terminal devices 601, 602, and 603.
  • the device for constructing the neural network model may be set in the terminal devices 601, 602, and 603. It should be understood that the terminal devices,
  • the number of networks and servers is illustrative only.
  • FIG. 7 shows a schematic structural diagram of an electronic device (such as the server or terminal device in FIG. 6 ) suitable for implementing the embodiments of the present disclosure.
  • the terminal devices in the embodiments of the present disclosure may include but not limited to mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (eg mobile terminals such as car navigation terminals) and fixed terminals such as digital TVs, desktop computers, and the like.
  • the electronic device shown in FIG. 7 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure. As shown in FIG.
  • an electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 701, which may be loaded into a random access memory according to a program stored in a read-only memory (ROM) 702 or from a storage device 708 (RAM) 703 to execute various appropriate actions and processes.
  • ROM read-only memory
  • RAM storage device 708
  • various programs and data necessary for the operation of the electronic device 700 are also stored.
  • the processing device 701, ROM 702, and RAM 703 are connected to each other through a bus 704.
  • the input/output (I/O) interface 705 is also connected to the bus 704o.
  • the following devices can be connected to the I/O interface 705: including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc. an input device 706; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709.
  • the communication means 709 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data.
  • FIG. 7 shows an electronic device with various devices, it should be understood that it is not required to implement or have all the devices shown.
  • the processes described above with reference to the flowcharts can be implemented as computer software programs.
  • the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, where the computer program includes program code for executing the method shown in the flowchart.
  • the computer program may be downloaded and installed from a network via communication means 709 , or from storage means 708 , or from ROM 702 . in the computer program
  • the processing device 701 the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer readable storage media may include, but are not limited to: electrical connections with one or more conductors, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, device, or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program codes are carried. The propagated data signal may take various forms, including but not limited to electromagnetic signal, optical signal, or any suitable combination of the above.
  • the computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable signal medium may transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and the server can use any currently known or future developed network protocols such as HTTP (HyperText Transfer Protocol, hypertext transfer protocol) to communicate, and can communicate with digital data in any form or medium Communication (eg, communication network) interconnections.
  • HTTP HyperText Transfer Protocol
  • hypertext transfer protocol Hypertext transfer protocol
  • Examples of communication networks include local area networks ("LANs”), wide area networks (“WANs”), Internets (e.g., the Internet) and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network of.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist independently without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to perform the following operations: obtain a verification sample from a preset verification data set, and convert the verification sample to input to the pre-trained candidate neural network to obtain a verification value; determine whether the candidate neural network satisfies a preset condition based on the verification value; if the determination result is no, generate a new training based on the verification value and verification samples sample pair, adding the new training sample pair to the training data set to obtain an updated training data set, the training data set includes a plurality of training sample pairs, and the training sample pair includes training samples and actual values corresponding to the training samples; using the The updated training data set retrains the candidate neural network to obtain a neural network satisfying the preset condition.
  • the above-mentioned electronic device before obtaining a verification sample from a preset verification data set, inputting the verification sample into a pre-trained candidate neural network, and obtaining a verification value, the above-mentioned electronic device also performs the following operations: Obtain a training sample set, the training sample set includes a plurality of training sample pairs, the training sample pairs include training samples and the real values corresponding to the training samples; the training samples are used as input, and the real value is used as an output to the initial neural network Perform training until the preset conditions are met to obtain the candidate neural network.
  • the preset condition includes: the difference between the verification value and the real value corresponding to the verification sample is less than or equal to a preset threshold.
  • the preset condition includes: the input and output of the neural network satisfy a preset relationship.
  • the generating a new training sample based on the verification value and the verification sample includes: using a verification sample whose verification value is not satisfied with the preset specification as a new training sample, and using the verification The actual value corresponding to the sample is used as the label of the newly added training sample to generate a new training sample pair.
  • the generating a new training sample based on the predicted value and the verification sample further includes: adding preset noise to the verification sample, and using the verification sample added with the preset noise as a newly added For the training sample, the true value corresponding to the verification sample is used as the label of the new training sample to generate a new training sample pair.
  • the neural network is used for data indexing, and the training sample pair includes an index value for indexing the data to be indexed, and a real acquisition position of the data to be indexed; the verification sample includes The index value to index the data.
  • the data index includes one of the following: a database storage data index, an operating system task index, and a network data center resource allocation index.
  • the neural network is a multi-level neural network.
  • the preset condition includes: a difference between the storage location corresponding to the verification value and the real storage location corresponding to the verification sample is smaller than a preset value.
  • the obtaining a verification sample from a preset verification data set, inputting the verification sample into a pre-trained candidate neural network, and obtaining a verification value includes: inputting the verification sample into a pre-trained neural network A pre-trained multi-level neural network, obtaining an intermediate verification value output by an intermediate level neural network in a multi-level neural network, and a verification value output by the neural network; and determining whether the candidate neural network is based on the verification value Satisfying a preset condition includes: determining whether the plurality of candidate neural networks satisfy a preset condition based on the intermediate verification value and the verification value.
  • the neural network model construction method, device and electronic device obtain a verification value by taking a verification sample from a preset verification data set and inputting the verification sample into a pre-trained candidate neural network; determining whether the candidate neural network satisfies a preset condition based on the verification value; if the determination result is no, generating a new training sample pair based on the verification value and the verification sample, and adding the new training sample pair to the training
  • the data set is to obtain an updated training data set, the training data set includes a plurality of training sample pairs, and the training sample pairs include training samples and actual values corresponding to the training samples; using the updated training data set to re-execute the candidate neural network Training to obtain a neural network that satisfies the preset conditions, and retraining the neural network by automatically updating the training sample set according to the verification samples that fail the verification to obtain a neural network that can pass the verification.
  • Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, C++, and Included are conventional procedural programming languages such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external connect).
  • LAN local area network
  • WAN wide area network
  • each block in the flowchart or block diagram may represent a module, program segment, or part of code that contains one or more logic functions for implementing the specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block in the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of special purpose hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by means of software or by means of hardware. Wherein, the name of a unit does not constitute a limitation of the unit itself under certain circumstances.
  • the functions described herein above may be performed at least in part by one or more hardware logic components.
  • exemplary types of hardware logic components include: field programmable gate array (FPGA), application specific integrated circuit (ASIC), application specific standard product (ASSP), system on chip (SOC), complex programmable Logical device (CPLD) and so on.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • ASSP application specific standard product
  • SOC system on chip
  • CPLD complex programmable Logical device
  • a machine-readable medium may be a tangible medium, which may contain or store a program for use by or in combination with an instruction execution system, device, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic sexual, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or flash memory), optical fiber, compact disk read-only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM Random Access Memory
  • ROM Read Only Memory
  • EPROM or flash memory Erasable Programmable Read Only Memory
  • CD-ROM compact disk read-only memory
  • magnetic storage or any suitable combination of the foregoing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)
  • Testing And Monitoring For Control Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

说明书摘要本公开实施例公开了神经网络的构建方法、装置和电子设备。该方法包括:将验证样本输入到经过预训练的候选神经网络,得到验证值;基于验证值确定候选神经网络是否满足预设条件;若确定结果为否,基于验证样本,生成新的训练样本对,得到更新后训练数据集,训练数据集包括多个训练样本对;利用更新后训练数据集重新对候选神经网络进行训练,以得到满足预设条件的神经网络。实现了通过根据验证不通过的验证样本自动更新训练样本集,对神经网络重新进行训练,以得到可以验证通过的神经网络。

Description

神经 网络模型 的构建 方法 及装置 相 关申请 的交叉 引用 本 申 请 要 求于 2021 年 08 月 06 日提交 的 , 申请号 为 202110905642.6> 发明名称 为“神经 网络模 型的构 建方 法、 装置和电 子 设备 ”的中国专利 申请的 优先权 ,该申请 的全文 通过 引用结合 在本 申请 中 。 技 术领域 本 公开涉 及人工 智能 技术领 域, 尤其涉及一种 神经 网络模型 的构 建 方法、 装置和电子设 备。 背 景技术 随 着人工 智能技 术的 发展, 神经网络 (Kkmnd Networks? NN) 得 到 了比较 广泛的 应用 。 在机器学 习和认知 科学 领域, 神经网络是一 种 模仿 生物 神经 网络 (动物的中 枢神经 系#充, 特别是大脑) 的结构 和功 能 的数学 模型或 计算模 型, 用于对函数进 行估计 或近似 。 发 明内容 提 供该公 开内容 部分 以便 以简要的 形式 介绍构 思, 这些构 思将在 后 面的具 体实施 方式部 分被 详细描 述。 该公开 内容部 分并不 旨在 标识 要 求保护 的技术 方案 的关键 特征或 必要特 征, 也不旨在用于 限制 所要 求 的保护 的技术 方案的 范围 。 本 公开实 施例提 供了 一种神 经网络 模型 的构建 方法、 装置和电子 设备 。 第 一方面 , 本公开实 施例提 供了一 种神 经网络 模型的 构建 方法, 包括 : 从预设验 证数据 集中 获取验 证样 本, 将所述验 证样 本输入 到经 过 预训练 的候选 神经 网络, 得到验证值 ; 基于所述验 证值确 定所述 候 选神 经网 络是否 满足预 设条 件; 若确定结 果为 否, 基于所述 验证值 与 验证 样本 , 生成新的训 练样 本对, 将所述新的 训练样 本对添 加到 训练 数据 集, 得到更新后训 练数 据集, 训练数据集 包括多 个训练 样本 对, 训 练样本 对包括 训练样 本和 训练样 本对应 的真 实值 ; 利用所述更 新后 训 练数据 集重新 对所述 候选 神经 网络进行 训练 , 以得到满足 所述预 设 条件 的神 经网络 。 第 二方面 , 本公开实 施例提 供了一 种神 经网络 模型的 构建装 置, 包括 : 输入单元 , 用于从预 设验证 数据集 中获 取验证 样本 , 将所述验 证样 本输 入到经 过预训 练的 候选神 经网络 , 得到验证 值; 确定单 元, 用 于基于 所述验 证值确 定所 述候选 神经 网络是 否满足 预设条 件; 训练 数据 生成 单元, 用于若确定 结果为 否, 基于所 述验证 值与验 证样 本, 生成 新的 训练样 本对 , 将所述新的 训练样 本对 添加到 训练数 据集 , 得 到 更新后 训练数 据集 , 训练数据集 包括 多个训 练样本 对, 训练样 本对 包括 训练 样本和 训练样 本对 应的真 实值 ; 训练单元, 用于利用所 述更 新后 训练 数据集 重新对 所述 候选神 经网络 进行训 练, 以得到满足所 述 预设 条件 的神经 网络。 第 三方面 , 本公开实施 例提供 了一种 电子设 备, 包括: 一个或多 个 处理器 ; 存储装置 , 用于存储一 个或 多个程 序, 当所述一个或 多个 程序 被所 述一个 或多个 处理 器执行 , 使得所述 一个或 多个处 理器 实现 如 第一方 面所述 的神经 网络模 型的 构建方 法。 第 四方面 , 本公开实 施例提 供了一 种计 算机可 读介质 , 其上存储 有 计算机 程序, 该程序被处 理器执 行时实 现如 第一方 面所述 的神 经网 络模 型的 构建方 法。 附 图说明 结 合附 图并参考 以下 具体实 施方式 , 本公开各 实施例 的上 述和其 他 特征、 优点及方面将 变得 更加明 显。 贯穿附 图中, 相同或相似 的附 图标 记表 示相同 或相似 的元 素。 应当理解 附图 是示意 性的, 原件和元 素 不一定 按照比 例绘制 。 图 1是根 据本公 开的神 经网络 模型 的构建 方法的 一个实 施例 的流 程 图; 图 2是根 据本公 开的神 经网络 模型 的构建 方法的 另一个 实施例 的 流程 图; 图 3是图 2所示实 施例涉 及的神 经网络 一种结 构示 意图; 图 4提供 了其示 出了验证 数据 以及验 证过程 示意 图; 图 5是根 据本公 开的神 经网络 模型 的构建 装置的 一个实 施例 的流 程 图; 图 6是本 公开的 一个实 施例 的神经 网络模 型的构 建方法 、 神经网 络模 型的 构建装 置可 以应用于 其中 的示例 性系统 架构 ; 图 7是根据 本公开 实施例 提供 的电子 设备的 基本 结构的 示意 图。 具体 实施 方式 下 面将参 照附 图更详 细地描 述本公 开的 实施例 。 虽然附图 中显示 了 本公开 的某些 实施例 , 然而应 当理解的 是, 本公开可以通 过各 种形 式 来实现 , 而且不应该 被解 释为限 于这里 阐述 的实施 例, 相反提供 这 些 实施例 是为 了更加透 彻和 完整地 理解 本公开 。 应当理解的 是, 本公 开 的附图 及实施 例仅 用于示 例性作 用, 并非用 于限制 本公开 的保 护范 围 。 应 当理解 , 本公开的 方法实 施方式 中记 载的各 个步骤 可以按 照不 同 的顺序 执行, 和/或并行 执行。 此外, 方法实施方式 可以包 括附加 的 步骤 和 /或省略执行 示出的 步骤。 本公开的范 围在此 方面不 受限 制。 本 文使 用的术 语 “包括 ''及其变形是开放 性包 括, 即 “包括但不限 于 ”。术语 “基于 ''是 “至少部分地基于 ”。术语 “一个实施例 ''表示“至少一 个 实施例 '';术语 “另一实施例 ''表示 “至少一个另外的实施例 '';术语 “一 些 实施例' '表示 “至少一些实施例 ”。其他术语的相 关定义 将在下 文描 述 中给 出。 需 要注意 , 本公开中 提及的 “第一 ''、 "第二 ''等概念仅用于对不同 的装 置、 模块或 单元进 行区 分, 并非用于 限定 这些装 置、 模块或 单元 所执 行的 功能的 顺序或 者相互 依存 关系。 需 要注意 , 本公开中提 及的 “一个 ”、 “多个”的修饰 是示 意性而 非 限制 性的 , 本领域技术 人员 应当理 解, 除非在 上下文 另有明 确指 出, 否 则应该 理解为 “一个或 多个 "。 本 公开实 施方式 中的 多个装 置之 间所交 互的消 息或者 信息 的名称 仅 用于说 明性的 目的 , 而并不是用 于对这 些消 息或信 息的范 围进行 限 制 O 请 参考图 1 , 其示出了根 据本公 开的神 经网 络模型 的构建 方法 的 一个 实施 例的流 程。 如图 1所示, 神经网络 模型 的构建 方法, 包括以 下 步骤: 步 骤 101 , 从预设验证数据 集中获 取验证 样本 , 将所述验证 样本 输 入到经 过预训 练的候 选神经 网络 , 得到验证值 。 在 对完成 预设功 能的神 经网络 构建 时,需要对神 经网 络进行 训练、 验证 和测 试等。 为 了构建 上述神 经网络 , 可以准备 多个样 本, 组成样本数据 集。 样 本数据 集中的 一部分 样本 用于对 初始神 经网络 进行 训练, 一部分样 本 用于对 经过训 练后的 候选神 经网 络进行 验证 。 如果验证不 通过 , 则 继续 对神 经网络 进行训 练。 验 证数据 集中可 以包括 多个验 证样 本。 每个验证样本 可以预 先对 应一 个真 实值。 上述验证样 本可以 是事先 确定 的。 上述验证 样本可 以 是在 候选 神经网 络的训 练样本 集中 未出现 的。 可 以从预 设验证 数据 集中逐 个取 出验证样 本对 候选神 经网络 进行 验证 。 验证数据 集中的 验证 样本的 数量可 以根据 具体 的应 用场景进 行 设置 , 此处不进 行限制 。 上 述候选 神经 网络是经 过训 练数据 集进行 过预 训练的 神经 网络。 上述 神经 网络可 以是各 种神 经网络 , 可以是人工 神经 网络, 卷积神经 网络 、 循环神经 网络等 。 上 述候选 神经 网络经过 训练 数据的 训练之 后, 可以初步设置 神经 网络 中的超 参数 。 这里的超 参数包 括神经 网络的 层数 、 每一个隐藏 层 中神 经元 的个数 、 神经网络隐 藏层 的权重 参数等 。 对候选 神经 网络进 行验证 时, 若验证不 通过 , 则需要通过重 新训 练神 经网 络对上 述超参 数进行 调整 。 在 一些应 用场景 中, 训练后的神经 网络 可以用 于图像 识别 , 上述 验证 样本 可以包 括待识 别对 象的 图像。 上述验 证样本 的真实 值为 用于 指示 待识 别对象 的标识 。 上述标识 可以包 括数字 、 符号等。 在 另外一 些应 用场景 中, 训练后的 神经 网络用 于数据 索引, 上述 验证 样本 可以为 用于对 数据 进行索 引的键 值。 验证样本的真 实值 为索 引对 应的 数据的 存储位 置。 上 述候选 神经 网络可 以是经 过如下 步骤训 练得到 : 首 先, 获取训练 样本 集, 所述训练 样本 集包括 多个训 练样 本对, 所 述训练 样本对 包括训 练样 本以及 所述训 练样本 对应 的真实值 。 这 里的训 练样集 中的训 练样 本对的 数量可 以为数 千个 、数万个等 。 若神 经网 络是用 于图像 识别 的神经 网络, 上述训练样 本集中 的训练 样 本 可以包括 待识 别对 象的图像 。上述待识 别对 象的数 量可 以包括 多个。 可选 地, 上述待识别对 象可 以为不 同的人 。 其 次, 将训练样 本作 为输入 , 将真实值 作为输 出对初 始神 经网络 进行 训练 , 直至满足预 设条件 , 得到所述 候选神 经网络 。 可 选地, 这里的预设 条件可 以是训 练次数 达到预 设次 数阈值 。 可 选地, 这里的预设 条件可 以是预 设损失 函数 的取值 最小。 步 骤 102, 基于所述 验证值 确定所 述候 选神经 网络是 否满足 预设 条件 。 在 一些可 选的实 现方 式中, 上述预设条 件可以 为验证 值与验 证样 本对 应的 真实值 之间的 差异 小于等 于预设 阈值。 在 图像识 别应 用场景 中, 上述验证 值可 以为候 选神经 网络将 验证 样 本映射 为目标 对象的 概率 值。 若验证样 本为 目标对 象的 图像, 则验 证样 本的 真实值 为 l o 可以计算上述概率 值与 1 之间的差 异是否 小于 等 于预设 阈值。若小 于等于 预设阈 值,则确定神 经网 络满足 预设条 件, 否 则确定神 经 网络不满 足预设 条件 。 进一步地 , 若验证样本 的数量 为 多个 , 作为一种 实现 方式, 各个验证样 本分别 对应的 验证值 与真 实值 之 间的差 异均小 于等于 预设 阈值, 可以确定上 述神经 网络验 证预设 条 件 。 作 为示 意性说 明, 若神经 网络应 用于图像 识别 。 验证样本 为目标 对 象 A的 图像 A1、 A3、 A4、 A5o 在对候选神经 网络进 行验 证时, 可 以将 上述 A1、 A3、 A4、 A5依次输入 到候选 神经 网络。 可以依 次得到 候选 神经 网络的 5个验证 值: VAI、 VA2、 VA3、 VA4、 VA5。 上述 5个 验证 值分 别为将 上述 图像 A1、 A3、 A4、 A5映射为目标对 象 A的 概率 值 。 上述验证样 本为 目标对 象 A的 图像, 因此验证样本 对应 于目标 对 象 A的真 实值 为 l o可以依次计算 上述 验证值 VAI、 VA2、 VA3、 VA4、 VA5 与 1之间 的差异 , 若各验证值 分别 与 1之间 的差异 小于 等于预 设 阈值 , 则神经 网络满足 预设 条件。 若存在至少一 个验 证值 大于预设 阈 值 , 可以确定神 经网络 不满足 预设 条件。 作 为另一 种实现 方式 , 各个验证样 本分 别对应 的验证 值与真 实值 之 间的差 异的均 值小于 等于预 设阈值 , 仍 以上述 示例进 行说 明, 若上述验证 样本 A1、 A3、 A4、 A5对应 的验 证值 与真实 值 “ 1 "之间的差异分别为 qAl、 qA2、 qA3、 qA4、 qA5 , 若 qAl、 qA2、 qA3、 qA4、 qA5的均值 小于等 于阈值 , 可以确定 神经 网络 满足 预设条 件, 否则, 可以确 定神经 网络不 满足预 设条件 。 进 一步可 选地 , 上述预设条 件可 以为对掺 杂 了噪声的 验证样 本所 得 到的验 证值与 验证样 本对 应的真 实值之 间的 差异小 于等于 预设 阈值。 在 这些可 选的实 现方 式中, 可以对验证 样本添 加噪声 , 将添加了 噪 声的验 证样本 输入 到候选 神经 网络。 若候选神 经网 络对添 加了噪 声 的验 证样 本输 出的验证 值与 验证样 本的真 实值 之间的 差异 小于预设 阈 值 , 可以确定神 经网络 满足预 设条 件, 否则, 确定神 经网络 不满足 预 设 条件。 上 述添加 了噪声 的验 证样本 可以为 对验 证样本 添加干 扰因 素。 以 验证 样本 为图像 为例 , 添加了噪声 的验证 样本 可以为 在将 图像中 的目 标对 象的 图像进 行翻转 、 平移、 锐化、 添加不 同颜 色等处理 后形 成的 验证 样本 。 步 骤 103, 若确定结果为否 , 基于所述验证 值与验 证样 本, 生成新 的训 练样 本对, 将所述新的 训练样 本对添 加到 训练数 据集, 得到更新 后训 练数 据集, 训练数据集 包括多 个训练 样本 对, 训练样本 对包括 训 练样 本和 训练样 本对应 的真 实值。 若 步骤 102的确定 结果为 否, 也即, 候选神经网络 不满足 预设 条 件 , 可以对候选 神经 网络重新 进行 训练。 在对候选神 经网络 进行重 新 训 练时, 可以更新训练 样本数 据。 上 述基于 验证值 与验 证样本 , 生成新训 练样本 可以 包括: 将验证 值 不满所 述预设 规范的 验证样 本, 作为新增 训练样 本, 将所述验证 样 本对 应的 真实值 作为新 增训练 样本 的标签 , 生成新的训 练样 本对。 进 一步地 , 上述基于 所述预 测值与 验证 样本, 生成新训练样 本, 还 包括: 对所述验证样 本添 加预设 噪声 , 将添加了预 设噪声 的验证 样 本作 为新 增训练 样本, 将验证样本 对应的 真实值 作为 新增训 练样 本的 标 签, 生成新增 训练样 本对 。 上 述噪声 可以 包括在 验证样 本中添 加的 干扰因 素。 以验证样本为 目标 对象 的图像 为例 , 上述噪声可 以为将 目标 对象的 图像进 行平 移、 旋转 等几 何变换 , 或者添加 或降低 图像的 明暗度 等。 步 骤 104, 利用所述 更新后 训练数 据集 重新对 所述候 选神 经网络 进行 训练 , 以得到满足 所述预 设条 件的神 经网络 。 再 次对候 选神经 网络进 行训 练时, 神经网络内 部可以 自动调 整超 参数 。 通 过更新 后的训 练数据 集对 候选神 经网络 进行 训练, 使得经过再 次训 练后 的神经 网络可 以正确 识别 添加到 训练数 据中 的上述 目标验 证 样 本。 在 一些应 用场景 中, 可以经过多次 验证 、 再训练的过 程确 定满足 预设 条件 的神经 网络。 本 实施例 提供的 神经 网络的 构建方 法, 通过从 预设验 证数据 集中 获取 验证 样本, 将所述验证 样本输 入到经 过预 训练的 候选神 经网络 , 得 到验证值 ; 基于所述 验证值 确定 所述候 选神经 网络 是否满 足预设 条 件 ; 若确定结果 为否, 基于所述验 证值与 验证样 本, 生成新的训练 样 本对 , 将所述新 的训练 样本 对添加 到训练 数据 集, 得到更新 后训 练数 据集 , 训练数据 集包括 多个 训练样 本对, 训练样本对 包括训 练样 本和 训练 样本 对应的 真实值 ; 利用所述 更新后 训练数 据集 重新对 所述候 选 神经 网络进 行训 练, 以得到满足所 述预设 条件 的神经 网络, 实现了通 过根 据验 证不通 过的验 证样 本自动 更新训 练样 本集, 对神经网络重 新 进行 训练 , 以得到可 以验证通 过的神 经网 络。 请 参考图 2, 其示出了根 据本公 开的神 经网 络的构 建方法 的另一 个 实施例 的流程 图。 如图 2所示 , 该方法包 括如下 步骤 : 步 骤 201 , 获取训练样本集 , 所述训练样 本集 包括 多个训 练样本 对 , 所述训练样 本对包 括训练 样本 以及所 述训练 样本对 应的真 实值 。 神 经网络 已经广 泛应 用于多 种行业 , 但是在关键 系统 (例如操作 系 统、 数据库、 网络系统) 中还未被广泛 应用 。 在这些环境 中的应 用 神经 网络 的一个 难点是 如何确 保神 经网络 的行为 是明确 定义 并且可 控 的 。 神 经网 络验证 技术 可以 用来验 证神 经 网络是 否满足 给 定的规 范 (specification)。 在 本实施 例中, 上述规范可 以是 一种描 述神经 网络输 入输 出关系 的表 达式 。 神经网络的 规范跟 神经 网络的 具体功 能是 紧密相 关的。 目前验证 技术主 要用 于测试 , 并不涉及如 何构 建一个 满足规 范的 神经 网络 。 上 述预设 规范可 以包括 预设 条件, 例如: 索引函数, 以及索引值 (索引值 对应的 索引存 储位 置) 与真实值 (真实存储 位置) 的偏差小 于预 设阈值 。 上 述索引 函数可 以为哈 希索 引函数 等。 上 述训练 样本集 可以 是用户 提供的 。 训练样本 集可 以包括 多个训 练样 本对 。 训练样本对 包括 用于对 待索 引数据进 行索 引的索 引值 , 以 及待 索引 数据的 真实获 取位置 (真实值 ); 所述验证样本包 括对数 据进 行 索引的 索引值 。 步 骤 202, 将训练样 本作为 输入 , 将真实值作 为输 出对初始 神经 网络 进行训 练, 直至满足预设 条件 , 得到所述候 选神经 网络 。 上 述预设 条件 包括训 练次数 大于等 于预设 次数 阈值。 或 者上述 预设条 件包括 预设 损失函 数值 小于等 于预设 阈值。 步 骤 203 , 从预设验证数据 集中获 取验 证样本 , 将所述验证 样本 输 入到经 过预训 练的候 选神 经网络 , 得到验证值 , 所述候选 神经 网络 用 于数据 索引。 从 预设验 证数据 集中 获取验 证样本 , 将所述验 证样本 输入 到经过 预训 练的 候选神 经网络 , 得到验证值 ; 其中神经 网络 用于数据 索引 。 本 实施例 的神经 网络 用于数据 索引 。 上 述数据 索引可 以包括 以下 之一 : 数据库存储 数据索 引、 操作系 统 资源索 引、 网络数据中心资 源分 配索引 。 在 一些应 用场景 中, 上述神经网络 用于数 据库 数据索 引, 上述索 引值 为数 据库对 应的键 值对 中的键 。 通常, 在数据库 中存储 数据 , 可 以 有该数 据唯一 的存储 位置 。 可以生成 用于指 示该位 置对应 的索 引值 (键)。 会形成用于索 引的键 值对 。 在 另外一 些应 用场景 中, 上述神经 网络 用于操 作系统 任务索 引。 可 以利用 神经 网络来实 现任 务调度 算法。 上述预设规 范可 以包括任 务 调度 函数 。 每一个任 务可以 对应一 个标识 。 通过神经 网络可 以实现 为 操作 系统 任务进 行任 务调度 。 训练样本对 和验 证样本 对可 以包括任 务 标识 以及 任务标 识对应 的真 实的处 理单元 (例如计算 单元、 存储单元 等 ) 的标识。 上 述索引 值可 以为任 务的标 识。 在 一些应 用场景 中, 上述神经网络 用于 网络数 据中心 资源分 配索 引 。 网络数据中 心资 源分配 索引中 , 预设规范 可以包 括预设 资源分 配 函数 。 步 骤 204, 基于所述 验证值 确定所 述候 选神经 网络是 否满足 预设 条件 。 这 里的预 设条件 可以 为上述 预设规 范。 以 上述神 经网络 应用于 数据库 索引 为例进 行说 明。 在 一些应 用场景 中, 所述神经网络 为多层 级神 经网络 (下面称多 层 级索引 网络)。多层级神 经网络 模型 中的每一 层神 经网络 可以包 括至 少一 个神 经网网 络模型 。 在 这些应 用场景 中, 上述步 骤 203包 括: 将所述验 证样 本输入 到 经过 预训 练的多 层级神 经网 络, 获取多层 级神 经网络 中的中 间层级 神 经 网络输 出的中 间验证 值, 以及所述神经 网络输 出的 验证值 。 进而上 述 步骤 204包括: 基于所述中 间验证值 和所 述验证 值确定 多所述 候选 神 经网络是 否满 足预设 条件 。 应 用于数 据索 引的多层 级神 经网络 , 上述预设 规范除 了包括 神经 网 络的输 入、 输出满足 预设 索引函 数、 验证值 与真实 值的差 值小 于预 设 数值之 外, 可以包括 中间 验证值 与中 间真实 值之 间的差值 小于 预设 中 间数值 。 下 面以两 层树状 结构 的神经 网络为 例进行 说明。请 参考 图 3, 图 3 示 出了图 1和 图 2所示 实施例 涉及 的神经 网络一 种结构 示意 图。 图 3 为 两层树 状结构 的神经 网络的 结构示 意图 。 如图 3所示 , 两层树状结 构 的神经 网络的 每一个 节点都 可以 是一个 神经 网络。 多 层级索 引网络 包括 第一层 的神经 网络模 型 301和第二层 的神 经 网 络模型 302。 第一层的神经 网络模 型 301包括模型 1.1等, 第二层 的 神经 网络模型 302包括模 型 2.1、 模型 2.2、 模型 2.3等。 多 层级索 引网络 的输 入为一 个数据 库的 Key(索引值 ), 输出为该 Key 对应 的数据 在存 储空 间中的位 置。 先 将 Key通过 第一 层的神 经网络 模型模 型 1.1 ; 第一层模型 301 模 型 1.1输出可 以为第 二层神 经网络 模型 302的一个神 经网络 模型 (如 图 3 所示的模 型 2.1); 然后 Key会作 为第二 层神 经网络模 型选 中的 model 的一个 输入 ;最终输出为 该 Key对应 数据所 在存储 空间 的位置 。 多 层级索 引网络 预测 出的存 储空 间的位 置和真 实存储 空间 中的位 置 之间的 差异可 以小于 预设 数值。这里 的预设 数值例 如可 以为 10、 50、 100 等。 上述预设数 值可 以根据 应用 的场景 进行设 置, 此次不 进行限 制 。 请 参考 图 4, 其示出 了验证数 据以 及验证 过程示 意图 。 图 4的验证 数据部 分是真 实的 数据库 中 Key和 对应 的存储 空间的 位 置 (真实值), 可以有如下规范 定义 : 针 对第一 层神经 网络模 型 (模型 1.1), 可以要求输出结 果和真 正 的 第二层 神经 网络模型 model之 间差 1个位置之 内。 例如 Key=8, 应 该 选择模 型 2.1。可以要求输 出结果 也即中 间验证 值与 中间真 实值之 间 的 差值最 大可 以为 1 , 即最多可以选择 Model2.2 ; 若验证值大于 1 , 例 如 验证值 指向 Model2.3 ,就验证失败,确定神经 网络不满 足预设 条件 。 针 对第二 层模型 (模型 2.1), 可以要求验证 值 (神经网络最终 输 出 的结果 )和真正的 Key对应 的位置 之间的 差异 小于预设 数值 。例如, Key=8, 模型 2.1应该返 回 Position。(见图 4中 Key=8对应 的位置 ), 所 以如果 最终结 果是 P osition=3 (那么误差是 2) 处于可接受范围; 如 果 结果是 P osition=102, 那么误差为 101 , 则验证失败 (假设误差要在 100 位置之 内)。 步 骤 205, 若确定结 果为否 , 基于所述验证 值与验 证样 本, 生成新 的 训练样 本对, 将所述新的 训练样 本对 添加到 训练数 据集 , 得到更新 后 训练数 据集, 训练数据集 包括多 个训 练样本 对, 训练样 本对包 括训 练 样本和 训练样 本对应 的真 实值。 在 本实施 例中 ,仍以图 4中的 验证数 据为 例进行 说明 ,若 Key=8, 由神 经网 络输出 的验证 值为 Position。 0 , 则确定神经网络不满足预设 条件 。 可以生成 新的训 练样 本对: Key=8, Position=l , 将新生成的训 练样 本对 加入到 原训练 数据 集中, 得到更新后 训练数 据集。 再使用更 新后 训练 数据集 对候选 神经 网络重 新进行 训练。 步 骤 206, 利用所述 更新后 训练数 据集 重新对 所述候 选神 经网络 进行 训练 , 以得到满足 所述预 设条 件的神 经网络 。 与 图 1所示实施 例相比 , 本实施例 突出了 神经 网络用于 数据 索引 时对 神经 网络进 行验证 的方案 , 有利于扩 展神经 网络的 应用 范围。 进 一步参 考图 5, 作为对上述各 图所 示方法 的实现 , 本公开提 供 了神 经网 络模型 的构建 装置的 一些 实施例 , 该装置实施 例与 图 1所示 的 方法实 施例相 对应, 该装置具体 可以应 用于各 种电子 设备 中。 如 图 5所示, 本实施例 的神经 网络模 型的 构建装 置包括 : 输入单 元 501、 确定单元 502、 训练数据生成 单元 503以及训 练单元 504。 其 中 , 输入单元 501 , 用于从预设验证 数据集 中获取 验证样 本,将 所述验 证样 本输 入到经 过预训 练的候 选神 经网络 ,得到验证 值;确定 单元 502, 用 于基于 所述验 证值确 定所 述候选 神经 网络是否 满足 预设条 件; 训练 数据 生成 单元 503, 用于若确定结 果为否 , 基于所述 验证值 与验证 样 本 , 生成新的训 练样 本对的 , 将所述新的 训练 样本对 添加到 训练数 据 集 , 得到更新后 训练数 据集 , 训练数据集 包括 多个训 练样本 对, 训练 样 本对包 括训练 样本和 训练 样本对 应的真 实值 ; 训练单元 504, 用于 利 用所述 更新后 训练数 据集 重新对 所述候 选神 经网络 进行训 练, 以得 到 满足所 述预设 条件的 神经 网络。 在 一些可 选的实 现方 式中, 神经网络的构 建装 置还包 括训练 单元 (图中未 示出)。 训练单元用 于: 获取训练样 本集 , 所述训练样 本集包 括 多个训 练样本 对, 所述训 练样本 对包括 训练 样本以 及所述 训练样 本 对应 的真 实值 ; 将训练样本 作为输 入, 将真实值 作为 输出对 初始神 经 网络 进行训 练, 直至满足预设 条件 , 得到所述候 选神经 网络 。 在 一些可 选的实 现方 式中, 所述预设条 件, 包括: 验证值 与验证 样 本对应 的真实 值之 间的差 异小于 等于预 设阈值 。 在 一些可 选的实 现方 式中, 所述预设条 件包括 : 神经网络 的输入 和输 出满 足预设 关系。 在 一些可 选的实 现方 式中, 神经网络的构 建装 置还包 括再训 练单 元 (图中未示出), 再训练单元 进一 步用于 : 所述基于所述 验证值 与验 证样 本, 生成新训练样 本, 包括: 将验证值不 满所述 预设规 范的验 证 样 本, 作为新增训 练样本 , 将所述验证样 本对 应的真 实值作 为新增 训 练样 本的 标签, 生成新的训 练样本 对。 在 一些可 选的实 现方 式中, 再训练单元 进一步 用于 : 对所述验证 样 本添加 预设噪 声,将添加 了预设 噪声 的验证 样本作 为新增 训练样 本, 将 验证样 本对应 的真 实值作 为新增 训练样 本的 标签, 生成新增训 练样 本 对。 在 一些可 选的 实现方 式中, 所述神经网 络用于 数据 索引, 以及所 述 训练样 本对 包括用 于对待 索引数 据进行 索引 的索 引值, 以及待索引 数 据的真 实获取 位置 ; 所述验证样 本包括 对数据 进行 索引的 索引值 。 在 一些可 选的 实现方 式中, 所述数据索 引包括 以下之 一: 数据库 存 储数据 索引、 操作系统任 务索引 、 网络数据 中心资 源分配 索引。 在 一些可 选的 实现方 式中, 所述神经网络 为多层 级神 经网络 。 在 一些可 选的 实现方 式中, 所述预设条 件包括 : 所述验证 值对应 的 存储位 置与验 证样 本对应 的真实 存储位 置之 间的差 异小于 预设 数值。 在 一些可 选的 实现方 式中, 所述输入单 元 501进一 步用 于将所 述 验 证样本 输入到 经过预 训练 的多层 级神经 网络 , 获取多层级 神经 网络 中 的中间 层级神 经网络 输出 的中间 验证值 , 以及所述 神经 网络输 出的 验 证值; 以及确定单元 502进一 步用 于: 基于所述 中间验 证值和 所述 验 证值确 定多所 述候选 神经 网络是 否满足 预设条 件。 请 参考 图 6, 图 6示出了 本公开 的一个 实施例 的神 经网络 的构建 方 法, 或神经 网络构建 装置 可以应 用于其 中的示 例性 系统架 构。 如 图 6所示, 系统架构可 以包括终 端设 备 601、 602、 603 , 网络 604, 服务器 605。 网络 604用以在终端 设备 601、 602、 603和服务器 605 之 间提供通 信链路 的介 质。 网络 604可以包 括各种 连接 类型, 例 如 有线、 无线通信链路 或者 光纤电 缆等等 。 终 端设备 601、 602、 603可以通过网 络 604与服 务器 605交互 , 以接 收或 发送消 息等 。 终端设备 601、 602、 603上可以安装有 各种客 户 端应用 , 例如网页浏 览器 应用、 搜索类应用 、 新闻资讯 类应用 。 终 端 设备 601、 602、 603 中的客户端应用可 以接收 用户的 指令, 并根据 用 户的指 令完成 相应 的功能 , 例如根据 用户指 令将样 本数据 发送 给服 务 器 605o 终 端设备 601、 602、 603可以是硬件 , 也可以是 软件。 当终端设 备 601、 602、 603为硬件时, 可以是具有显 示屏并 且支持 网页 浏览的 各 种电子 设备, 包括但不限 于智能 手机 、 平板电脑、 电子书阅读 器、 MP3 播放器 (Moving Picture Experts Group Audio Layer III, 动态影像 专 家压缩 标准音 频层 面 3)、 MP4 (Moving Picture Experts Group Audio Layer IV, 动态影像 专家 压缩标 准音频 层面 4) 播放器、 膝上型便携计 算 机和台 式计算 机等等 。 当终端设 备 601、 602、 603为软件时, 可以 安 装在上 述所列 举的 电子设 备中。 其可以实现 成多个 软件或 软件 模块 (例如用 来提供 分布 式服务 的软件 或软件 模块 ),也可以实现成 单个软 件 或软件 模块。 在此不做具 体限定 。 服 务器 605可以是 提供各 种服 务的服 务器, 例如根据由 终端设 备 601、 602、 603发送的样本数 据构 建神经 网络,将 构建成 功的神 经网络 发送 给终 端设备 601、 602、 603 o 需 要说明 的是 , 本公开实施 例所提 供的 神经 网络模型 的构建 方法 可 以由服 务器 604执行, 相应地, 神经网络模 型的 构建装 置可 以设置 在服 务器 604中。 另外神经网络 模型的 构建 方法可 以也可 以由终 端设 备 601、 602、 603执行, 相应地, 神经网络 模型的 构建装 置可 以设置 在 终端设 备 601、 602、 603中 应 该理解 , 图 6中的终 端设备 、 网络和服 务器的 数目仅 仅是 示意 性 的。根据实 现需要 ,可以具 有任意 数目的 终端设 备、 网络和服务 器。 下 面参考 图 7, 其示出 了适于 用来实现 本公 开实施 例的 电子设 备 (例如图 6中的服 务器 或终端 设备 ) 的结构示意 图。 本公开实 施例 中 的 终端设 备可 以包括但 不限 于诸如 移动 电话、 笔记本电脑、 数字广播 接 收器、 PDA (个人数 字助理 )、 PAD(平板电脑 )、 PMP(便携式多 媒 体播 放器 )、 车载终端 (例如车载导航 终端 ) 等等的移动终 端以及 诸如 数 字 TV、 台式计算机 等等 的固定 终端。 图 7示出的 电子设 备仅 仅是一 个示 例, 不应对本公开 实施例 的功 能和使 用范 围带来任 何限 制。 如 图 7所 示, 电子设备 可以 包括处 理装置 (例如中央处 理器 、 图 形 处理器 等) 701 , 其可以根据存储 在只读 存储器 (ROM ) 702中的程 序 或者从 存储装 置 708加载到随 机访 问存储 器 (RAM) 703 中的程序 而执 行各 种适当 的动作 和处理 。 在 RAM 703 中, 还存储有电子 设备 700 操作所 需的 各种程 序和数 据。 处理装置 701、 ROM 702以及 RAM 703 通过总 线 704彼此相连 。 输入 /输出 (I/O) 接口 705也连接至总线 704o 通常 , 以下装置可 以连接 至 I/O接口 705 : 包括例如触摸屏、 触 摸板 、 键盘、 鼠标、 摄像头 、 麦克风、 加速度 计、 陀螺仪等 的输 入装 置 706 ; 包括例如液晶显 示器 (LCD)、 扬声器、 振动器等的输 出装 置 707 ; 包括例如 磁带 、 硬盘等的存 储装置 708 ; 以及通信装置 709。 通 信装 置 709可以允 许电子 设备 与其他设 备进 行无线 或有 线通信 以交换 数据 。 虽然图 7示出了 具有各 种装置 的电 子设备 , 但是应理解 的是 , 并 不要求 实施或 具备所 有示 出的装 置。 可以替 代地实 施或具 备更 多或 更 少的装 置。 特 别地, 根据本公开 的实施 例, 上文参 考流程 图描述 的过程 可以 被 实现为 计算机 软件程 序。 例如, 本公开的实 施例包 括一种 计算机 程 序产 品, 其包括承载在 非暂 态计算 机可读 介质 上的计 算机程 序, 该计 算机 程序 包含用 于执行 流程 图所示 的方 法的程 序代码 。 在这样的 实施 例 中, 该计算机 程序可 以通过 通信 装置 709从网络 上被下 载和安 装, 或者 从存 储装置 708被安装 , 或者从 ROM 702被安 装。在该 计算 机程 序 被处理 装置 701执行时 , 执行本公 开实施 例的方 法中 限定的 上述功 能 。 需 要说 明的是 , 本公开上述 的计算 机可 读介质 可以是 计算 机可读 信 号介质 或者计 算机 可读存 储介质 或者是 上述 两者的 任意组 合。 计算 机 可读存 储介质 例如可 以是 — 但 不限 于 — 电、磁 、光、 电磁、 红外 线 、 或半导体的 系统 、 装置或器件 , 或者任意 以上的 组合 。 计算机可 读 存储介 质的更 具体 的例子 可以包 括但 不限于 : 具有一个或 多个 导线 的 电连接 、 便携式计算机 磁盘 、 硬盘、 随机访问存储 器 (RAM)、 只读 存 储器 (ROM )、 可擦式可编程只 读存储 器 (EPROM 或闪存 )、 光纤、 便 携式紧 凑磁盘 只读 存储器 (CD-ROM )、 光存储器件 、 磁存储器 件、 或 者上述 的任意 合适 的组合 。 在本公开 中, 计算机可 读存储 介质 可以 是任 何包 含或存 储程序 的有 形介质 , 该程序可 以被指 令执行 系统 、 装 置 或者器 件使 用或者 与其结 合使 用。 而在本公 开中, 计算机可读 信号 介 质可以 包括在 基带 中或者 作为载 波一部 分传 播的数 据信号 , 其中承 载 了计算 机可读 的程序 代码 。这种传播 的数据 信号可 以采 用多种 形式, 包括 但不 限于 电磁信 号、 光信号或 上述 的任意 合适的 组合 。 计算机可 读 信号介 质还可 以是 计算机 可读存 储介质 以外 的任何 计算机 可读 介质 , 该 计算机 可读信 号介质 可以 发送、传播 或者传 输用于 由指令 执行 系统、 装 置或者 器件使 用或者 与其 结合使 用的程 序。 计算机可读介 质上 包含 的程 序代 码可 以用任何 适当 的介质 传输, 包括但不 限于:电线 、光缆、 RF (射频) 等等, 或者上述 的任意 合适的 组合 。 在 一 些实 施 方式 中 , 客户端 、 服务器 可 以利 用诸 如 HTTP ( HyperText Transfer Protocol , 超文本传输协议)之类的任何当前已知 或 未来研 发的 网络协议 进行 通信, 并且可以与任 意形 式或介 质的数 字 数 据通信 (例如,通信网络 )互连。通信网络 的示例 包括局 域网 ("LAN”), 广 域网 ("WAN"), 网际网 (例如, 互联网) 以及端对端网络 (例如, ad hoc端对端网 络), 以及任何当前 已知 或未来 研发的 网络。 上 述计算 机可读 介质 可以是 上述 电子设 备中所 包含 的; 也可以是 单 独存在 , 而未装配入 该电 子设备 中。 上 述计算 机可读 介质 承载有 一个或 者多 个程序 , 当上述一 个或者 多 个程序 被该 电子设备 执行 时, 使得该 电子设 备执行 如下操 作: 从预 设 验证数 据集 中获取验 证样 本, 将所述验 证样 本输入 到经过 预训 练的 候 选神经 网络, 得到验证值 ; 基于所述验 证值确 定所 述候选 神经 网络 是 否满足 预设条 件; 若确定结果为 否, 基于所 述验证 值与验 证样 本, 生 成新的 训练样 本对 , 将所述新的 训练样 本对 添加到 训练数 据集 , 得 到 更新后 训练数 据集 , 训练数据集 包括 多个训 练样本 对, 训练样 本对 包括 训练 样本和 训练样 本对 应的真 实值 ; 利用所述更 新后训 练数 据集 重 新对所 述候选 神经 网络进 行训练 , 以得到满 足所述 预设条 件的神 经 网 络。 在 一些可 选的实 现方 式中, 在所述从预 设验证 数据集 中获 取验证 样 本, 将所述验 证样 本输入 到经过 预训练 的候 选神经 网络, 得到验证 值之 前, 上述电子 设备还 执行如 下操 作: 获取训练 样本集 , 所述训练 样 本集包 括多个 训练样 本对 , 所述训练样 本对 包括训 练样本 以及 所述 训 练样本 对应的 真实值 ; 将训练样 本作为 输入 , 将真实值作 为输 出对 初始 神经 网络进 行训练 ,直至满足 预设条 件,得到所 述候选 神经 网络。 在 一些可 选的实 现方 式中, 所述预设条件 , 包括: 验 证值与 验证样 本对应 的真 实值之 间的差 异小 于等于 预设阈 值。 在 一些可 选的实 现方 式中, 所述预设条 件包括 : 神经网络 的输入 和输 出满 足预设 关系。 在 一些可 选的实 现方 式中, 所述基于所 述验证 值与验 证样 本, 生 成新 训练 样本, 包括: 将验证值不 满所述 预设 规范的 验证样 本, 作为 新增 训练样 本, 将所述验证 样本对 应的真 实值作 为新 增训练 样本的 标 签 , 生成新的训 练样本 对。 在 一些可 选的实 现方 式中, 所述基于所 述预测 值与验 证样 本, 生 成新 训练 样本, 还包括: 对所述验 证样 本添加 预设噪 声, 将添加 了预 设噪 声的 验证样 本作 为新增训 练样 本, 将验证样 本对 应的真 实值作 为 新增 训练样 本的 标签, 生成新增训练 样本 对。 在 一些可 选的实 现方 式中, 所述神经网 络用于 数据索 引, 以及所 述训 练样 本对包 括用 于对待 索引数 据进行 索引 的索引 值, 以及待索引 数据 的真 实获取 位置 ; 所述验证样 本包括 对数据 进行 索引的 索引值 。 在 一些可 选的实 现方 式中, 所述数据索 引包括 以下之 一: 数据库 存储 数据 索引、 操作系统任 务索引 、 网络数据 中心资 源分配 索引。 在 一些可 选的实 现方 式中, 其中, 所述神经 网络为多 层级神 经网 络 。 在 一些可 选的实 现方 式中, 所述预设条 件包括 : 所述验证值 对应 的 存储位 置与验 证样 本对应 的真实 存储位 置之 间的差 异小于 预设数 值。 在 一些可 选的实 现方 式中, 所述从预设 验证数 据集 中获取验 证样 本 ,将所述验证 样本输 入到 经过预 训练的 候选神 经网 络,得到验证 值, 包括 : 将所述验 证样 本输入 到经过 预训练 的多层 级神 经网络 , 获取多 层 级神经 网络中 的中 间层级神 经网 络输 出的中 间验证值 , 以及所述 神 经 网络输 出的验 证值 ; 以及所述基 于所述 验证值 确定 所述候 选神经 网 络是 否满 足预设 条件 , 包括: 基于所述 中间验 证值和 所述验 证值确 定 多所 述候 选神经 网络是 否满足 预设 条件。 本 公开实 施例提 供的 神经网 络模型 的构建 方法 、装置和电子 设备, 通过 从预 设验证 数据集 获取 中取验 证样 本, 将所述验 证样本 输入 到经 过预 训练 的候选 神经 网络, 得到验 证值 ; 基于所述验 证值确 定所述 候 选神 经网 络是否 满足预 设条件 ; 若确定结 果为否 , 基于所述 验证值 与 验证 样本 , 生成新的训 练样 本对, 将所述新的 训练样 本对添 加到 训练 数据 集, 得到更新后训 练数 据集, 训练数据集 包括多 个训练 样本 对, 训 练样本 对包括 训练样 本和 训练样 本对应 的真 实值; 利用所述更 新后 训 练数据 集重新 对所述 候选 神经 网络进行 训练 , 以得到满足 所述预 设 条件 的神 经网络 , 实现了通过 根据 验证不 通过 的验证 样本 自动更新 训 练样 本集 , 对神经网络 重新进 行训 练, 以得到可以验 证通过 的神经 网 络 。 可 以以一 种或 多种程 序设计 语言或 其组 合来编 写用于 执行 本公开 的操 作的 计算机 程序代 码, 上述程序设计 语言 包括但 不限于 面向 对象 的程 序设 计语言 一诸如 Java、 Smalltalk、 C++, 还包括常规的过程式程 序设 计语 言一诸 如 “C”语言或类 似的程 序设计 语言 。程序代码 可以完 全 地在 用户 计算机 上执行 、 部分地在 用户计 算机 上执行 、 作为一个 独立 的软 件包 执行、 部分在用户 计算机 上部分 在远程 计算 机上执 行、 或者 完 全在远 程计算 机或服 务器 上执行 。 在涉及远程 计算 机的情 形中 , 远 程 计算 机可 以通过 任意 种 类的 网络 — 包 括局 域 网(LAN)或广域 网 (WAN )一连接到用 户计算 机, 或者, 可以连接到 外部计 算机 (例如利 用 因特网服 务提 供商来 通过 因特网连 接)。 附 图中的 流程 图和框 图, 图示了按 照本公 开各 种实施 例的 系统、 方 法和计 算机程 序产品 的可 能实现 的体 系架构 、 功能和操作 。 在这点 上 , 流程图或框 图中的 每个 方框可 以代表 一个模 块、 程序段 、 或代码 的一 部分 , 该模块、 程序段 、 或代码的一 部分 包含一 个或 多个用 于实 现规 定的 逻辑功 能的可 执行 指令。 也应当注意 , 在有些作为 替换 的实 现 中,方框中所 标注 的功能 也可 以以不 同于附 图中所 标注的 顺序 发生。 例如 , 两个接连 地表示 的方框 实际 上可 以基本并 行地 执行, 它们有时 也 可以按 相反的 顺序执 行, 这依所涉及的 功能 而定。 也要注意的 是, 框 图和/或流程 图中 的每个 方框、以及框 图和/或流 程图 中的方 框的组 合, 可 以用执 行规定 的功 能或操 作的专 用的基 于硬 件的 系统来实 现, 或者 可 以用专 用硬件 与计算 机指令 的组 合来实 现。 描 述于本 公开实 施例 中所涉 及到的 单元 可以通 过软件 的方 式实现, 也 可以通 过硬件 的方 式来实 现。 其中, 单元的 名称在 某种情 况下 并不 构成 对该 单元本 身的限 定。 本 文中 以上描述 的功 能可以 至少部 分地 由一个 或多个 硬件 逻辑部 件 来执行 。 例如, 非限制性 地, 可以使 用的示 范类型 的硬件 逻辑部 件 包括 : 现场可编程 门阵列 (FPGA)、 专用集成电路 (ASIC)、 专用标准 产 品(ASSP )、片上系统 (SOC)、复杂可编程 逻辑设 备 (CPLD)等等 。 在 本公开 的上下 文中 , 机器可读介 质可 以是有 形的介 质, 其可以 包含 或存 储以供 指令执 行系 统、 装置或设 备使 用或与 指令执 行系 统、 装 置或设 备结合 地使 用的程 序。 机器可读 介质 可以是 机器可 读信 号介 质 或机器 可读储 存介质 。 机器可读 介质可 以包括 但不 限于 电子的 、 磁 性 的、 光学的、 电磁的、 红外的、 或半导体系 统、 装置或设 备, 或者 上述 内容 的任何 合适组 合。 机器可 读存储 介质 的更具 体示例 会包括 基 于一 个或 多个线 的电 气连接 、 便携式计算 机盘 、 硬盘、 随机存取 存储 器 (RAM)、 只读存储器 (ROM)、 可擦除可编程只 读存 储器 (EPROM 或快 闪存 储器)、 光纤、 便捷式紧 凑盘只 读存 储器 (CD-ROM )、 光学 储存 设备 、 磁储存设备 、 或上述内 容的任 何合适 组合。 以 上描述 仅为本 公开 的较佳 实施例 以及 对所运 用技术 原理的 说明 。 本领 域技 术人 员应当理 解, 本公开中所涉 及的公 开范 围, 并不限 于上 述技 术特 征的特 定组合 而成 的技术 方案, 同时也应涵 盖在不 脱离上 述 公开 构思 的情况 下, 由上述技术特 征或其 等同特 征进 行任意 组合 而形 成 的其它 技术方 案。 例如上 述特征 与本公 开中公 开的 (但不限于 ) 具 有 类似功 能的技 术特征 进行互 相替 换而形 成的技 术方案 。 此 外, 虽然采 用特定 次序描 绘了各 操作 , 但是这不应 当理解 为要 求这 些操 作以所 示出的 特定 次序或 以顺序 次序执 行来 执行。 在一定环 境下 , 多任务和 并行处 理可 能是有 利的。 同样地, 虽然在上 面论 述中 包含 了若 干具体 实现细 节, 但是这 些不应 当被 解释为 对本公 开的 范围 的 限制。 在单独的实施 例的 上下文 中描述 的某 些特征 还可 以组合地 实 现在 单个 实施例 中。 相反地 , 在单个实施 例的 上下文 中描述 的各种 特 征也 可以 单独地 或以任 何合适 的子 组合的 方式实 现在 多个实 施例中 。 尽 管已经 采用 特定 于结构 特征 和/或方 法逻辑 动作 的语 言描述 了 本主 题, 但是应 当理解 所附权 利要 求书 中所限 定的主 题未必 局限 于上 面描 述的 特定特 征或动 作。 相反, 上面所描述 的特定 特征和 动作仅 仅 是 实现权 利要求 书的示 例形 式。

Claims

权 利 要 求 书
1、 一种神经网络 的构建 方法 , 包括: 从 预设验 证数据 集中获 取验 证样本 , 将所述验 证样本 输入 到经过 预训 练的候 选神 经网络 , 得到验证值 ; 基 于所述 验证值 确定所 述候选 神经 网络是 否满足 预设条 件; 若确 定结 果为否 , 基于所述 验证值 与验证 样本 , 生成新的训 练样 本对 , 将所述新 的训练 样本 对添加 到训练 数据 集, 得到更新 后训 练数 据集 , 训练数据 集包括 多个 训练样 本对, 训练样本对 包括训 练样 本和 训练 样本 对应的 真实值 ; 利 用所述 更新后 训练数 据集 重新对 所述候 选神 经网络 进行训 练, 以得 到满足 所述 预设条 件的神 经网 络。
2、 根据权利 要求 1所述的 方法, 其中, 在所述从 预设验 证数据 集 中获 取验 证样本 ,将所述验 证样本 输入到 经过 预训练 的候选 神经 网络, 得 到验证值 之前 , 所述方法还 包括 : 获 取训练 样本集 , 所述训练 样本集 包括 多个训 练样本 对, 所述训 练样 本对 包括训 练样本 以及所 述训 练样本 对应的 真实值 ; 将 训练样 本作为 输入 , 将真实值作 为输 出对初 始神经 网络进 行训 练 , 直至满足预 设条件 , 得到所述候 选神 经网络 。
3、 根据权利要求 1所述 的方法 , 其中, 所述预设 条件, 包括: 验 证值与 验证样 本对应 的真 实值之 间的差 异小 于等于 预设阈 值。
4、 根据权利 要求 1所述的 方法 , 其中, 所述预设条件 包括 : 神经 网络 的输 入和输 出满足 预设关 系。
5、 根据权利 要求 1所述的 方法, 其中, 所述基于 所述验 证值 与验 证样 本, 生成新训练样 本, 包括: 将 验证值 不满所 述预设 规范 的验证 样本, 作为新增 训练样 本, 将 所述 验证 样本对 应的真 实值作 为新 增训练 样本 的标签 , 生成新的训 练 样 本对。
6、 根据权利 要求 5所述的 方法, 其中, 所述基于 所述预 测值 与验 证样 本, 生成新训练样 本, 还包括 : 对 所述验 证样本 添加 预设噪 声, 将添加 了预设 噪声的 验证样 本作 为新 增训 练样本 ,将验证样 本对应 的真实 值作 为新增 训练样 本的标 签, 生成 新增训 练样 本对。
7、 根据权利 要求 1所述的 方法, 其中, 所述神经 网络 用于数据 索 引 , 以及 所 述训练 样本对 包括 用于对 待索 引数据 进行索 引的索 引值 , 以及 待 索引数 据的真 实获取 位置 ; 所 述验证 样本 包括对数 据进 行索引 的索 引值。
8、 根据权利 要求 7所述的 方法, 其中, 所述数据 索引 包括以 下之 一 : 数据库存储 数据 索引、 操作 系统任务 索引 、 网络数据 中心资 源分 配 索引。
9、 根据权利 要求 7所述的 方法, 其中, 所述神经 网络为 多层 级神 经 网络。
10、 根据权利要 求 7所述 的方法 , 其中, 所述预设 条件包 括: 所 述验证 值对应 的存 储位置 与验证 样本 对应的 真实存 储位 置之间 的 差异小 于预设 数值。
11、 根据权利要求 9所述 的方 法, 其中, 所述从预 设验证 数据 集 中获 取验 证样本 ,将所述验 证样本 输入 到经过 预训练 的候选 神经 网络, 得 到验证 值, 包括: 将 所述验 证样 本输入 到经过 预训练 的多层 级神 经网络 , 获取多层 级神 经网 络中的 中间层 级神 经网络 输出的 中间验 证值 , 以及所述神 经 网络 输出 的验证 值; 以及 所 述基于 所述验 证值确 定所 述候选 神经 网络是 否满足 预设条 件, 包括 : 基 于所述 中间验 证值 和所述 验证值 确定 多所述 候选神 经网络 是否 满足 预设 条件。
12、 一种神经网络 的构建 装置 , 包括: 输 入单元 , 用于从预 设验证 数据集 中获 取验证 样本, 将所述验证 样 本输入 到经过 预训练 的候选 神经 网络, 得到验证值 ; 确 定单元 , 用于基于所 述验 证值确 定所述 候选 神经 网络是否 满足 预设 条件 ; 训 练数据 生成单 元, 用于若确定结 果为 否, 基于所述 验证值 与验 证样 本, 生成新的训练 样本 对, 将所述新 的训 练样本 对添加 到训 练数 据 集, 得到更新 后训练 数据 集, 训练数据 集包括 多个 训练样 本对 , 训 练样 本对 包括训 练样本 和训 练样本 对应的 真实值 ; 训 练单元 , 用于利用 所述更 新后训 练数 据集重 新对所 述候 选神经 网络 进行 训练, 以得到满足所 述预设 条件 的神经 网络。
13、 一种电子设备 , 其特征在 于, 包括: 一 个或多 个处理 器; 存 储装置 , 用于存储一 个或 多个程 序, 当 所述一 个或 多个程 序被所 述一个 或多 个处理 器执行 , 使得所述 一个 或多 个处理 器实现 如权利 要求 1-11中任一所 述的 方法。
14、一种 计算机 可读介 质,其上 存储有 计算 机程序 ,其特征在 于, 该程 序被 处理器 执行时 实现如 权利 要求 1-11 中任一所述的方 法。
18
PCT/SG2022/050553 2021-08-06 2022-08-02 神经网络模型的构建方法及装置 WO2023014298A2 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110905642.6 2021-08-06
CN202110905642.6A CN113610228B (zh) 2021-08-06 2021-08-06 神经网络模型的构建方法及装置

Publications (2)

Publication Number Publication Date
WO2023014298A2 true WO2023014298A2 (zh) 2023-02-09
WO2023014298A3 WO2023014298A3 (zh) 2023-04-13

Family

ID=78339861

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/SG2022/050553 WO2023014298A2 (zh) 2021-08-06 2022-08-02 神经网络模型的构建方法及装置

Country Status (2)

Country Link
CN (1) CN113610228B (zh)
WO (1) WO2023014298A2 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116933874A (zh) * 2022-04-02 2023-10-24 维沃移动通信有限公司 验证方法、装置及设备

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11081232B2 (en) * 2018-05-23 2021-08-03 Roche Diabetes Care, Inc. Medical device data management configuration systems and methods of use
US20200202210A1 (en) * 2018-12-24 2020-06-25 Nokia Solutions And Networks Oy Systems and methods for training a neural network
CN109840588B (zh) * 2019-01-04 2023-09-08 平安科技(深圳)有限公司 神经网络模型训练方法、装置、计算机设备及存储介质
CN110245721B (zh) * 2019-06-25 2023-09-05 深圳市腾讯计算机系统有限公司 神经网络模型的训练方法、装置和电子设备
CN110909877B (zh) * 2019-11-29 2023-10-27 百度在线网络技术(北京)有限公司 神经网络模型结构搜索方法、装置、电子设备及存储介质
CN111161740A (zh) * 2019-12-31 2020-05-15 中国建设银行股份有限公司 意图识别模型训练方法、意图识别方法以及相关装置
CN111797976B (zh) * 2020-06-30 2024-04-12 北京灵汐科技有限公司 神经网络的训练方法、图像识别方法、装置、设备及介质
CN112504808A (zh) * 2020-11-02 2021-03-16 北京空天技术研究所 基于机器学习算法的飞行器热防护系统损伤诊断方法

Also Published As

Publication number Publication date
CN113610228A (zh) 2021-11-05
WO2023014298A3 (zh) 2023-04-13
CN113610228B (zh) 2024-03-05

Similar Documents

Publication Publication Date Title
CN110413812B (zh) 神经网络模型的训练方法、装置、电子设备及存储介质
WO2022103330A1 (zh) 数据保护方法、装置、介质及设备
CN113327598B (zh) 模型的训练方法、语音识别方法、装置、介质及设备
CN112883968B (zh) 图像字符识别方法、装置、介质及电子设备
CN110826567A (zh) 光学字符识别方法、装置、设备及存储介质
CN113449070A (zh) 多模态数据检索方法、装置、介质及电子设备
CN113505206B (zh) 基于自然语言推理的信息处理方法、装置和电子设备
WO2022250609A1 (zh) 数据保护方法、网络结构训练方法、装置、介质及设备
CN116310582A (zh) 分类模型训练方法、图像分类方法、装置、介质及设备
WO2023005763A1 (zh) 信息处理方法、装置和电子设备
CN115578570A (zh) 图像处理方法、装置、可读介质及电子设备
CN116166271A (zh) 代码生成方法、装置、存储介质及电子设备
WO2023014298A2 (zh) 神经网络模型的构建方法及装置
CN113392018B (zh) 流量分发方法、装置、存储介质及电子设备
CN114494709A (zh) 特征提取模型的生成方法、图像特征提取方法和装置
CN112257459B (zh) 语言翻译模型的训练方法、翻译方法、装置和电子设备
WO2023202543A1 (zh) 文字处理方法、装置、电子设备及存储介质
CN111967584A (zh) 生成对抗样本的方法、装置、电子设备及计算机存储介质
WO2023016290A1 (zh) 视频分类方法、装置、可读介质和电子设备
CN116244431A (zh) 文本分类方法、装置、介质及电子设备
CN111581455B (zh) 文本生成模型的生成方法、装置和电子设备
CN111310794B (zh) 目标对象的分类方法、装置和电子设备
CN111582456B (zh) 用于生成网络模型信息的方法、装置、设备和介质
CN111626044B (zh) 文本生成方法、装置、电子设备及计算机可读存储介质
CN111797263A (zh) 图像标签生成方法、装置、设备和计算机可读介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE