CN112508093A - Self-training method and device, electronic equipment and readable storage medium - Google Patents

Self-training method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN112508093A
CN112508093A CN202011416343.8A CN202011416343A CN112508093A CN 112508093 A CN112508093 A CN 112508093A CN 202011416343 A CN202011416343 A CN 202011416343A CN 112508093 A CN112508093 A CN 112508093A
Authority
CN
China
Prior art keywords
training
data
cache
neural network
network model
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN202011416343.8A
Other languages
Chinese (zh)
Other versions
CN112508093B (en
Inventor
刘佳祥
冯仕堃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011416343.8A priority Critical patent/CN112508093B/en
Publication of CN112508093A publication Critical patent/CN112508093A/en
Application granted granted Critical
Publication of CN112508093B publication Critical patent/CN112508093B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a self-training method, a self-training device, electronic equipment and a readable storage medium, and relates to the technical field of deep learning. The implementation scheme adopted when self-training is carried out is as follows: acquiring training data, wherein the training data comprises a plurality of training samples and labels corresponding to the training samples; training the neural network model for preset times by using the training data, taking the training samples used in each training process and the corresponding output results thereof as cache data, and recording the cache data into a cache; after the training times exceed the preset times, training the neural network model by using training data and cache data in a cache, and recording training samples used in each training process and corresponding output results thereof as cache data into the cache; completing the self-training of the neural network model upon determining that the training of the neural network model reaches a termination condition. The self-training time cost can be reduced, and the self-training efficiency is improved.

Description

Self-training method and device, electronic equipment and readable storage medium
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a self-training method, a self-training device, electronic equipment and a readable storage medium in the technical field of deep learning.
Background
The Self-Training (Self-Training) method is a method for iteratively Training a model by using the learning result of a neural network model.
Conventional self-training methods typically have the following flow: training a neural network model using supervised data D; performing data amplification on the data D to obtain data D'; predicting the data D 'by using a neural network model to obtain an output result of each data in the data D'; merging the data D and the data D', and continuing to train the neural network model; the above steps are repeated until a termination condition is reached.
For the traditional self-training method, each training of the neural network model requires the steps of data augmentation and prediction of augmented data by using the neural network model, so that the time cost required by the neural network model during self-training is high, and the steps are complex.
Disclosure of Invention
The technical scheme adopted by the application for solving the technical problem is to provide a self-training method, which comprises the following steps: acquiring training data, wherein the training data comprises a plurality of training samples and labels corresponding to the training samples; training the neural network model for preset times by using the training data, taking the training samples used in each training process and the corresponding output results thereof as cache data, and recording the cache data into a cache; after the training times exceed the preset times, training the neural network model by using training data and cache data in a cache, and recording training samples used in each training process and corresponding output results thereof as cache data into the cache; completing the self-training of the neural network model upon determining that the training of the neural network model reaches a termination condition.
The technical scheme that this application adopted for solving technical problem provides a self-training device, includes: the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring training data which comprises a plurality of training samples and labels corresponding to the training samples; the first training unit is used for training the neural network model for preset times by using training data, taking training samples used in each training process and corresponding output results thereof as cache data and recording the cache data into a cache; the second training unit is used for training the neural network model by using training data and cache data in the cache after the training times exceed the preset times, and recording training samples used in each training process and corresponding output results of the training samples as cache data into the cache; and the determining unit is used for finishing the self-training of the neural network model under the condition that the training of the neural network model is determined to reach the termination condition.
An electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above method.
A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the above method.
One embodiment in the above application has the following advantages or benefits: the self-training time cost can be reduced, and the self-training efficiency is improved. Because the technical means that the training samples used by the neural network model in each training process and the corresponding output results of the training samples are taken as the cache data to be recorded by creating the cache is adopted, the technical problems that in the prior art, the time cost is high and the steps are complicated due to the fact that data needs to be augmented and augmented data needs to be predicted in each training process are solved, the time cost needed when the neural network model is trained automatically is reduced, and the technical effect of the efficiency of the self-training of the neural network model is improved.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present application;
FIG. 2 is a schematic diagram according to a second embodiment of the present application;
FIG. 3 is a schematic illustration according to a third embodiment of the present application;
fig. 4 is a block diagram of an electronic device for implementing the self-training method of the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram according to a first embodiment of the present application. As shown in fig. 1, the self-training method of this embodiment may specifically include the following steps:
s101, obtaining training data, wherein the training data comprises a plurality of training samples and labels corresponding to the training samples;
s102, training the neural network model for preset times by using training data, taking training samples used in each training process and corresponding output results thereof as cache data, and recording the cache data into a cache;
s103, after the training times exceed the preset times, training the neural network model by using the training data and the cache data in the cache, and recording the training samples used in each training process and the corresponding output results as cache data into the cache;
s104, completing the self-training of the neural network model under the condition that the training of the neural network model is determined to reach the termination condition.
In the method for self-training the neural network model provided by this embodiment, the training samples used by the neural network model in each training process and the output results corresponding to the training samples are recorded as the cache data in a manner of creating the cache, so that after the training times of the neural network model exceed the preset times, the training data and the cache data recorded in the cache are used to train the neural network model, the time cost required for self-training the neural network model is reduced, and the efficiency of self-training the neural network model is improved.
In this embodiment, the training data obtained by executing S101 is the supervision data, and the type of the training sample included in the supervision data may be a text or an image. In this embodiment, the training samples obtained by executing S101 may be texts, and the label corresponding to each text may be a label representing a positive emotion or a label representing a negative emotion; the plurality of training samples acquired by performing S101 in this embodiment may also be images, and the label corresponding to each image may be a label representing a category of an animal in the image.
In this embodiment, after the training data is acquired in S101, S102 is executed to perform training on the neural network model for a preset number of times by using the acquired training data, and record the training samples used in each training process and the corresponding output results thereof as cache data in the cache. The neural network model trained in this embodiment may be a deep learning model, and the specific type of the neural network model is not limited.
Specifically, when performing S102 training the neural network model for a preset number of times by using the training data, the present embodiment may adopt an optional implementation manner as follows: respectively inputting a plurality of training samples in the training data into a neural network model to obtain an output result of the neural network model aiming at each training sample; calculating a loss function according to the label and the output result corresponding to each training sample; and after the neural network model is updated according to the loss function, respectively inputting a plurality of training samples in the training data into the updated neural network model, and completing the training for preset times in a circulating manner.
It is understood that the preset number of times in this embodiment may be preset by the user, for example, the preset number of times is 4, which means that the neural network model is trained 4 times using the training data.
In addition, the present embodiment does not limit the calculation method of the loss function, and for example, a calculation method of a cross entropy loss function may be used; in this embodiment, when the neural network model is updated according to the loss function, the parameters, such as the number of neuron nodes of each neural layer, the weight of each neural layer, and the parameters of each neural layer activation function, in the neural network model are updated.
Since the neural network model is trained multiple times by using the training data in the step S102, multiple output results are generated for the same training sample in the training data. When one training sample in the cached data corresponds to a plurality of output results, the data redundancy and the resource occupancy rate of the cache are increased, and the inconvenience in training the neural network model by using the cached data is increased.
In order to avoid redundancy of the cache data in the cache and reduce the resource occupancy rate of the cache, in this embodiment, when S102 is executed to record the training samples used in each training process and the corresponding output results as the cache data in the cache, an optional implementation manner that may be adopted is: and aiming at the same training sample in the cache data, replacing the output result obtained in the previous training process with the output result obtained in the current training process.
That is to say, this embodiment can ensure that one training sample in the cache data corresponds to one output result, and the output result corresponding to the training sample is obtained for the training sample by the neural network model after being updated newly, so that the confidence of the output result corresponding to the training sample in the cache data is improved, and the steps when the neural network model is trained by using the cache data are simplified.
In this embodiment, after performing S102 training for the neural network model for the preset number of times by using the training data, and performing S103 training for the neural network model by using the training data and the cache data in the cache after the training number of times exceeds the preset number of times, and recording the training samples used in each training process and the corresponding output results as cache data in the cache.
That is, in the present embodiment, when the neural network model is self-trained, different training methods are used according to the number of times of training of the neural network model. Specifically, in this embodiment, when the training times of the neural network model are within the preset times, only the training data is used to train the neural network model; after the training times of the neural network model exceed the preset times, the embodiment trains the neural network model by using the cache data and the training data. For example, if the predetermined number of times is 4, the neural network model is trained using the buffered data and the training data from the 5 th training.
Specifically, in this embodiment, when performing S103 to train the neural network model by using the training data and the cache data in the cache, an optional implementation manner that can be adopted is as follows: randomly selecting training samples from the cache data in the cache, for example, randomly selecting a preset number of training samples from the cache data; and training the neural network model by using the training data, the selected training sample and the corresponding output result.
That is to say, when the neural network model is trained by using the cache data and the training data, the embodiment may train by using only a part of the cache data selected from the cache, thereby avoiding repetition of the cache data and the training data, and improving the training accuracy of the neural network model.
In addition, in this embodiment, all training samples in the cache data may also be selected, and the training samples and the training data may be used together to train the neural network model.
In this embodiment, when performing S103 to train the neural network model by using the training data, the selected training sample, and the corresponding output result, an optional implementation manner that can be adopted is as follows: taking an output result corresponding to the selected training sample as a label corresponding to the training sample; respectively inputting a plurality of training samples into a neural network model to obtain an output result of the neural network model aiming at each training sample; calculating a loss function according to the label and the output result corresponding to each training sample; and after the neural network model is updated according to the loss function, respectively inputting a plurality of training samples into the updated neural network model, and circularly performing the operation until the training of the neural network model reaches a termination condition.
Similarly, in order to avoid redundancy of the cache data in the cache and reduce the resource occupancy rate of the cache, in this embodiment, when S103 is executed to record the training samples used in each training process and the corresponding output results as the cache data in the cache, an optional implementation manner that may be adopted is: and aiming at the same training sample in the cache data, replacing the output result obtained in the previous training process with the output result obtained in the current training process.
It can be understood that, since the embodiment performs S103 by using the buffered data to train the neural network model, there is a case where the training is performed by using the same training sample in the training data and the buffered data, so that two output results corresponding to the same training sample are obtained in one training process of the neural network model.
In order to avoid the problem that the output result corresponding to the same training sample in the cached data is relatively redundant, in this embodiment, when the output result obtained in the training process of this time is used to replace the output result obtained in the training process of the previous time for the same training sample in the cached data in step S103, the optional implementation manner that may be adopted is: selecting one of two output results corresponding to the same training sample in the training process; and replacing the output result obtained in the previous training process with the selected output result.
It can be understood that, in this embodiment, one of the two output results may be randomly selected, or the output result with the larger value of the two output results may be selected.
After the step S103 of training the neural network model by using the training data and the cached data in the cache is executed, the step S104 of completing the self-training of the neural network model when it is determined that the training of the neural network model satisfies the termination condition is executed.
In this embodiment, when S104 is executed to determine whether the training of the neural network model meets the termination condition, it may be determined whether the training frequency of the neural network model reaches the termination frequency, or it may also be determined whether the accuracy of the neural network model reaches a preset accuracy, and after it is determined that the training of the neural network model meets the termination condition, the training is stopped, and the self-training of the neural network model is completed.
According to different acquired training data, the embodiment executes different processing tasks, such as a text classification task, a text semantic identification task, an image classification task and the like, through the neural network model after the self-training is completed.
By adopting the method provided by the embodiment, the output result of the neural network model aiming at the training sample is recorded in the cache, so that the self-training of the neural network model is completed by using different training modes at different training stages of the neural network model, the complex steps that training data needs to be amplified and the amplified data needs to be predicted by using the neural network model when the self-training is performed in the prior art are avoided, the time cost of the neural network model during the self-training is reduced, the self-training step of the neural network model is simplified, and the self-training efficiency of the neural network model is improved.
Fig. 2 is a schematic diagram according to a second embodiment of the present application. Fig. 2 is a flowchart of self-training a neural network model according to an embodiment of the present application, as shown in fig. 2: the preset times in this embodiment are 4 times; m0Representing an untrained initial neural network model, … …, M4Representing a 4-trained neural network model, M5Representing a neural network model trained 5 times; when the first 4 times of training are carried out, training data are only used for training a neural network model, and training samples used in each training process and corresponding output results are recorded into a cache (cache); from the 5 th training, in addition to using the training data, training samples and corresponding output results thereof are randomly selected from the buffer to be trained together, and meanwhile, the training samples and the corresponding output results thereof used in each training process are recorded in the buffer until the training of the neural network model reaches the termination condition.
Fig. 3 is a schematic diagram according to a third embodiment of the present application. As shown in fig. 3, the self-training apparatus of the present embodiment includes:
the acquiring unit 301 is configured to acquire training data, where the training data includes a plurality of training samples and labels corresponding to the training samples;
the first training unit 302 is configured to perform training on the neural network model for a preset number of times by using training data, and record a training sample used in each training process and an output result corresponding to the training sample as cache data in a cache;
the second training unit 303 is configured to train the neural network model by using the training data and the cache data in the cache after the training times exceed a preset time, and record the training samples used in each training process and the corresponding output results thereof as cache data in the cache;
the determining unit 304 is configured to complete the self-training of the neural network model when it is determined that the training of the neural network model reaches the termination condition.
In this embodiment, the training data acquired by the acquiring unit 301 is monitoring data, and the type of the training sample included in the monitoring data may be a text or an image. The training samples acquired by the acquiring unit 301 may be texts, and the label corresponding to each text may be a label representing a positive emotion or a label representing a negative emotion; the plurality of training samples acquired by the acquisition unit 301 may also be images, and the label corresponding to each image may be a label representing a category of an animal in the image.
In this embodiment, after the obtaining unit 301 obtains the training data, the first training unit 302 performs training for the neural network model for a preset number of times by using the obtained training data, and records the training samples used in each training process and the corresponding output results thereof as cache data in the cache. The neural network model trained in this embodiment may be a deep learning model, and the specific type of the neural network model is not limited.
Specifically, when the first training unit 302 in this embodiment uses the training data to train the neural network model for a preset number of times, the optional implementation manner that can be adopted is as follows: respectively inputting a plurality of training samples in the training data into a neural network model to obtain an output result of the neural network model aiming at each training sample; calculating a loss function according to the label and the output result corresponding to each training sample; and after the neural network model is updated according to the loss function, respectively inputting a plurality of training samples in the training data into the updated neural network model, and completing the training for preset times in a circulating manner.
Since the first training unit 302 in this embodiment uses the training data to train the neural network model multiple times, multiple output results are generated for the same training sample in the training data. When one training sample in the cached data corresponds to a plurality of output results, the data redundancy and the resource occupancy rate of the cache are increased, and the inconvenience in training the neural network model by using the cached data is increased.
In order to avoid redundancy of the cache data in the cache and reduce the resource occupancy rate of the cache, when the first training unit 302 in this embodiment takes the training samples used in each training process and the corresponding output results thereof as cache data and records the cache data in the cache, an optional implementation manner that may be adopted is: and aiming at the same training sample in the cache data, replacing the output result obtained in the previous training process with the output result obtained in the current training process.
In this embodiment, after the first training unit 302 performs training on the neural network model for the preset number of times by using the training data, the second training unit 303 performs training on the neural network model by using the training data and the cache data in the cache after the training number exceeds the preset number of times, and records the training samples used in each training process and the corresponding output results thereof as cache data in the cache.
Specifically, in this embodiment, when the second training unit 303 trains the neural network model by using the training data and the cache data in the cache, an optional implementation manner that can be adopted is as follows: randomly selecting training samples from the cache data in the cache, for example, randomly selecting a preset number of training samples from the cache data; and training the neural network model by using the training data, the selected training sample and the corresponding output result.
In addition, the second training unit 303 may also select all training samples in the buffered data, and train the neural network model together with the training data.
In this embodiment, when the second training unit 303 trains the neural network model by using the training data, the selected training samples, and the corresponding output results thereof, an optional implementation manner that may be adopted is as follows: taking an output result corresponding to the selected training sample as a label corresponding to the training sample; respectively inputting a plurality of training samples into a neural network model to obtain an output result of the neural network model aiming at each training sample; calculating a loss function according to the label and the output result corresponding to each training sample; and after the neural network model is updated according to the loss function, respectively inputting a plurality of training samples into the updated neural network model, and circularly performing the operation until the training of the neural network model reaches a termination condition.
Similarly, in order to avoid redundancy of the buffer data in the buffer and reduce the resource occupancy of the buffer, when the second training unit 303 in this embodiment records the training samples used in each training process and the corresponding output results thereof as the buffer data in the buffer, an optional implementation manner that may be adopted is: and aiming at the same training sample in the cache data, replacing the output result obtained in the previous training process with the output result obtained in the current training process.
It can be understood that, since the second training unit 303 may train the neural network model using the buffered data, there may be a case where the training is performed using the same training sample in the training data and the buffered data, so that one training process of the neural network model may obtain two output results corresponding to the same training sample.
In order to avoid the problem that the output result corresponding to the same training sample in the cached data is relatively redundant, in the embodiment, when the output result obtained in the training process of this time is used to replace the output result obtained in the training process of the previous time for the same training sample in the cached data, the optional implementation manner that may be adopted is as follows: selecting one of two output results corresponding to the same training sample in the training process; and replacing the output result obtained in the previous training process with the selected output result.
In this embodiment, after the second training unit 303 trains the neural network model using the training data and the cached data in the cache, the determination unit 304 performs self-training of the neural network model when it is determined that the training of the neural network model satisfies the termination condition.
In this embodiment, when determining whether the training of the neural network model meets the termination condition, the determining unit 304 may determine whether the training frequency of the neural network model reaches the termination frequency, or may determine whether the accuracy of the neural network model reaches a preset accuracy, and after determining that the training of the neural network model meets the termination condition, stop the training, and complete the self-training of the neural network model.
According to an embodiment of the present application, an electronic device and a computer-readable storage medium are also provided.
Fig. 4 is a block diagram of an electronic device according to the self-training method of the embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 4, the electronic apparatus includes: one or more processors 401, memory 402, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 4, one processor 401 is taken as an example.
Memory 402 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the self-training method provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the self-training method provided herein.
The memory 402, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the method of searching for emoticons in the embodiment of the present application (for example, the acquiring unit 301, the first training unit 302, the second training unit 303, and the determining unit 304 shown in fig. 3). The processor 401 executes various functional applications of the server and data processing by running non-transitory software programs, instructions, and modules stored in the memory 402, that is, implements the self-training method in the above-described method embodiments.
The memory 402 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the electronic device, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 402 may optionally include memory located remotely from the processor 401, which may be connected to the electronic device of the self-training method via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the self-training method may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected by a bus or other means, and fig. 4 illustrates an example of a connection by a bus.
The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus of the self-training method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 404 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS").
According to the technical scheme of the embodiment of the application, the training samples used by the neural network model in each training process and the corresponding output results of the training samples are recorded as the cache data in a cache creating mode, so that after the training times of the neural network model exceed the preset times, the training data and the cache data recorded in the cache are used for training the neural network model, the time cost required in self-training of the neural network model is reduced, and the efficiency of self-training of the neural network model is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present application can be achieved, and the present invention is not limited herein.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method of self-training, comprising:
acquiring training data, wherein the training data comprises a plurality of training samples and labels corresponding to the training samples;
training the neural network model for preset times by using the training data, taking the training samples used in each training process and the corresponding output results thereof as cache data, and recording the cache data into a cache;
after the training times exceed the preset times, training the neural network model by using training data and cache data in a cache, and recording training samples used in each training process and corresponding output results thereof as cache data into the cache;
completing the self-training of the neural network model upon determining that the training of the neural network model reaches a termination condition.
2. The method according to claim 1, wherein the recording of the training samples used in each training process and their corresponding output results as buffer data into a buffer comprises:
and aiming at the same training sample in the cache data, replacing the output result obtained in the previous training process with the output result obtained in the current training process.
3. The method of claim 1, wherein the training the neural network model using training data and cached data in a cache comprises:
randomly selecting training samples from the buffered data;
and training the neural network model by using the training data, the selected training sample and the corresponding output result.
4. The method according to claim 2, wherein the replacing the output result obtained in the previous training process with the output result obtained in the current training process for the same training sample in the cached data comprises:
selecting one of two output results corresponding to the same training sample in the training process;
and replacing the output result obtained in the previous training process with the selected output result.
5. A self-training apparatus comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring training data which comprises a plurality of training samples and labels corresponding to the training samples;
the first training unit is used for training the neural network model for preset times by using training data, taking training samples used in each training process and corresponding output results thereof as cache data and recording the cache data into a cache;
the second training unit is used for training the neural network model by using training data and cache data in the cache after the training times exceed the preset times, and recording training samples used in each training process and corresponding output results of the training samples as cache data into the cache;
and the determining unit is used for finishing the self-training of the neural network model under the condition that the training of the neural network model is determined to reach the termination condition.
6. The apparatus according to claim 5, wherein the first training unit and the second training unit, when recording training samples used in each training process and output results corresponding to the training samples as cache data into a cache, specifically perform:
and aiming at the same training sample in the cache data, replacing the output result obtained in the previous training process with the output result obtained in the current training process.
7. The apparatus according to claim 5, wherein the second training unit, when training the neural network model using the training data and the cached data in the cache, specifically performs:
randomly selecting training samples from the buffered data;
and training the neural network model by using the training data, the selected training sample and the corresponding output result.
8. The apparatus according to claim 6, wherein the second training unit specifically executes, when replacing the output result obtained in the previous training process with the output result obtained in the current training process for the same training sample in the cache data:
selecting one of two output results corresponding to the same training sample in the training process;
and replacing the output result obtained in the previous training process with the selected output result.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
10. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-4.
CN202011416343.8A 2020-12-03 2020-12-03 Self-training method and device, electronic equipment and readable storage medium Active CN112508093B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011416343.8A CN112508093B (en) 2020-12-03 2020-12-03 Self-training method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011416343.8A CN112508093B (en) 2020-12-03 2020-12-03 Self-training method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112508093A true CN112508093A (en) 2021-03-16
CN112508093B CN112508093B (en) 2022-01-28

Family

ID=74970701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011416343.8A Active CN112508093B (en) 2020-12-03 2020-12-03 Self-training method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN112508093B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101814149A (en) * 2010-05-10 2010-08-25 华中科技大学 Self-adaptive cascade classifier training method based on online learning
CN103794214A (en) * 2014-03-07 2014-05-14 联想(北京)有限公司 Information processing method, device and electronic equipment
US20180293515A1 (en) * 2017-04-10 2018-10-11 Capital Com SV Investments Limited Self-adaptive, self-trained computer engines based on machine learning and methods of use thereof
CN109002784A (en) * 2018-06-29 2018-12-14 国信优易数据有限公司 The training method and system of streetscape identification model, streetscape recognition methods and system
CN110197279A (en) * 2019-06-10 2019-09-03 北京百度网讯科技有限公司 Transformation model training method, device, equipment and storage medium
CN110516561A (en) * 2019-08-05 2019-11-29 西安电子科技大学 SAR image target recognition method based on DCGAN and CNN
CN110533221A (en) * 2019-07-29 2019-12-03 西安电子科技大学 Multipurpose Optimal Method based on production confrontation network
CN111401555A (en) * 2020-03-17 2020-07-10 深圳市凌雀智能科技有限公司 Model training method, device, server and storage medium
CN111489366A (en) * 2020-04-15 2020-08-04 上海商汤临港智能科技有限公司 Neural network training and image semantic segmentation method and device
CN111507104A (en) * 2020-03-19 2020-08-07 北京百度网讯科技有限公司 Method and device for establishing label labeling model, electronic equipment and readable storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101814149A (en) * 2010-05-10 2010-08-25 华中科技大学 Self-adaptive cascade classifier training method based on online learning
CN103794214A (en) * 2014-03-07 2014-05-14 联想(北京)有限公司 Information processing method, device and electronic equipment
US20180293515A1 (en) * 2017-04-10 2018-10-11 Capital Com SV Investments Limited Self-adaptive, self-trained computer engines based on machine learning and methods of use thereof
CN109002784A (en) * 2018-06-29 2018-12-14 国信优易数据有限公司 The training method and system of streetscape identification model, streetscape recognition methods and system
CN110197279A (en) * 2019-06-10 2019-09-03 北京百度网讯科技有限公司 Transformation model training method, device, equipment and storage medium
CN110533221A (en) * 2019-07-29 2019-12-03 西安电子科技大学 Multipurpose Optimal Method based on production confrontation network
CN110516561A (en) * 2019-08-05 2019-11-29 西安电子科技大学 SAR image target recognition method based on DCGAN and CNN
CN111401555A (en) * 2020-03-17 2020-07-10 深圳市凌雀智能科技有限公司 Model training method, device, server and storage medium
CN111507104A (en) * 2020-03-19 2020-08-07 北京百度网讯科技有限公司 Method and device for establishing label labeling model, electronic equipment and readable storage medium
CN111489366A (en) * 2020-04-15 2020-08-04 上海商汤临港智能科技有限公司 Neural network training and image semantic segmentation method and device

Also Published As

Publication number Publication date
CN112508093B (en) 2022-01-28

Similar Documents

Publication Publication Date Title
CN111428008B (en) Method, apparatus, device and storage medium for training a model
CN112560912B (en) Classification model training method and device, electronic equipment and storage medium
CN112036509A (en) Method and apparatus for training image recognition models
CN111507104B (en) Method and device for establishing label labeling model, electronic equipment and readable storage medium
CN111639710A (en) Image recognition model training method, device, equipment and storage medium
CN110795569B (en) Method, device and equipment for generating vector representation of knowledge graph
CN110852379B (en) Training sample generation method and device for target object recognition
CN111667056A (en) Method and apparatus for searching model structure
CN111079945B (en) End-to-end model training method and device
CN111680517A (en) Method, apparatus, device and storage medium for training a model
CN110717340A (en) Recommendation method and device, electronic equipment and storage medium
CN112560499B (en) Pre-training method and device for semantic representation model, electronic equipment and storage medium
CN111241810A (en) Punctuation prediction method and device
CN111967591A (en) Neural network automatic pruning method and device and electronic equipment
CN113449148B (en) Video classification method, device, electronic equipment and storage medium
CN112580723B (en) Multi-model fusion method, device, electronic equipment and storage medium
CN110909136A (en) Satisfaction degree estimation model training method and device, electronic equipment and storage medium
CN112232089B (en) Pre-training method, device and storage medium of semantic representation model
CN112382291B (en) Voice interaction processing method and device, electronic equipment and storage medium
CN112561059B (en) Method and apparatus for model distillation
CN112329453B (en) Method, device, equipment and storage medium for generating sample chapter
CN112529181A (en) Method and apparatus for model distillation
CN111832291A (en) Entity recognition model generation method and device, electronic equipment and storage medium
CN112508093B (en) Self-training method and device, electronic equipment and readable storage medium
CN111510376B (en) Image processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant