Information processing method, device, storage medium and electronic device
By gradually removing the normalized structure in the deep learning model based on the target probability or training steps, the problem of model prediction delay and training stability is solved, and the accuracy of model output is improved.
Patent Information
- Application Number
- CN202110277986.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-15
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2041-03-15
AI Technical Summary
During the training of deep learning models, the existence of normalized structures increases the delay in model predictions, and removing normalized structures may affect the stability of model training, resulting in poor model quality and inaccurate output information.
By gradually removing the normalized structure in the preset model based on the target probability or training steps, obtaining the processing model, ensuring the stability of model training and the accuracy of output information.
It realizes that the specified number of normalized structures is removed without interfering with the normal training of the model, improving the quality of the processing model and the accuracy of the target information.
Smart Images

Figure CN112861997B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of deep learning technology, and in particular to an information processing method, device, storage medium and electronic device. Background Art
[0002] With the development of deep learning technology, deep learning models are widely used in many technical fields such as natural language processing, image processing, and data mining. In deep learning models, the output of the modules included in the model can be normalized by setting the corresponding normalization structure to improve the effect of model training. However, in the model prediction stage, the normalization structure will increase the delay of model prediction. In order to reduce the delay of model prediction, it is necessary to remove the normalization structure in the deep learning model during the training process.
[0003] In the related art, when the normalization structure in the deep learning model is removed during the training process, it will affect the stability of the model training and even cause the model to be unable to be trained normally, resulting in poor quality of the trained model and reducing the accuracy of the information output by the model. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides an information processing method, device, storage medium and electronic device.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for processing information is provided, the method comprising:
[0006] Acquire information to be processed, wherein the information to be processed includes at least one of text information and image information;
[0007] Using the information to be processed as an input of a processing model trained by a preset model to obtain target information corresponding to the information to be processed output by the processing model, wherein the target information can reflect specified features included in the information to be processed;
[0008] Among them, the preset model includes multiple operation modules and a normalization structure corresponding to each operation module, and the normalization structure corresponding to each operation module is used to normalize the output of the operation module; the processing model is obtained by removing the normalization structures corresponding to a specified number of the operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model.
[0009] Optionally, the processing model is trained in the following manner:
[0010] Acquire a training sample set; the training sample set includes multiple groups of training data, each group of the training data includes: input end training data and corresponding output end training data, the input end training data includes first training information, and the output end training data includes second training information corresponding to the first training information;
[0011] According to the target probability or the number of steps for training the preset model, the preset model is trained using the training sample set to obtain the processing model.
[0012] Optionally, the training the preset model using the training sample set according to the target probability or the number of steps for training the preset model to obtain the processing model includes:
[0013] Selecting a first number of the normalized structures from all the normalized structures included in the preset model according to the target probability to remove;
[0014] According to the training sample set, training the preset model after removing the first number of normalized structures;
[0015] Updating the target probability, wherein the updated target probability is greater than the target probability before the update;
[0016] Repeat the step of selecting a first number of the normalized structures to be removed from all the normalized structures included in the preset model according to the target probability, and then updating the target probability until a specified number of the normalized structures are removed to obtain the processing model.
[0017] Optionally, updating the target probability includes:
[0018] Update the target probability according to a preset proportionality factor; or,
[0019] The target probability is updated according to a preset function.
[0020] Optionally, the training the preset model using the training sample set according to the target probability or the number of steps for training the preset model to obtain the processing model includes:
[0021] According to the training sample set and the number of steps for training the preset model, the preset model is trained through preset training steps until a specified number of the normalized structures are removed to obtain the processing model.
[0022] Optionally, the preset training step includes:
[0023] When the number of steps for training the preset model according to the training sample set is N, determining the target variance according to N, where N is a natural number;
[0024] Determining whether to remove the normalized structure corresponding to each of the operation modules according to the variance of the output of the current operation modules and the target variance;
[0025] If the variance of the output of the operation module is less than or equal to the target variance, the normalization structure corresponding to the operation module is removed;
[0026] If the variance of the output of the operation module is greater than the target variance, the normalized structure corresponding to the operation module is retained.
[0027] Optionally, the preset model includes an encoder and a decoder, the encoder is composed of a second number of the operation modules, and the decoder is composed of a third number of the operation modules; the operation modules are attention networks or feedforward neural networks.
[0028] According to a second aspect of an embodiment of the present disclosure, there is provided an information processing device, the device comprising:
[0029] An acquisition module, configured to acquire information to be processed, wherein the information to be processed includes at least one of text information and image information;
[0030] A processing module is configured to use the information to be processed as an input of a processing model trained by a preset model to obtain target information corresponding to the information to be processed output by the processing model, wherein the target information can reflect a specified feature included in the information to be processed;
[0031] Among them, the preset model includes multiple operation modules and a normalization structure corresponding to each operation module, and the normalization structure corresponding to each operation module is used to normalize the output of the operation module; the processing model is obtained by removing the normalization structures corresponding to a specified number of the operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model.
[0032] Optionally, the processing module is configured to train the processing model in the following manner:
[0033] Acquire a training sample set; the training sample set includes multiple groups of training data, each group of the training data includes: input end training data and corresponding output end training data, the input end training data includes first training information, and the output end training data includes second training information corresponding to the first training information;
[0034] According to the target probability or the number of steps for training the preset model, the preset model is trained using the training sample set to obtain the processing model.
[0035] Optionally, the processing module is configured to:
[0036] Selecting a first number of the normalized structures from all the normalized structures included in the preset model according to the target probability to remove;
[0037] According to the training sample set, training the preset model after removing the first number of normalized structures;
[0038] Updating the target probability, wherein the updated target probability is greater than the target probability before the update;
[0039] Repeat the step of selecting a first number of the normalized structures to be removed from all the normalized structures included in the preset model according to the target probability, and then updating the target probability until a specified number of the normalized structures are removed to obtain the processing model.
[0040] Optionally, the processing module is configured to:
[0041] Update the target probability according to a preset proportionality factor; or,
[0042] The target probability is updated according to a preset function.
[0043] Optionally, the processing module is configured to:
[0044] According to the training sample set and the number of steps for training the preset model, the preset model is trained through preset training steps until a specified number of the normalized structures are removed to obtain the processing model.
[0045] Optionally, the preset training step includes:
[0046] When the number of steps for training the preset model according to the training sample set is N, determining the target variance according to N, where N is a natural number;
[0047] Determining whether to remove the normalized structure corresponding to each of the operation modules according to the variance of the output of the current operation modules and the target variance;
[0048] If the variance of the output of the operation module is less than or equal to the target variance, the normalization structure corresponding to the operation module is removed;
[0049] If the variance of the output of the operation module is greater than the target variance, the normalized structure corresponding to the operation module is retained.
[0050] Optionally, the preset model includes an encoder and a decoder, the encoder is composed of a second number of the operation modules, and the decoder is composed of a third number of the operation modules; the operation modules are attention networks or feedforward neural networks.
[0051] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0052] processor;
[0053] a memory for storing processor-executable instructions;
[0054] The processor is configured to execute the steps of the information processing method provided in the first aspect of the present disclosure.
[0055] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the information processing method provided by the first aspect of the present disclosure are implemented.
[0056] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: the present disclosure first obtains information to be processed and uses the information to be processed as the input of the processing model obtained by training the preset model to obtain the target information corresponding to the information to be processed output by the processing model, wherein the information to be processed includes at least one of text information and image information, the target information can reflect the specified features included in the information to be processed, the preset model includes multiple operation modules and a normalization structure corresponding to each operation module, the normalization structure corresponding to each operation module is used to normalize the output of the operation module, and the processing model is obtained by removing the normalization structures corresponding to the specified number of operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model. The present disclosure gradually removes the specified number of normalization structures in the preset model by the target probability or the number of steps for training the preset model to obtain the processing model, which will not interfere with the normal training of the preset model, has high stability for the training of the preset model, and can ensure the quality of the processing model at the same time, thereby improving the accuracy of the target information.
[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0059] Figure 1The present invention is a flowchart of a method for processing information according to an exemplary embodiment.
[0060] Figure 2 The figure is a flowchart of a training processing model according to an exemplary embodiment.
[0061] Figure 3 is based on Figure 2 The illustrated embodiment shows a flow chart of step 202 .
[0062] Figure 4 The invention is a block diagram of an information processing device according to an exemplary embodiment.
[0063] Figure 5 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0064] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0065] Before introducing the information processing method, device, storage medium and electronic device provided by the present disclosure, the application scenarios involved in each embodiment of the present disclosure are first introduced. The application scenario can be a scenario in which a preset model with a normalized structure is trained to obtain a processing model. After the information to be processed is input into the processing model, the processing model can output the target information corresponding to the information to be processed according to the inherent laws and representation levels of the learned training data. In the model prediction stage, the normalized structure will increase the delay of the model prediction. In order to reduce the delay of the model prediction, it is necessary to remove the normalized structure in the preset model during the training process.
[0066] In the related art, when the preset model is trained, the normalized structure in the preset model can be removed by adjusting the initialization, scaling and biasing operations. The normalized structure in the preset model can also be removed by adding a learnable parameter before the residual connection included in the preset model or in each item of the residual connection. However, the above methods are all based on proof deduction, but the proof deduction is actually incomplete, and there is a problem that it cannot be reproduced in practice and the training of the preset model is unstable. In addition, even if the training of the preset model can be completed, the quality of the processing model obtained after removing the normalized structure in the preset model is poor, which will affect the accuracy of the target information output by the processing model.
[0067] In order to solve the problems existing in the related technology, the present invention gradually removes a specified number of normalized structures in the preset model through target probability or training steps to obtain a processing model. This will not interfere with the normal training of the preset model and has high stability in the training of the preset model. At the same time, it can ensure the quality of the processing model and improve the accuracy of the target information.
[0068] Figure 1 FIG. 1 is a flowchart of a method for processing information according to an exemplary embodiment. Figure 1 As shown, the method may include the following steps:
[0069] In step 101, information to be processed is obtained, where the information to be processed includes at least one of text information and image information.
[0070] In step 102, the information to be processed is used as the input of the processing model trained by the preset model to obtain the target information corresponding to the information to be processed output by the processing model, and the target information can reflect the specified features included in the information to be processed.
[0071] Among them, the preset model includes multiple operation modules and a normalized structure corresponding to each operation module. The normalized structure corresponding to each operation module is used to normalize the output of the operation module. The processing model is obtained by removing the normalized structures corresponding to a specified number of operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model.
[0072] For example, in the technical fields of natural language processing, image processing, etc., it is usually necessary to set a preset model including multiple operation modules according to the actual application, and each operation module corresponds to a normalized structure, and train the preset model to obtain the required processing model. Among them, each normalized structure is used to normalize the output of the corresponding operation module so that the distribution of the output of the operation module becomes a standard Gaussian distribution, so that the training of the preset model can be stable, a higher learning rate can be achieved, the model convergence can be accelerated, and the generalization ability can be improved. The normalization process can be, for example, an LN (English: Layer Normalization) operation, a BN (English: Batch Normalization) operation, and a WN (English: Weight Normalization) operation, etc., and the present disclosure does not make specific restrictions on this. For example, in the scenes of machine translation, dialogue, AI (English: Artificial Intelligence, Chinese: Artificial Intelligence) creation, knowledge graph construction, etc. in the field of natural language processing, the preset model can be a deep learning model using a Transformer structure (it can also be a BERT model). At this time, the normalization process can use an LN operation, and then the normalization structure is an LN structure. For another example, in the field of image processing, normalization processing can use BN operation, so the normalization structure is the BN structure.
[0073] In order to ensure the quality of the processing model while removing a specified number of normalized structures in the preset model, the preset model can be trained based on the idea of gradually removing the normalized structures in the preset model from simple to difficult, so that the preset model can gradually adapt to the process without normalized structures. For example, the preset model can be trained to convergence while retaining all normalized structures, and then some normalized structures in all normalized structures can be removed according to the target probability (the target probability can be 0.2, for example), and the preset model can be trained to convergence, and then the target probability can be increased, and the above steps can be repeated until the specified number of normalized structures are removed according to the target probability, and the preset model after removing the specified number of normalized structures is trained to convergence to obtain the processing model. For another example, as the number of steps for training the preset model increases, the number of normalized structures removed can be gradually increased until the specified number of normalized structures are removed to obtain the processing model. The preset model is trained in the above manner, the training process is simple, and the reliability and universality are high. At the same time, the accuracy of the processing model can be ensured, and the processing model obtained by removing a specified number of normalized structures can achieve the same quality as the processing model obtained without removing the normalized structure.
[0074] Furthermore, after obtaining the processing model, the information to be processed can be obtained, and the information to be processed can be input into the processing model to obtain the target information output by the processing model. The information to be processed can contain only text information, only image information, or both text information and image information, and the target information can reflect the specified features included in the information to be processed. For example, when the processing model is applied to a machine translation scenario and the information to be processed contains only text information, the information to be processed can be the text to be translated, and the target information can be the target text after the text to be translated is translated.
[0075] In summary, the present disclosure first obtains information to be processed and uses the information to be processed as the input of the processing model obtained by training the preset model to obtain the target information corresponding to the information to be processed output by the processing model, wherein the information to be processed includes at least one of text information and image information, the target information can reflect the specified features included in the information to be processed, the preset model includes multiple operation modules and a normalization structure corresponding to each operation module, the normalization structure corresponding to each operation module is used to normalize the output of the operation module, and the processing model is obtained by removing the normalization structures corresponding to a specified number of operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model. The present disclosure gradually removes a specified number of normalization structures in the preset model by the target probability or the number of steps for training the preset model to obtain the processing model, which will not interfere with the normal training of the preset model, has high stability in the training of the preset model, and can ensure the quality of the processing model, thereby improving the accuracy of the target information.
[0076] Figure 2 FIG. 1 is a flow chart of a training processing model according to an exemplary embodiment. Figure 2 As shown, the processing model is trained in the following way:
[0077] In step 201, a training sample set is obtained.
[0078] The training sample set includes multiple groups of training data, each group of training data includes: input end training data and corresponding output end training data, the input end training data includes first training information, and the output end training data includes second training information corresponding to the first training information.
[0079] In step 202, the preset model is trained using the training sample set according to the target probability or the number of steps for training the preset model to obtain a processing model.
[0080] Specifically, when training a preset model, a training sample set including multiple groups of training data can be obtained first, each group of training data is composed of input end training data including first training information, and output end training data including second training information. For example, when the processing model is applied to a machine translation scenario, the first training information can be a training text, and the second training information can be a text translated from the training text. Then, according to the target probability or the number of steps for training the preset model, the preset model can be trained multiple times (i.e., multiple Epochs) using all the data of the training sample set to obtain the processing model. Each group of training data can be understood as a batch (Chinese: batch) of data into which the training sample set is divided. Among them, the process of training the preset model can be completed on a terminal or a server. For example, the preset model can be trained on the GPU (English: Graphics Processing Unit, Chinese: Graphics Processing Unit) of the server.
[0081] Figure 3 is based on Figure 2 The embodiment shown shows a flow chart of step 202. Figure 3 As shown, step 202 may include the following steps:
[0082] In step 2021, a first number of normalized structures are selected from all normalized structures included in the preset model according to the target probability for removal.
[0083] In step 2022, the preset model after removing the first number of normalized structures is trained according to the training sample set.
[0084] In one scenario, the preset model can first be trained to convergence while retaining all normalized structures. Then, in each step of training the preset model according to the training sample set, a first number of normalized structures can be randomly selected from all normalized structures included in the preset model according to the target probability for removal until the preset model is trained to convergence, so as to enhance the generalization ability of the preset model and accelerate the convergence of the model, so that the preset model is as independent of the normalized structure as possible. For example, when the preset model includes 5 normalized structures, if the target probability p=0.2, then the first number is: 5*0.2=1, then 1 normalized structure is removed, that is, the normalization processing corresponding to this normalized structure is skipped during the training of the preset model. It should be noted that in each step of training the preset model, the first number of normalized structures removed may be different. The condition for training the preset model to convergence can be: stabilizing the loss function of the preset model in a preset interval so that the fluctuation of the loss function is small.
[0085] In step 2023, the target probability is updated, and the updated target probability is greater than the target probability before the update.
[0086] Repeat steps 2021 to 2023 until a specified number of normalized structures are removed to obtain a processing model.
[0087] Further, the target probability can be updated according to a preset proportionality coefficient to increase the target probability, that is, to increase the first quantity. For example, when the proportionality coefficient is 2, if the target probability is 0.2, the updated target probability is 0.4. At this time, the process of updating the target probability can be represented by p'=2p, where p' is the updated target probability and p is the target probability before the update. Alternatively, the target probability can be updated according to a preset function, and the preset function can be, for example, any function that can increase the target probability, and the present disclosure does not specifically limit this.
[0088] Then, the above steps can be repeated until a specified number of normalized structures are removed according to the target probability, and the preset model after removing the specified number of normalized structures is trained to convergence to obtain a processing model. The specified number can be set by a preset probability threshold. If the target probability is greater than or equal to the probability threshold, the specified number of normalized structures will be removed when the preset model is trained. For example, when all normalized structures need to be removed, the probability threshold can be set to 1. If the target probability is greater than or equal to 1, all normalized structures in the preset model will be removed.
[0089] It should be noted that, by training the preset model to convergence through each target probability, the accuracy of the processing model obtained by training can be ensured. In addition, the process of gradually increasing the target probability can be understood as the process in which the preset model first learns the simpler standard Gaussian distribution with the assistance of the normalized structure, and then gradually removes the assistance of the normalized structure to learn the more difficult distribution.
[0090] Optionally, step 202 may be implemented in the following manner:
[0091] According to the training sample set and the number of steps for training the preset model, the preset model is trained through preset training steps until a specified number of normalized structures are removed to obtain a processing model.
[0092] In another scenario, the preset model can be trained through preset training steps according to the training sample set and the number of steps for training the preset model, so that as the number of steps for training the preset model increases, the number of normalized structures removed is gradually increased until a specified number of normalized structures are removed to obtain a processing model. The preset training steps may include: first, when the number of steps for training the preset model according to the training sample set is N, the target variance is determined according to N, where N is a natural number. For example, the target variance may be determined by a first formula, where the first formula may be, for example: var is the target variance. Then, according to the variance of the output of each current operation module (i.e., the variance of the output of each operation module when the number of training steps is N) and the target variance, it can be determined whether to remove the normalized structure corresponding to the operation module. The method of calculating the variance of the output of each operation module can refer to the description in the relevant technology, and this disclosure will not be described in detail.
[0093] If the variance of the output of the operation module is less than or equal to the target variance, the normalized structure corresponding to the operation module is removed. If the variance of the output of the operation module is greater than the target variance, the normalized structure corresponding to the operation module is retained. In the above manner, when the number of steps for training the preset model is small, the target variance is also small, and more normalized structures can be retained. As the number of steps for training the preset model increases, the target variance will gradually increase, and more and more normalized structures will be removed until a specified number of normalized structures are removed to obtain a processing model.
[0094] Optionally, the preset model includes an encoder and a decoder, the encoder is composed of a second number of operation modules, the decoder is composed of a third number of operation modules, and the operation module is an attention network or a feedforward neural network.
[0095] For example, when the preset model is a deep learning model using a Transformer structure, the preset model may include an encoder and a decoder, the encoder includes a second number of operation layers, and each operation layer of the encoder is composed of an attention network that performs Multi-Head Attention (Chinese: multi-head attention) operations and a feedforward neural network. The decoder includes a third number of operation layers, and each operation layer of the decoder is composed of an attention network that performs Masked Multi-Head Attention operations, an attention network that performs Multi-Head Attention operations, and a feedforward neural network. Each operation module (attention network or feedforward neural network) corresponds to a normalized structure, then each operation layer of the encoder corresponds to two normalized structures, and each operation layer of the decoder corresponds to three normalized structures. Among them, the second number and the third number may be the same or different, and the present disclosure does not impose specific restrictions on this.
[0096] In summary, the present disclosure first obtains information to be processed and uses the information to be processed as the input of the processing model obtained by training the preset model to obtain the target information corresponding to the information to be processed output by the processing model, wherein the information to be processed includes at least one of text information and image information, the target information can reflect the specified features included in the information to be processed, the preset model includes multiple operation modules and a normalization structure corresponding to each operation module, the normalization structure corresponding to each operation module is used to normalize the output of the operation module, and the processing model is obtained by removing the normalization structures corresponding to a specified number of operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model. The present disclosure gradually removes a specified number of normalization structures in the preset model by the target probability or the number of steps for training the preset model to obtain the processing model, which will not interfere with the normal training of the preset model, has high stability in the training of the preset model, and can ensure the quality of the processing model, thereby improving the accuracy of the target information.
[0097] Figure 4 FIG. 1 is a block diagram of an information processing device according to an exemplary embodiment. Figure 4 As shown, the information processing device 300 includes an acquisition module 301 and a processing module 302 .
[0098] The acquisition module 301 is configured to acquire information to be processed, where the information to be processed includes at least one of text information and image information.
[0099] The processing module 302 is configured to use the information to be processed as the input of the processing model obtained by training the preset model to obtain the target information corresponding to the information to be processed output by the processing model, and the target information can reflect the specified features included in the information to be processed.
[0100] Among them, the preset model includes multiple operation modules and a normalization structure corresponding to each operation module, and the normalization structure corresponding to each operation module is used to normalize the output of the operation module; the processing model is obtained by removing the normalization structures corresponding to a specified number of operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model.
[0101] Optionally, the processing module 302 is configured to train the processing model in the following manner:
[0102] Acquire a training sample set. The training sample set includes multiple groups of training data, each group of training data includes: input end training data and corresponding output end training data, the input end training data includes first training information, and the output end training data includes second training information corresponding to the first training information.
[0103] According to the target probability or the number of steps for training the preset model, the preset model is trained using the training sample set to obtain a processing model.
[0104] Optionally, the processing module 302 is configured to:
[0105] A first number of normalized structures are selected from all normalized structures included in the preset model according to the target probability for removal.
[0106] According to the training sample set, the preset model is trained after removing the first number of normalized structures.
[0107] Update the target probability, and the updated target probability is greater than the target probability before the update.
[0108] Repeat the steps of selecting a first number of normalized structures to be removed from all normalized structures included in the preset model according to the target probability, and updating the target probability until a specified number of normalized structures are removed to obtain a processing model.
[0109] Optionally, the processing module 302 is configured to:
[0110] Update the target probability according to the preset proportionality factor. Or,
[0111] Update the target probability according to the preset function.
[0112] Optionally, the processing module 302 is configured to:
[0113] According to the training sample set and the number of steps for training the preset model, the preset model is trained through preset training steps until a specified number of normalized structures are removed to obtain a processing model.
[0114] Optionally, the preset training steps include:
[0115] When the number of steps for training the preset model according to the training sample set is N, the target variance is determined according to N, where N is a natural number.
[0116] According to the variance of the output of each current operation module and the target variance, it is determined whether to remove the normalized structure corresponding to the operation module.
[0117] If the variance of the output of the operation module is less than or equal to the target variance, the normalization structure corresponding to the operation module is removed.
[0118] If the variance of the output of the operation module is greater than the target variance, the normalized structure corresponding to the operation module is retained.
[0119] Optionally, the preset model includes an encoder and a decoder, the encoder is composed of a second number of operation modules, the decoder is composed of a third number of operation modules, and the operation module is an attention network or a feedforward neural network.
[0120] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0121] In summary, the present disclosure first obtains information to be processed and uses the information to be processed as the input of the processing model obtained by training the preset model to obtain the target information corresponding to the information to be processed output by the processing model, wherein the information to be processed includes at least one of text information and image information, the target information can reflect the specified features included in the information to be processed, the preset model includes multiple operation modules and a normalization structure corresponding to each operation module, the normalization structure corresponding to each operation module is used to normalize the output of the operation module, and the processing model is obtained by removing the normalization structures corresponding to a specified number of operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model. The present disclosure gradually removes a specified number of normalization structures in the preset model by the target probability or the number of steps for training the preset model to obtain the processing model, which will not interfere with the normal training of the preset model, has high stability in the training of the preset model, and can ensure the quality of the processing model, thereby improving the accuracy of the target information.
[0122] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, which implement the steps of the information processing method provided by the present disclosure when the program instructions are executed by a processor.
[0123] In summary, the present disclosure first obtains information to be processed and uses the information to be processed as the input of the processing model obtained by training the preset model to obtain the target information corresponding to the information to be processed output by the processing model, wherein the information to be processed includes at least one of text information and image information, the target information can reflect the specified features included in the information to be processed, the preset model includes multiple operation modules and a normalization structure corresponding to each operation module, the normalization structure corresponding to each operation module is used to normalize the output of the operation module, and the processing model is obtained by removing the normalization structures corresponding to a specified number of operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model. The present disclosure gradually removes a specified number of normalization structures in the preset model by the target probability or the number of steps for training the preset model to obtain the processing model, which will not interfere with the normal training of the preset model, has high stability in the training of the preset model, and can ensure the quality of the processing model, thereby improving the accuracy of the target information.
[0124] Figure 5 8 is a block diagram of an electronic device 800 according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0125] Reference Figure 5 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0126] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned information processing method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0127] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0128] The power component 806 provides power to the various components of the electronic device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
[0129] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0130] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0131] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0132] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0133] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0134] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned information processing method.
[0135] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to complete the above-mentioned information processing method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0136] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above-mentioned information processing method when executed by the programmable device.
[0137] In summary, the present disclosure first obtains information to be processed and uses the information to be processed as the input of the processing model obtained by training the preset model to obtain the target information corresponding to the information to be processed output by the processing model, wherein the information to be processed includes at least one of text information and image information, the target information can reflect the specified features included in the information to be processed, the preset model includes multiple operation modules and a normalization structure corresponding to each operation module, the normalization structure corresponding to each operation module is used to normalize the output of the operation module, and the processing model is obtained by removing the normalization structures corresponding to a specified number of operation modules according to the target probability or the number of steps for training the preset model during the training of the preset model. The present disclosure gradually removes a specified number of normalization structures in the preset model by the target probability or the number of steps for training the preset model to obtain the processing model, which will not interfere with the normal training of the preset model, has high stability in the training of the preset model, and can ensure the quality of the processing model, thereby improving the accuracy of the target information.
[0138] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0139] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method of processing information, It is characterized in that The method comprises: Acquire information to be processed, wherein the information to be processed includes at least one of text information and image information; Using the information to be processed as an input of a processing model trained by a preset model to obtain target information corresponding to the information to be processed output by the processing model, wherein the target information can reflect specified features included in the information to be processed; Wherein, the preset model includes a plurality of operation modules and a normalization structure corresponding to each of the operation modules, and the normalization structure corresponding to each of the operation modules is used to perform normalization processing on the output of the operation module; the processing model is obtained by removing the normalization structures corresponding to a specified number of the operation modules according to the target probability during the training of the preset model, or by training the preset model through preset training steps according to the number of steps for training the preset model until the normalization structures corresponding to the specified number of the operation modules are removed, and the target probability is updated according to a preset proportional coefficient or according to a preset function, and the updated target probability is greater than the target probability before the update; The preset training steps include: When the number of steps for training the preset model according to the training sample set is N, determining the target variance according to N, where N is a natural number; Determining whether to remove the normalized structure corresponding to each of the operation modules according to the variance of the output of the current operation modules and the target variance; If the variance of the output of the operation module is less than or equal to the target variance, the normalization structure corresponding to the operation module is removed; If the variance of the output of the operation module is greater than the target variance, the normalized structure corresponding to the operation module is retained.
2. The method according to claim 1, It is characterized in that The processing model is trained in the following way: Acquire a training sample set; the training sample set includes multiple groups of training data, each group of the training data includes: input end training data and corresponding output end training data, the input end training data includes first training information, and the output end training data includes second training information corresponding to the first training information; According to the target probability or the number of steps for training the preset model, the preset model is trained using the training sample set to obtain the processing model.
3. The method according to claim 2, It is characterized in that The step of training the preset model using the training sample set according to the target probability or the number of steps for training the preset model to obtain the processing model includes: Selecting a first number of the normalized structures from all the normalized structures included in the preset model according to the target probability to remove; According to the training sample set, training the preset model after removing the first number of normalized structures; Updating the target probability, wherein the updated target probability is greater than the target probability before the update; Repeat the step of selecting a first number of the normalized structures to be removed from all the normalized structures included in the preset model according to the target probability, and then updating the target probability until a specified number of the normalized structures are removed to obtain the processing model.
4. The method according to claim 2, It is characterized in that The step of training the preset model using the training sample set according to the target probability or the number of steps for training the preset model to obtain the processing model includes: According to the training sample set and the number of steps for training the preset model, the preset model is trained through preset training steps until a specified number of the normalized structures are removed to obtain the processing model.
5. The method according to any one of claims 1 to 4, It is characterized in that The preset model includes an encoder and a decoder, the encoder is composed of a second number of the operation modules, and the decoder is composed of a third number of the operation modules; the operation modules are attention networks or feedforward neural networks.
6. An information processing device, It is characterized in that The device comprises: An acquisition module, configured to acquire information to be processed, wherein the information to be processed includes at least one of text information and image information; A processing module is configured to use the information to be processed as an input of a processing model trained by a preset model to obtain target information corresponding to the information to be processed output by the processing model, wherein the target information can reflect a specified feature included in the information to be processed; Wherein, the preset model includes a plurality of operation modules and a normalization structure corresponding to each of the operation modules, and the normalization structure corresponding to each of the operation modules is used to perform normalization processing on the output of the operation module; the processing model is obtained by removing the normalization structures corresponding to a specified number of the operation modules according to the target probability during the training of the preset model, or by training the preset model through preset training steps according to the number of steps for training the preset model until the normalization structures corresponding to the specified number of the operation modules are removed, and the target probability is updated according to a preset proportional coefficient or according to a preset function, and the updated target probability is greater than the target probability before the update; The preset training steps include: When the number of steps for training the preset model according to the training sample set is N, determining the target variance according to N, where N is a natural number; Determining whether to remove the normalized structure corresponding to each of the operation modules according to the variance of the output of the current operation modules and the target variance; If the variance of the output of the operation module is less than or equal to the target variance, the normalization structure corresponding to the operation module is removed; If the variance of the output of the operation module is greater than the target variance, the normalized structure corresponding to the operation module is retained.
7. An electronic device, It is characterized in that include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having computer program instructions stored thereon, It is characterized in that When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented.
