CN117725959A - Data updating method, device, electronic equipment and computer storage medium - Google Patents

Data updating method, device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN117725959A
CN117725959A CN202311309629.XA CN202311309629A CN117725959A CN 117725959 A CN117725959 A CN 117725959A CN 202311309629 A CN202311309629 A CN 202311309629A CN 117725959 A CN117725959 A CN 117725959A
Authority
CN
China
Prior art keywords
model
trained
network layer
updated
data
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.)
Pending
Application number
CN202311309629.XA
Other languages
Chinese (zh)
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.)
Shuhang Technology Beijing Co ltd
Original Assignee
Shuhang Technology Beijing 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 Shuhang Technology Beijing Co ltd filed Critical Shuhang Technology Beijing Co ltd
Priority to CN202311309629.XA priority Critical patent/CN117725959A/en
Publication of CN117725959A publication Critical patent/CN117725959A/en
Pending legal-status Critical Current

Links

Abstract

The embodiment of the application discloses a data updating method, a data updating device, electronic equipment and a computer storage medium; in the embodiment of the application, a model to be trained and a data set corresponding to the model to be trained are obtained, wherein the data set comprises at least one training data; setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, wherein a parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated; and updating the at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain a target model corresponding to the model to be trained. According to the embodiment of the application, the time for model training can be reduced, and the efficiency of model training is improved.

Description

Data updating method, device, electronic equipment and computer storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data updating method, a data updating device, an electronic device, and a computer storage medium.
Background
With the development of science and technology, the neural network model is increasingly widely applied. The neural network model needs to be trained before it can be used.
In order to ensure the application effect of the neural network model, more data are usually required to train the neural network model, so that the training time is longer and the training efficiency is lower.
Disclosure of Invention
The embodiment of the application provides a data updating method, a device, electronic equipment and a computer storage medium, which can solve the technical problems of longer training time and lower training efficiency of a neural network model.
The embodiment of the application provides a data updating method, which comprises the following steps:
acquiring a model to be trained and a data set of the model to be trained, wherein the data set comprises a plurality of training data;
setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, wherein a parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated;
and updating the at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain a target model corresponding to the model to be trained.
Accordingly, an embodiment of the present application provides a data updating apparatus, including:
the acquisition module is used for acquiring a model to be trained and a data set of the model to be trained, wherein the data set comprises a plurality of training data;
the setting module is used for setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, and the parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated;
and the training module is used for updating the at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain a target model corresponding to the model to be trained.
In addition, the embodiment of the application also provides electronic equipment, which comprises a processor and a memory, wherein the memory stores a computer program, and the processor is used for running the computer program in the memory to realize the data updating method provided by the embodiment of the application.
In addition, the embodiment of the application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute any one of the data updating methods provided by the embodiment of the application.
Furthermore, embodiments of the present application provide a computer program product, including a computer program, which when executed by a processor implements any of the data updating methods provided by the embodiments of the present application.
In the embodiment of the application, a model to be trained and a data set of the model to be trained are obtained, wherein the data set comprises a plurality of training data; setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, wherein a parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated; according to training data, updating at least two parameter matrixes to be updated in the model to be trained to obtain a target model corresponding to the model to be trained, and because the parameter matrix of the additional network layer is the product of the at least two parameter matrixes to be updated, the parameter matrix of the additional network layer needs fewer parameters to be updated, so that training data needed by updating is reduced, the time for updating the model to be trained is reduced, and the efficiency for updating the model to be trained is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a data updating method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a model to be trained provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of another model to be trained provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of another model to be trained provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of a parameter matrix to be updated according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data updating device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The embodiment of the application provides a data updating method, a data updating device, electronic equipment and a computer storage medium. The data updating device may be integrated in an electronic device, which may be a server or a device such as a terminal.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), basic cloud computing services such as big data and an artificial intelligent platform.
The terminal may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
In addition, "plurality" in the embodiments of the present application means two or more. "first" and "second" and the like in the embodiments of the present application are used for distinguishing descriptions and are not to be construed as implying relative importance.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
In this embodiment, description will be made from the viewpoint of a data updating apparatus, and for convenience, a data updating method of the present application will be described in detail below with the data updating apparatus integrated in a terminal, that is, with the terminal as an execution subject.
Referring to fig. 1, fig. 1 is a flowchart of a data updating method according to an embodiment of the present application. The data updating method may include:
s101, acquiring a model to be trained and a data set corresponding to the model to be trained, wherein the data set comprises at least one training data.
The model to be trained refers to a network system formed by connecting network layers, wherein the network layers can comprise at least one neuron, and the neuron refers to a computing unit.
The type of the model to be trained may be selected according to practical situations, for example, the model to be trained may be a convolutional neural network model (Convolutional Neural Networks, CNN) or a recurrent neural network (Recurrent Neural Networks, RNN), which are not limited herein.
The model to be trained can be an initialized model or a model trained by adopting a large-scale common data set. The type of the large-scale common data set may be selected according to practical situations, for example, the large-scale common data set may be "Mozilla Common Voice" or "IBM Diversity in Faces Dataset", which are not limited herein in this embodiment.
The data set corresponding to the model to be trained may be a data set of a certain service, and the data set of the certain service may include data of at least one service drop class of the service scenario. The service verticals refer to sub-division of services, for example, if the service is a video service, then the service verticals may be eating video services.
When the model to be trained is a model trained by adopting a large-scale common data set, after the model to be trained is updated by adopting the data set corresponding to the model to be trained to obtain the target model, the target model not only can keep universality, but also can be adapted to the service sag class corresponding to the data set, and the target model is adapted to the service sag class corresponding to the data set, so that the application effect of the target model in the service sag class can be understood to be better.
The form of the training data in the data set may be set according to practical situations, for example, the training data may be at least one of an image, a text, an audio or a video, which is not limited herein.
Optionally, the terminal may acquire the model to be trained and the data set of the model to be trained in the local storage space, or the terminal may also acquire the model to be trained and the data set of the model to be trained in other devices (other devices may be other terminals or servers).
The mode of acquiring the model to be trained and the data set of the model to be trained by the terminal can be set according to actual conditions, and the embodiment of the application is not limited herein.
S102, setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, wherein a parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated.
An additional network layer that matches the functionality of at least one network layer of the model to be trained may be understood as a network layer that is functionally identical to the at least one network layer.
For example, the function of at least one network layer is a feature extraction function, and the function of an additional network layer that matches the function of at least one network layer is also a feature extraction function.
The terminal may determine the function of at least one network layer of the model to be trained and the location of at least one network layer in the model to be trained, and then set an additional network layer matching the function at a location matching the location.
The position matching the position may be a position juxtaposed with the position, or may be a position adjacent to the position and located after the position.
For example, as shown in fig. 2, the model to be trained may include an input layer, a convolution layer, and an output layer, where at least one network layer is the convolution layer, and output data of the convolution layer may be "y=wx", Y represents output data of the convolution layer, W represents a parameter matrix of the convolution layer, and X represents input data of the convolution layer.
After setting the additional network layer matched with the function of the at least one network layer, if the position of the additional network layer is a position parallel to the position of the at least one network layer, at this time, the model to be trained may be as shown in fig. 3, and the output data corresponding to the convolution layer may be "y= (w+Δw) X", where Δw is a parameter matrix of the additional network layer. If the location of the additional network layer is adjacent to and behind the location of the at least one network layer, the model to be trained may be as shown in fig. 4, and the output data corresponding to the convolution layer may be changed to y=wxΔw, where Δw is a parameter matrix of the additional network layer.
After setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, if the parameter matrix of the additional network layer corresponds to one, the updated parameter amount cannot be reduced when updating the parameter matrix of the additional network layer.
For example, if the parameter matrix of the additional network layer is Δw and Δw is m×n, when Δw is set as the product of two parameter matrices to be updated, the two parameter matrices to be updated may be m×r and r×n, that is, Δw=Δw 1 *ΔW 2 At this time, the relationship between the parameter matrix of the additional network layer and the two parameter matrices to be updated may be as shown in fig. 5, when m and n are both 768 and r is equal to 64, if Δw is not set to be the product of the two parameter matrices to be updated, the number of parameters to be updated is "768×768= 589824"If Δw is set as the product of two parameter matrices to be updated, the number of parameters to be updated is "768×64+64×768=98304", and the number of parameters to be updated is reduced by 6 times.
Optionally, one network layer may be provided with at least one additional network layer. Additional network layers may be provided for all network layers in the model to be trained, or may be provided for some of all network layers in the model to be trained.
When additional network layers are set for some of all network layers in the model to be trained, the process of setting additional network layers matched with the functions of at least one network layer of the model to be trained in the model to be trained may be:
acquiring the size of a parameter matrix corresponding to each network layer in a model to be trained;
taking a network layer corresponding to the size meeting the preset size condition as at least one network layer;
an additional network layer is provided that matches the functionality of the at least one network layer.
The size satisfying the preset size condition is understood as a larger size. Because the parameter amount that indicates that the parameter matrix needs to be updated is larger when the size of the parameter matrix is larger, and the parameter amount that indicates that the parameter matrix needs to be updated is smaller when the size of the parameter matrix is smaller, in this embodiment of the present application, when the size of the parameter matrix of the network layer is smaller, an additional network layer may not be set for the network layer, then the parameter matrix of the network layer is updated according to training data, when the size of the parameter matrix of the network layer is larger, an additional network layer that is matched with the function of the network layer is set at a position that is matched with the position of the network layer, and then the parameter matrix of the additional network layer of the network layer is updated according to training data, so that the number of additional network layers can be reduced while the updated parameter amount is reduced, and then the size of the model to be trained is reduced.
In some embodiments, in the model to be trained, setting an additional network layer matching the function of at least one network layer of the model to be trained, comprising:
determining the size of a parameter matrix corresponding to at least one network layer in the model to be trained;
setting an initial parameter matrix according to the size;
decomposing the initial parameter matrix to obtain at least two parameter matrices to be updated;
according to the two parameter matrixes to be updated, setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained.
The initial parameter matrix is a parameter matrix of the additional network layer, and the terminal may use the size of the parameter matrix corresponding to at least one network layer as the size of the initial parameter matrix, where the parameters in the initial parameter matrix may be preset values or randomly generated values. For example, when the parameters in the initial parameter matrix are preset values and the preset values are 0, the parameters in the initial parameter matrix may be all 0. For another example, when the parameters in the initial parameter matrix are randomly generated values, the parameters in the initial parameter matrix may be 0 and 1.
Optionally, in order to further reduce the number of updates of the parameter matrix to be updated, and improve the update efficiency, the process of setting the initial parameter matrix according to the size may be:
determining a service sag class corresponding to a data set of a model to be trained;
acquiring a trained model associated with a service sag, wherein the trained model is a model of a network layer with the same function as a model to be trained;
determining parameters in a parameter matrix of an additional network layer matched with the function of at least one network layer in the trained model to obtain candidate parameters;
and setting an initial parameter matrix according to the size and the candidate parameters.
The trained model associated with the service sags may be understood as a model adapted to the service sags, may be understood as a model obtained by training a data set of the model to be trained, may be understood as a model obtained by training a data set of candidate service sags matching the service sags, and the candidate service sags may be understood as service sags having a similarity with the service sags of the data set greater than a preset similarity.
For example, the service verticals may be eating video, and the candidate service verticals matching the service verticals may be serving video.
In the embodiment of the application, determining a service verticality corresponding to a data set of a model to be trained; obtaining a trained model matched with the service sags, wherein the trained model is a model of a network layer with the same function as a model to be trained; determining parameters in a parameter matrix of an additional network layer matched with the function of at least one network layer in the trained model to obtain candidate parameters; according to the size and the candidate parameters, setting an initial parameter matrix so as to reduce the updating times of at least two parameter matrices to be updated obtained according to the initial parameter matrix and further improve the updating efficiency.
For example, the service verticals are plant images, the model to be trained is used for dividing the plant images, the trained model obtained through data set training of the service verticals is used for identifying the plant images, the model to be trained and the trained model both comprise convolution layers, at least one network layer is the convolution layer, parameters of a parameter matrix of an additional network layer of the convolution layer in the trained model can be used as candidate parameters, the candidate parameters are used as parameters in an initial parameter matrix, and the size is used as the size of the initial parameter matrix.
For another example, the service verticals are eating and broadcasting videos, the candidate service verticals are eating and broadcasting videos, the to-be-trained model is used for identifying eating and broadcasting videos, the trained model obtained through training of the data set of the candidate service verticals is used for identifying eating and broadcasting videos, the to-be-trained model and the trained model both comprise convolution layers, at least one network layer is the convolution layer, parameters of a parameter matrix of an additional network layer of the convolution layer in the trained model can be used as candidate parameters, the candidate parameters are used as parameters in an initial parameter matrix, and the size is used as the size of the initial parameter matrix.
After obtaining the initial parameter matrix, the terminal decomposes the initial parameter matrix to obtain at least two parameter matrices to be updated. The terminal can acquire a preset size coefficient, and then decompose the initial parameter matrix according to the preset size coefficient to obtain at least two parameter matrices to be updated.
For example, if the preset size coefficient is r and the initial parameter matrix is m×n, the sizes of the two parameter matrices to be updated may be m×r and r×n, respectively.
Alternatively, the decomposition size coefficient may be determined according to the number of training data in the data set; and decomposing the initial parameter matrix according to the decomposition size coefficient to obtain at least two parameter matrices to be updated.
For example, the smaller the number of training data in the data set, the larger the number of decomposition size coefficients, the larger the decomposition size coefficients, so that the smaller the number of parameters of the parameter matrix to be updated obtained according to the decomposition size coefficients is in the case of the smaller the number of training data, the smaller the number of parameters to be updated is required, and the larger the number of parameters of the parameter matrix to be updated obtained according to the decomposition size coefficients is in the case of the larger the number of training data, so as to refine the parameters of the parameter matrix of the additional network layer, so that the accuracy of the parameter matrix of the additional network layer can be improved while the training efficiency is ensured.
Optionally, the terminal may also determine the number of parameter matrices to be updated according to the number of training data in the data set, and decompose the initial parameter matrix according to the number to obtain at least two parameter matrices to be updated.
For example, the fewer the number of training data in the data set, the more the number of parameter matrices to be updated may be, and the fewer the number of training data in the data set, so that the fewer the number of parameters of the parameter matrices to be updated obtained according to the number is, the fewer the number of parameters to be updated is, and the more the number of parameters of the parameter matrices to be updated obtained according to the number is, so as to refine the parameters of the parameter matrices of the additional network layer, so that the accuracy of the parameter matrices of the additional network layer can be improved while the training efficiency is ensured.
Optionally, in determining the decomposition size coefficient according to the number of training data in the data set, the number of parameter matrices to be updated may also be determined according to the number of training data in the data set, and then the decomposition size coefficient may be determined according to the number.
After obtaining at least two parameter matrixes to be updated, the terminal sets an additional network layer matched with the function of at least one network layer at a position matched with the position of at least one network layer according to the at least two parameter matrixes to be updated.
And S103, updating at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain a target model corresponding to the model to be trained.
Because the model training essentially updates parameters in the parameter matrix of the network layer in the model, in the embodiment of the application, at least two parameter matrices to be updated in the model to be trained are updated according to training data, and the model to be trained is essentially trained, so that a target model in which the training of the model to be trained is completed is obtained.
The function of the object model may be set according to actual situations, for example, the object model may be used for image processing (image processing may be, for example, image recognition or image segmentation), audio recognition, text recognition, and the like, which are not limited herein.
Optionally, updating at least two parameter matrices to be updated in the model to be trained according to the training data, and the process of obtaining the target model corresponding to the model to be trained may be:
extracting features of the training data to obtain sample features corresponding to the training data;
determining a loss value of the model to be trained according to the sample characteristics;
if the loss value meets the preset loss condition, taking the model to be trained as a target model;
if the loss value does not meet the preset loss condition, updating at least two parameter matrixes to be updated according to the loss value to obtain an updated model, taking the updated model as the model to be trained, and returning to execute feature extraction on training data to obtain sample features corresponding to the training data.
Optionally, when updating of at least two parameter matrices to be updated in the model to be trained is completed according to the training data, the model to be trained may be directly used as the target model, that is, at this time, the network layer in the target model and the additional network layer corresponding to the network layer exist separately.
Or when updating of at least two parameter matrixes to be updated in the model to be trained is completed according to the training data, the network layer in the model to be trained and the additional network layer corresponding to the network layer can be fused to obtain the target model, and at this time, updating is performed on at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain the target model corresponding to the model to be trained, including:
updating at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain candidate models corresponding to the model to be trained;
and carrying out fusion processing on at least one network layer and an additional network layer corresponding to the at least one network layer in the candidate model to obtain a target model corresponding to the model to be trained.
In the embodiment of the application, at least two parameter matrixes to be updated in a model to be trained are updated according to training data, so that candidate models corresponding to the model to be trained are obtained; and carrying out fusion processing on at least one network layer and an additional network layer corresponding to the at least one network layer in the candidate model to obtain a target model corresponding to the model to be trained, so that the network layer in the target model and the additional network layer corresponding to the network layer are fused into a new network layer, and the calculation during the subsequent data processing through the target model is facilitated.
As can be seen from the above, in the embodiment of the present application, a model to be trained and a data set of the model to be trained are obtained, where the data set includes a plurality of training data; setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, wherein a parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated; according to training data, updating at least two parameter matrixes to be updated in the model to be trained to obtain a target model corresponding to the model to be trained, and because the parameter matrix of the additional network layer is the product of the at least two parameter matrixes to be updated, the parameter matrix of the additional network layer needs fewer parameters to be updated, so that training data needed by updating is reduced, the time for updating the model to be trained is reduced, and the efficiency for updating the model to be trained is improved.
In order to facilitate better implementation of the data updating method provided by the embodiment of the application, the embodiment of the application also provides a device based on the data updating method. Where nouns have the same meaning as in the data update method described above, specific implementation details may be referred to in the description of the method embodiments.
For example, as shown in fig. 6, the data updating apparatus may include:
the acquiring module 601 is configured to acquire a model to be trained and a data set of the model to be trained, where the data set includes a plurality of training data.
The setting module 602 is configured to set, in the model to be trained, an additional network layer that matches a function of at least one network layer of the model to be trained, where a parameter matrix of the additional network layer is a product of at least two parameter matrices to be updated.
The training module 603 is configured to update at least two parameter matrices to be updated in the model to be trained according to the training data, so as to obtain a target model corresponding to the model to be trained.
Optionally, the setting module 602 is specifically configured to perform:
determining the size of a parameter matrix corresponding to at least one network layer in the model to be trained;
setting an initial parameter matrix according to the size;
decomposing the initial parameter matrix to obtain at least two parameter matrices to be updated;
according to the two parameter matrixes to be updated, setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained.
Optionally, the setting module 602 is specifically configured to perform:
determining a decomposition size coefficient according to the quantity of training data in the data set;
and decomposing the initial parameter matrix according to the decomposition size coefficient to obtain at least two parameter matrices to be updated.
Optionally, the setting module 602 is specifically configured to perform:
determining the number of parameter matrixes to be updated according to the number of training data in the data set;
and decomposing the initial parameter matrix according to the number to obtain at least two parameter matrices to be updated.
Optionally, the setting module 602 is specifically configured to perform:
determining the function of at least one network layer of the model to be trained and the position of at least one network layer in the model to be trained;
an additional network layer matched with the function is arranged at the position parallel to the position.
Optionally, the setting module 602 is specifically configured to perform:
acquiring the size of a parameter matrix corresponding to each network layer in a model to be trained;
taking a network layer corresponding to the size meeting the preset size condition as at least one network layer;
an additional network layer is provided that matches the functionality of the at least one network layer.
Optionally, the training module 603 is specifically configured to perform:
updating at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain candidate models corresponding to the model to be trained;
and carrying out fusion processing on at least one network layer and an additional network layer corresponding to the at least one network layer in the candidate model to obtain a target model corresponding to the model to be trained.
In the specific implementation, each module may be implemented as an independent entity, or may be combined arbitrarily, and implemented as the same entity or a plurality of entities, and the specific implementation and the corresponding beneficial effects of each module may be referred to the foregoing method embodiments, which are not described herein again.
The embodiment of the application also provides an electronic device, which may be a server or a terminal, as shown in fig. 7, and shows a schematic structural diagram of the electronic device according to the embodiment of the application, specifically:
the electronic device may include one or more processing cores 'processors 701, one or more computer-readable storage media's memory 702, power supply 703, and input unit 704, among other components. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 7 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the processor 701 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by running or executing computer programs and/or modules stored in the memory 702, and invoking data stored in the memory 702. Optionally, processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701.
The memory 702 may be used to store computer programs and modules, and the processor 701 executes various functional applications and data updates by running the computer programs and modules stored in the memory 702. The memory 702 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, computer programs required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the electronic device, etc. In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide access to the memory 702 by the processor 701.
The electronic device further comprises a power supply 703 for powering the various components, preferably the power supply 703 is logically connected to the processor 701 by a power management system, whereby the functions of managing charging, discharging, and power consumption are performed by the power management system. The power supply 703 may also include one or more of any component, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, etc.
The electronic device may further comprise an input unit 704, which input unit 704 may be used for receiving input digital or character information and generating keyboard, mouse, joystick, optical or trackball signal inputs in connection with user settings and function control.
Although not shown, the electronic device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 701 in the electronic device loads executable files corresponding to the processes of one or more computer programs into the memory 702 according to the following instructions, and the processor 701 executes the computer programs stored in the memory 702, so as to implement various functions, for example:
acquiring a model to be trained and a data set corresponding to the model to be trained, wherein the data set comprises at least one training data;
setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, wherein a parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated;
and updating at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain a target model corresponding to the model to be trained.
The specific embodiments and the corresponding beneficial effects of the above operations can be referred to the above detailed description of the data updating method, and will not be described herein.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of the various methods of the above embodiments may be performed by a computer program, or by computer program control related hardware, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a computer program that is capable of being loaded by a processor to perform steps in any of the data update methods provided by embodiments of the present application. For example, the computer program may perform the steps of:
acquiring a model to be trained and a data set corresponding to the model to be trained, wherein the data set comprises at least one training data;
setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, wherein a parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated;
and updating at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain a target model corresponding to the model to be trained.
The specific embodiments and the corresponding beneficial effects of each of the above operations can be found in the foregoing embodiments, and are not described herein again.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Since the computer program stored in the computer readable storage medium may execute the steps in any data updating method provided in the embodiments of the present application, the beneficial effects that any data updating method provided in the embodiments of the present application may be achieved are detailed in the previous embodiments and will not be described herein.
Among other things, according to one aspect of the present application, a computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions so that the computer device performs the above-described data updating method.
The foregoing has described in detail a data updating method, apparatus, electronic device and computer storage medium provided by the embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing description of the embodiments is only for aiding in understanding the method and core idea of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A method of updating data, comprising:
acquiring a model to be trained and a data set corresponding to the model to be trained, wherein the data set comprises at least one training data;
setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, wherein a parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated;
and updating the at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain a target model corresponding to the model to be trained.
2. The method for updating data according to claim 1, wherein the step of setting, in the model to be trained, an additional network layer that matches a function of at least one network layer of the model to be trained, comprises:
determining the size of a parameter matrix corresponding to at least one network layer in the model to be trained;
setting an initial parameter matrix according to the size;
decomposing the initial parameter matrix to obtain at least two parameter matrices to be updated;
and setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained according to the two parameter matrixes to be updated.
3. The method for updating data according to claim 2, wherein said decomposing the initial parameter matrix to obtain at least two parameter matrices to be updated comprises:
determining a decomposition size coefficient according to the number of the training data in the dataset;
and decomposing the initial parameter matrix according to the decomposition size coefficient to obtain at least two parameter matrices to be updated.
4. The method for updating data according to claim 2, wherein said decomposing the initial parameter matrix to obtain at least two parameter matrices to be updated comprises:
determining the number of the parameter matrixes to be updated according to the number of the training data in the data set;
and decomposing the initial parameter matrix according to the number to obtain at least two parameter matrices to be updated.
5. The method for updating data according to claim 1, wherein the step of setting, in the model to be trained, an additional network layer that matches a function of at least one network layer of the model to be trained, comprises:
determining the function of at least one network layer of the model to be trained and the position of the at least one network layer in the model to be trained;
an additional network layer matching the function is provided at a location juxtaposed to the location.
6. The method for updating data according to claim 1, wherein the step of setting, in the model to be trained, an additional network layer that matches a function of at least one network layer of the model to be trained, comprises:
acquiring the size of a parameter matrix corresponding to each network layer in the model to be trained;
taking a network layer corresponding to the size meeting the preset size condition as at least one network layer;
an additional network layer is provided that matches the functionality of the at least one network layer.
7. The method for updating data according to any one of claims 1 to 6, wherein updating the at least two parameter matrices to be updated in the model to be trained according to the training data, to obtain a target model corresponding to the model to be trained, includes:
updating the at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain candidate models corresponding to the model to be trained;
and carrying out fusion processing on the at least one network layer and the additional network layer corresponding to the at least one network layer in the candidate model to obtain a target model corresponding to the model to be trained.
8. A data updating apparatus, comprising:
the system comprises an acquisition module, a training module and a training module, wherein the acquisition module is used for acquiring a model to be trained and a data set of the model to be trained, and the data set comprises a plurality of training data;
the setting module is used for setting an additional network layer matched with the function of at least one network layer of the model to be trained in the model to be trained, and a parameter matrix of the additional network layer is the product of at least two parameter matrices to be updated;
and the training module is used for updating the at least two parameter matrixes to be updated in the model to be trained according to the training data to obtain a target model corresponding to the model to be trained.
9. An electronic device comprising a processor and a memory, the memory storing a computer program, the processor being configured to execute the computer program in the memory to perform the data updating method of any of claims 1 to 7.
10. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program adapted to be loaded by a processor for performing the data updating method of any of claims 1 to 7.
CN202311309629.XA 2023-10-10 2023-10-10 Data updating method, device, electronic equipment and computer storage medium Pending CN117725959A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311309629.XA CN117725959A (en) 2023-10-10 2023-10-10 Data updating method, device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311309629.XA CN117725959A (en) 2023-10-10 2023-10-10 Data updating method, device, electronic equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN117725959A true CN117725959A (en) 2024-03-19

Family

ID=90200527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311309629.XA Pending CN117725959A (en) 2023-10-10 2023-10-10 Data updating method, device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN117725959A (en)

Similar Documents

Publication Publication Date Title
CN111292262B (en) Image processing method, device, electronic equipment and storage medium
JP5880101B2 (en) Information processing apparatus, information processing method, and program
WO2023168998A1 (en) Video clip identification method and apparatus, device, and storage medium
CN111563192A (en) Entity alignment method and device, electronic equipment and storage medium
WO2024067373A1 (en) Data processing method and related apparatus
CN114461382A (en) Flexibly configurable computing power scheduling implementation method and device and storage medium
CN110399564B (en) Account classification method and device, storage medium and electronic device
CN112052399B (en) Data processing method, device and computer readable storage medium
CN111709473B (en) Clustering method and device for object features
CN112044061A (en) Game picture processing method and device, electronic equipment and storage medium
CN116957006A (en) Training method, device, equipment, medium and program product of prediction model
CN117725959A (en) Data updating method, device, electronic equipment and computer storage medium
CN116415624A (en) Model training method and device, and content recommendation method and device
CN117156191A (en) Interface display method, device, electronic equipment and computer readable storage medium
CN112035581A (en) Model-based task processing method, device, equipment and medium
CN117726917A (en) Model training method, device, electronic equipment and computer storage medium
CN109446501A (en) A kind of processing method of the network novel, device, terminal and computer storage medium
CN110147462A (en) The verification method and Related product of the short-sighted frequency of religion
CN113139490B (en) Image feature matching method and device, computer equipment and storage medium
CN117435564A (en) Image processing method, device, electronic equipment and computer storage medium
CN117407074A (en) Service execution method, device, electronic equipment and computer storage medium
CN116468589A (en) Image processing method, apparatus, electronic device, and computer-readable storage medium
CN117412182A (en) Image processing method, device, electronic equipment and computer storage medium
CN117407568A (en) Device processing method, device, computer device and computer readable storage medium
CN113996066A (en) Game application updating method and device, storage medium and computer 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