CN111126572A - Model parameter processing method and device, electronic equipment and storage medium - Google Patents

Model parameter processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111126572A
CN111126572A CN201911369292.5A CN201911369292A CN111126572A CN 111126572 A CN111126572 A CN 111126572A CN 201911369292 A CN201911369292 A CN 201911369292A CN 111126572 A CN111126572 A CN 111126572A
Authority
CN
China
Prior art keywords
model parameter
data
model
size
parameter group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911369292.5A
Other languages
Chinese (zh)
Other versions
CN111126572B (en
Inventor
陈可
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201911369292.5A priority Critical patent/CN111126572B/en
Publication of CN111126572A publication Critical patent/CN111126572A/en
Application granted granted Critical
Publication of CN111126572B publication Critical patent/CN111126572B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Neurology (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a model parameter processing method, a model parameter processing device, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence, wherein the method comprises the following steps: acquiring the sizes of different model parameter groups of a neural network model stored in a server and the data sizes corresponding to the model parameter groups; calculating the number of model parameter groups which can be stored in a storage space according to the size of the storage space for locally storing the model parameter groups and the size of the acquired model parameter groups, wherein the number of the model parameter groups is used as the parameter group number; and acquiring the parameter sets of the parameter sets from the server according to the data sizes corresponding to the model parameter sets. By applying the scheme provided by the embodiment of the invention to process the model parameters, the requirement of the storage model parameter group in the equipment on the storage space can be reduced.

Description

Model parameter processing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a model parameter processing method and device, electronic equipment and a storage medium.
Background
The neural network model is described by various model parameters, and different model parameter sets are formed when the model parameters take different values. Each model parameter group corresponds to one data size, that is, when the neural network model performs data processing based on each model parameter group, when processing data having a data size that is consistent with the data size corresponding to the model parameter group, a better processing effect can be obtained.
For example, when the data is an image, the data size may include: the resolution is 720 × 480, the resolution is 1920 × 1080, and the like, and since the two resolutions are different, two different sets of model parameters are required to correspond to the two resolutions, respectively.
In view of the above, when a neural network model is required to process data of a plurality of different sizes, in order to obtain a better processing effect, a plurality of sets of model parameters respectively corresponding to the different data sizes need to be manually set in a device for processing data. However, the storage space occupied by each model parameter set tends to be larger, and the storage space occupied by the plurality of sets of model parameter sets is larger. Therefore, the storage space occupied by various different model parameter sets is large, so that the storage space of devices such as mobile phones, tablet computers and image acquisition devices is limited, and the data processing by adopting a neural network model is difficult.
Disclosure of Invention
The embodiment of the invention aims to provide a model parameter processing method, a model parameter processing device, electronic equipment and a storage medium, so that the requirement of a storage model parameter set in the equipment on a storage space is reduced, and the equipment with limited storage space can also adopt a neural network model to process data. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a method for processing model parameters, where the method includes:
acquiring the sizes of different model parameter groups of a neural network model stored in a server and the data sizes corresponding to the model parameter groups;
calculating the number of model parameter groups which can be stored in a storage space according to the size of the storage space for locally storing the model parameter groups and the size of the acquired model parameter groups, and taking the number as the parameter group number;
and acquiring the parameter sets of the parameter sets from the server according to the data sizes corresponding to the parameter sets of the model.
In an embodiment of the present invention, the obtaining, from the server, the number of model parameter sets corresponding to each model parameter set includes:
determining the number of the parameter groups to be obtained according to the data size corresponding to each model parameter group according to any one of the following modes, and obtaining the determined model parameter groups to be obtained from the server:
acquiring the total quantity of different model parameter sets of a neural network model stored in a server, and determining the model parameter set to be acquired according to the total quantity and the parameter set quantity and the principle that the data size corresponding to the model parameter set to be acquired is uniformly distributed in the acquired data size;
determining the data size of the data to be processed in the application scene according to the processing requirement of the application scene, and determining the model parameter group to be obtained according to the data size of the data to be processed and the data size corresponding to each model parameter group.
In an embodiment of the present invention, after the obtaining, from the server, the number of model parameter sets corresponding to each model parameter set according to the data size, the method further includes:
determining a model parameter group to be updated under the condition of meeting the model parameter group updating condition;
determining a model parameter group which is locally stored and is not contained in the model parameter group to be updated, and deleting the determined parameter group from the local;
and determining the model parameter group which is not stored locally and is contained in the model parameter group to be updated, and acquiring the determined parameter group from the server.
In an embodiment of the present invention, the determining the set of model parameters to be updated includes:
obtaining the proportion of data with different data sizes in the processed data;
and selecting the proportion with the highest proportion and the number of the parameter groups from the obtained proportions, determining the data size of the data corresponding to the selected proportion, and taking the model parameter group corresponding to the determined data size as the model parameter group to be updated.
In an embodiment of the present invention, after obtaining sizes of different sets of model parameters of the neural network model stored in the server and data sizes corresponding to the respective sets of model parameters, the method further includes:
judging whether a model parameter group with the size smaller than the size of the storage space exists in the server or not according to the size of each model parameter group;
and if so, executing the step of calculating the number of the model parameter sets which can be stored in the storage space according to the size of the storage space locally used for storing the model parameter sets and the size of the acquired model parameter sets.
In an embodiment of the present invention, before the obtaining, from the server, the number of model parameter sets corresponding to each model parameter set according to the data size, the method further includes:
judging whether the parameter group quantity is larger than a preset parameter group quantity or not;
if so, setting the parameter group quantity as the preset parameter group quantity.
In an embodiment of the present invention, after the obtaining the model parameters of the parameter group number from a server according to the data size corresponding to each model parameter group, the method further includes:
acquiring data to be processed;
if a first model parameter group exists locally, processing the data to be processed by adopting the neural network model based on the first model parameter group, wherein the first model parameter group is as follows: a set of model parameters corresponding to a first size, the first size being: the data size of the data to be processed;
if the first model parameter group does not exist locally, determining a data size with the minimum difference with the first size in data sizes corresponding to the locally stored model parameter group, taking the data size as a second size, converting the data to be processed into data with the second size, and processing the converted data by adopting the neural network model based on the second model parameter group, wherein the second model parameter group is as follows: a set of model parameters corresponding to the second size.
In a second aspect, an embodiment of the present invention provides a model parameter processing apparatus, where the apparatus includes:
the information acquisition module is used for acquiring the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the model parameter groups;
the quantity calculation module is used for calculating the quantity of the model parameter groups which can be stored in the storage space according to the size of the storage space for locally storing the model parameter groups and the size of the acquired model parameter groups, and the quantity is used as the parameter group quantity;
and the first parameter group acquisition module is used for acquiring the parameter groups of the number of the parameter groups from the server according to the data sizes corresponding to the model parameter groups.
In an embodiment of the present invention, the first parameter group obtaining module is specifically configured to:
determining the number of the parameter groups to be obtained according to the data size corresponding to each model parameter group according to any one of the following modes, and obtaining the determined model parameter groups to be obtained from the server:
acquiring the total quantity of different model parameter sets of a neural network model stored in a server, and determining the model parameter set to be acquired according to the total quantity and the parameter set quantity and the principle that the data size corresponding to the model parameter set to be acquired is uniformly distributed in the acquired data size;
determining the data size of the data to be processed in the application scene according to the processing requirement of the application scene, and determining the model parameter group to be obtained according to the data size of the data to be processed and the data size corresponding to each model parameter group.
In one embodiment of the present invention, the apparatus further comprises:
a parameter set determining module, configured to determine a model parameter set to be updated when the first parameter set obtaining module obtains the number of model parameter sets from the server according to the data size corresponding to each model parameter set and meets a model parameter set updating condition;
the parameter group deleting module is used for determining a locally stored model parameter group which is not contained in the model parameter group to be updated, and deleting the determined parameter group from the local;
and the second parameter group acquisition module is used for determining the model parameter group which is not stored locally and is contained in the model parameter group to be updated, and acquiring the determined parameter group from the server.
In an embodiment of the present invention, the parameter set determining module is specifically configured to:
under the condition of meeting the updating condition of the model parameter group, acquiring the proportion of data with different data sizes in the processed data;
and selecting the proportion with the highest proportion and the number of the parameter groups from the obtained proportions, determining the data size of the data corresponding to the selected proportion, and taking the model parameter group corresponding to the determined data size as the model parameter group to be updated.
In one embodiment of the present invention, the apparatus further comprises:
and the size judging module is used for judging whether a model parameter group with the size smaller than the size of the storage space exists in the server or not according to the size of each model parameter group after the information acquiring module acquires the sizes of different model parameter groups of the neural network model stored in the server and the data size corresponding to each model parameter group, and if so, the quantity calculating module is triggered.
In one embodiment of the present invention, the apparatus further comprises:
a quantity judging module, configured to judge whether the number of parameter groups is greater than a preset number of parameter groups before the first parameter group obtaining module obtains the number of parameter groups from the server according to the data size corresponding to each model parameter group;
and the quantity setting module is used for setting the parameter group quantity as the preset parameter group quantity if the judgment result of the quantity judging module is positive.
In one embodiment of the present invention, the apparatus further comprises:
the data acquisition module is used for acquiring the data to be processed after the first parameter group acquisition module acquires the model parameters of the parameter group quantity from a server according to the data size corresponding to each model parameter group;
a first data processing module, configured to process, if a first model parameter group locally exists, the to-be-processed data by using the neural network model based on the first model parameter group, where the first model parameter group is: a set of model parameters corresponding to a first size, the first size being: the data size of the data to be processed;
a second data processing module, configured to determine, if the first model parameter group does not exist locally, a data size with a minimum difference from the first size in data sizes corresponding to a locally stored model parameter group, as a second size, convert the data to be processed into data of the second size, and process the converted data by using the neural network model based on the second model parameter group, where the second model parameter group is: a set of model parameters corresponding to the second size.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps of any one of the above first aspects.
In a fifth aspect, embodiments of the present invention also provide a computer program product comprising instructions, which when run on a computer, cause the computer to perform the method steps of any of the first aspects described above.
The embodiment of the invention has the following beneficial effects:
when the scheme provided by the embodiment of the invention is applied to processing the model parameters, the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the model parameter groups are obtained. And calculating the number of the model parameter groups which can be stored in the storage space as the parameter group number according to the size of the storage space locally used for storing the model parameter groups and the size of the acquired model parameter groups. And acquiring the parameter sets from the server according to the data sizes corresponding to the parameter sets. Compared with the method of locally storing all the model parameter sets corresponding to the data sizes, the method provided by the embodiment of the invention can adaptively acquire part of the model parameter sets from the server according to the size of the storage space locally used for storing the model parameter sets, thereby reducing the requirement of the storage model parameter sets in the equipment on the storage space, and enabling the equipment with limited storage space to also adopt the neural network model for data processing.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a first model parameter processing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a second model parameter processing method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a third method for processing model parameters according to an embodiment of the present invention;
FIG. 4 is a schematic flowchart of a fourth model parameter processing method according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of a fifth method for processing model parameters according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of a sixth model parameter processing method according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of a first model parameter processing apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a second model parameter processing apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic structural diagram of a third model parameter processing apparatus according to an embodiment of the present invention;
FIG. 10 is a schematic structural diagram of a fourth model parameter processing apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a fifth model parameter processing apparatus according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problem that in the prior art, when a model parameter set of a neural network model is stored in a device, the requirement on storage space is high, and the device with limited storage space is difficult to adopt the neural network model for data processing, embodiments of the present invention provide a model parameter processing method and apparatus, an electronic device, and a storage medium.
In an embodiment of the present invention, a method for processing model parameters is provided, where the method includes:
the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the model parameter groups are obtained.
And calculating the number of the model parameter groups which can be stored in the storage space as the parameter group number according to the size of the storage space locally used for storing the model parameter groups and the size of the acquired model parameter groups.
And acquiring the parameter sets from the server according to the data sizes corresponding to the parameter sets.
As can be seen from the above, compared with the case that all model parameter sets corresponding to each data size are stored locally, in the scheme provided by the embodiment of the present invention, a part of the model parameter sets can be obtained from the server in a self-adaptive manner according to the size of the storage space used for storing the model parameter sets locally, so that the requirement of the storage model parameter set in the device on the storage space is reduced, and thus the device with limited storage space can also perform data processing by using the neural network model.
The following describes a model parameter processing method, a model parameter processing apparatus, an electronic device, and a storage medium according to embodiments of the present invention.
Fig. 1 is a schematic flow chart of a first model parameter processing method according to an embodiment of the present invention, specifically, the method includes the following steps S101 to S103.
S101: the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the model parameter groups are obtained.
Specifically, the structure of the neural network model can be described by network topology data, and the parameters of each layer in the neural network model can be described by model parameter data. Wherein the size of the network topology data is small, such as 100KB, 200KB, etc., and the size of the model parameter data is large, such as 200MB, 500MB, etc. The model parameter data therefore requires a high amount of memory. The network topology data may be stored in a network topology file and the model parameter data may be stored in a model parameter file.
In addition, since a plurality of model parameters are included in one neural network model, the model parameters may take different values in different applications, and data formed when each model parameter takes a different value may be grouped into a model parameter group for convenience of description. One model parameter set corresponds to one data size.
Specifically, the neural network model may have a plurality of model parameter sets.
In view of the above, the server may store a plurality of model parameter sets of the neural network model, each model parameter set corresponding to a different data size, so that the user equipment may process data with different data sizes locally at the user equipment by acquiring different model parameter sets.
Specifically, the data size corresponding to the model parameter set may be understood as: when data is processed using a neural network model based on the set of model parameters, the size of the data with the best processing effect can be obtained.
For example, in the case where the data is an image, the data size may be a resolution of the image, such as a resolution of 720 × 480, a resolution of 1920 × 1080, or the like. In this case, when the data size corresponding to the model parameter group is 1920x1080 resolution, it is described that the best processing effect can be obtained when processing an image with 1920x1080 resolution when processing data using the neural network model based on the above model parameter group.
In the case where the data is audio data, the data size may be a duration of the audio data, e.g., 1 minute, 2 minutes, or the like. In this case, when the data size corresponding to the model parameter group is 1 minute in audio data duration, it is described that the best processing effect can be obtained for audio data having a processing duration of 1 minute when the data is processed using the neural network model based on the above model parameter group.
In addition, the sizes of the respective sets of model parameters may be the same as or different from each other. Under the condition that the sizes of all model parameter groups are the same, the sizes of all the model parameter groups can be obtained only by obtaining the size of one model parameter group, and under the condition that the sizes of all the model parameter groups are different, the sizes of all the model parameter groups are required to be obtained.
In an embodiment of the present invention, the local query interface is invoked, and the local query interface communicates with the query interface of the server, so as to obtain, from the query interface of the server, sizes of different model parameter sets of the neural network model stored in the server and data sizes corresponding to the model parameter sets.
Wherein, the local query interface is: and the local interface is an interface in communication connection with a preset inquiry interface of the server.
S102: and calculating the number of the model parameter groups which can be stored in the storage space as the parameter group number according to the size of the storage space locally used for storing the model parameter groups and the size of the acquired model parameter groups.
Specifically, the size of the storage space may be a preset size of the storage space, and may be, for example, 800MB, 1G, 2G, or 50% or 70% of the size of the local total storage space. The size of the storage space for the local non-stored data may be dynamically corresponding to 50%, 100%, etc.
In an embodiment of the present invention, in the case that the size of the model parameter set is the same, the number of the parameter sets may be calculated by dividing the size of the storage space by the size of the model parameter set. When the size of the model parameter group is different, the different model parameter group combinations may be combined into a model parameter group combination, the size of the model parameter group combination may be calculated, and the number of the parameter groups may be determined by comparing the size of the model parameter group combination with the size of the storage space.
For example, when the storage space is a predetermined storage space, if the size of the predetermined storage space is 800MB, the number of parameter sets is 4 when the sizes of the model parameter sets are all 200 MB. When the sizes of the model parameter sets are 300MB, 400MB, and 500MB, respectively, the storage space stores a maximum of 2 model parameter sets of 300MB and 400MB, or 2 model parameter sets of 300MB and 500MB, and the number of the parameter sets is 2.
S103: and acquiring the parameter sets from the server according to the data sizes corresponding to the parameter sets.
Specifically, the model parameter set of the neural network model stored in the server can be acquired from the download interface of the server by calling the local download interface and communicating with the download interface of the server through the local download interface.
Wherein, the local download interface is: and the local interface is an interface in communication connection with a preset downloading interface of the server.
In an embodiment of the present invention, the number of the parameter sets to be acquired may be determined according to a data size corresponding to each model parameter set according to any one of the following steps a and B, and the determined model parameter sets to be acquired may be acquired from the server:
step A: acquiring the total quantity of different model parameter sets of a neural network model stored in a server, and determining the model parameter sets to be acquired according to the total quantity and the parameter set quantity and the principle that the data sizes corresponding to the model parameter sets to be acquired are uniformly distributed in the acquired data sizes.
The total number of different model parameter sets of the neural network model stored in the server can be obtained from the query interface of the server by calling the local query interface and communicating with the query interface of the server through the local query interface.
In an embodiment of the present invention, when determining the data size corresponding to the model parameter set to be obtained from the obtained data sizes according to the principle of uniform distribution, the data size corresponding to the model parameter set to be obtained may be determined from the obtained data sizes at equal intervals when the obtained data sizes are arranged in the order from large to small or from small to large.
For example, if 5 model parameter sets are stored in the server, the data sizes corresponding to the model parameter sets are arranged from large to small as follows: the method comprises the steps of determining the data size 1, the data size 2, the data size 3, the data size 4 and the data size 5, and if the number of parameter groups is 3, determining the data size 1, the data size 3 and the data size 5 as the data size corresponding to the model parameter group to be obtained.
By the mode, the mode of the model parameter group to be acquired is determined according to the principle that the data sizes corresponding to the model parameter group to be acquired are uniformly distributed in the acquired data sizes, so that the acquired model parameter group can provide better processing effect for data of various data sizes as far as possible.
And B: determining the data size of the data to be processed in the application scene according to the processing requirement of the application scene, and determining the model parameter group to be obtained according to the data size of the data to be processed and the data size corresponding to each model parameter group.
The application scenario is a scenario where the user equipment performs data processing, and the processing requirement is a requirement for processing data of different data sizes in the application scenario.
Specifically, the processing requirement may be a processing requirement set by a user, for example, the model parameter group to be acquired includes at least the model parameter group 2 corresponding to the data size 2, or the model parameter group 4 corresponding to the data size 4 cannot be included.
The processing requirements may also be: what data size data needs to be processed in the application scenario. For example, it is necessary to process an image with a resolution of 720 × 576, an image with a resolution of 1920 × 1080, or the like.
On this basis, the set of model parameters to be obtained, which is determined according to the processing requirements of the application scenario, may be: and at least one model parameter group corresponding to the data size with the highest processing probability in the processed data.
For example, if the data size of the data processed in the application scenario is arranged from high to low according to the processing probability: data size 2, data size 1, data size 3, data size 5, and data size 4, and if the number of parameter groups is 2, then the model parameter group 2 corresponding to the data size 2 and the model parameter group 1 corresponding to the data size 1 are determined as the model parameter groups to be acquired.
Through the mode, the model parameter group to be obtained is determined according to the processing requirement of the application scene, so that the obtained model parameter group corresponds to the application scene, and the best processing effect on the data to be processed corresponding to the application scene is obtained.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the respective model parameter groups are obtained. And calculating the number of the model parameter groups which can be stored in the storage space as the parameter group number according to the size of the storage space locally used for storing the model parameter groups and the size of the acquired model parameter groups. And acquiring the parameter sets from the server according to the data sizes corresponding to the parameter sets. Compared with the method of locally storing all the model parameter sets corresponding to the data sizes, the method provided by the embodiment of the invention can adaptively acquire part of the model parameter sets from the server according to the size of the storage space locally used for storing the model parameter sets, thereby reducing the requirement of the storage model parameter sets in the equipment on the storage space, and enabling the equipment with limited storage space to also adopt the neural network model for data processing.
Since the processing requirements may change during the data processing, in order to obtain a better data processing effect, the locally stored model parameter set needs to be updated, and the updated model parameter set corresponds to different data sizes, so as to meet different processing requirements.
In an embodiment of the present invention, referring to fig. 2, a schematic flow chart of a second model parameter processing method is provided, and compared with the foregoing embodiment shown in fig. 1, after step S103, the embodiment of the present invention further includes:
s104: and under the condition that the model parameter group updating condition is met, determining the model parameter group to be updated.
The model parameter group to be updated is a model parameter group expected to exist locally when the model parameter group is updated at this time.
Specifically, the update condition may be: updating the model parameter set every time a preset time length elapses, for example, the preset time length may be: 1 hour, 1 day, 2 weeks, etc.
The update condition may be: the model parameter set is updated once every time the data amount processed by the device reaches a preset data amount, for example, the preset data amount may be 1000 pieces of data, 10000 pieces of data, and the like.
In one example of the present invention, the model parameter set to be updated may be determined through the following steps C to D.
And C: and obtaining the proportion of the data with different data sizes in the processed data.
The proportion of the data with different data sizes to the total amount of the processed data can be obtained by calculating the proportion of the number of the data with each data size to the total amount of the processed data.
For example, if the processed data is 1000 pieces, the data size 1 has 500 pieces, the data size 2 has 300 pieces, and the data size 3 has 200 pieces, the proportion of the data size 1 is 50%, the proportion of the data size 2 is 30%, and the proportion of the data size 3 is 20%.
Step D: and selecting the proportion with the highest proportion and the number of the parameter groups from the obtained proportions, determining the data size of the data corresponding to the selected proportion, and taking the model parameter group corresponding to the determined data size as the model parameter group to be updated.
By the method, the selected model parameter group to be updated corresponds to the data size with the highest proportion, the processing requirement of the data with the data size with the highest proportion can be met, and a better processing effect is achieved.
For example, if the number of parameter groups is 2, the data size of the data corresponding to the 2 highest ratios is selected: data size 1 and data size 2, and the model parameter group 1 corresponding to the data size 1 and the model parameter group 2 corresponding to the data size 2 are set as the model parameter group to be updated.
In addition, besides the steps C to D, the set of model parameters to be updated may also be determined according to a preset requirement of a user.
For example, the user preset requirement may be: the model parameter set to be updated at least includes the model parameter set 1, or cannot include the model parameter set 3, and so on.
Besides the steps C to D and determining the parameter set of the model to be updated according to the preset requirements of the user, the method of the steps C to D may be used to determine other parameter sets of the model to be updated on the basis of meeting the preset requirements of the user.
For example, the user preset requirement may be: the model parameter set to be updated at least includes the model parameter set 3. Meanwhile, the processed data has a data size 1 accounting for 50%, a data size 2 accounting for 30%, and a data size 3 accounting for 20%.
If the number of the parameter groups is 2, determining the model parameter group 3 as a model parameter group to be updated so as to meet the preset requirement of a user, and on the basis, determining the model parameter group 1 corresponding to the data size 1 with the highest proportion as another model parameter group to be updated.
S105: determining the model parameter group which is stored locally and is not included in the model parameter group to be updated, and deleting the determined parameter group from the local.
The model parameter set that is locally stored and is not included in the model parameter set to be updated is a model parameter set that does not match the processing requirement in the current updating process, and therefore the parameter set needs to be deleted locally.
For example, if the model parameter group 1 and the model parameter group 2 are stored locally, and the model parameter group to be updated is the model parameter group 2 and the model parameter group 4, the model parameter group 1 is deleted locally.
S106: and determining the model parameter group which is not stored locally and is contained in the model parameter group to be updated, and acquiring the determined parameter group from the server.
The model parameter set that is not locally stored and is included in the model parameter set to be updated is a model parameter set that matches the processing requirement in the current updating process but is not locally stored, so the parameter set needs to be acquired from the server.
For example, the model parameter group 1 and the model parameter group 2 are locally stored, and if the model parameter group to be updated is the model parameter group 2 and the model parameter group 4, the model parameter group 4 is acquired from the server.
As can be seen from the above, the scheme provided in the embodiment of the present invention updates the locally stored model parameter set, and the method can provide the corresponding model parameter set for the data to be processed again according to the update condition and the data processing requirement, and under the condition that the size of the storage space is fixed, the data processing requirements under different conditions can be met to the greatest extent, so as to achieve a better processing effect.
In an embodiment of the present invention, referring to fig. 3, a flowchart of a third model parameter processing method is provided, and compared with the foregoing embodiment shown in fig. 1, after step S101, the method in the embodiment of the present invention further includes:
s107: it is determined whether a model parameter group having a size smaller than the size of the storage space exists in the server based on the size of each model parameter group, and if so, the step S102 is executed.
Specifically, the size of each model parameter group may be compared with the size of the storage space in sequence, and if a model parameter group having a size smaller than the size of the storage space is found, the comparison process may be ended, which indicates that there is a model parameter group having a size smaller than the size of the storage space. Therefore, it is described that the storage space can store at least one model parameter group, and the subsequent steps can be continued, and if the size of each model parameter group is larger than that of the storage space, it is described that the storage space cannot store any one model parameter group, and the subsequent steps are not performed.
For example, if the size of the storage space is 200MB, the sizes of the 3 model parameter sets in the server are 300MB, and 400MB, respectively. The server does not have a model parameter set whose size is smaller than the size of the storage space, and thus the storage space cannot store any model parameter set.
As can be seen from the above, only when the local storage space can store at least one model parameter group, the embodiment of the present invention continues to perform the subsequent steps, and when the local storage space cannot store any model parameter group, the subsequent steps are not performed, thereby reducing the calculation process and reducing the occupation and consumption of the calculation resources.
In an embodiment of the present invention, referring to fig. 4, a schematic flow chart of a fourth model parameter processing method is provided, and compared with the foregoing embodiment shown in fig. 1, before step S103, the embodiment of the present invention further includes:
s108: and judging whether the parameter group quantity is larger than a preset parameter group quantity.
The number of the preset parameter sets may be the maximum number of the acquired model parameter sets set by the user, and may be, for example, 3, 5, and the like.
S109: if the determination result in the step S108 is yes, the parameter group number is set as the preset parameter group number.
Specifically, if the determination result is yes, it is determined that the number of model parameter sets that can be accommodated in the local storage space is greater than the preset parameter set number, and the parameter set number is set as the preset parameter set number, so as to obtain the model parameter set by the preset parameter set number.
As can be seen from the above, when the number of the model parameter sets that can be accommodated by the local storage space is greater than the number of the preset parameter sets, the model parameter sets are obtained by the number of the preset parameter sets, so that the number of the actually obtained model parameter sets can be controlled by setting the number of the preset parameter sets, thereby reducing the occupation of the local storage space.
In an embodiment of the present invention, referring to fig. 5, a schematic flow chart of a fifth model parameter processing method is provided, and compared with the foregoing embodiment shown in fig. 1, after step S103, the embodiment of the present invention further includes:
s110: and acquiring data to be processed.
S111: and if the first model parameter group exists locally, processing the data to be processed by adopting the neural network model based on the first model parameter group.
Wherein, the first model parameter group is: a set of model parameters corresponding to a first size, the first size being: the data size of the data to be processed.
Specifically, since the first model parameter group corresponds to the first size, the best processing effect can be obtained by selecting the neural network model based on the first model parameter group to process the data to be processed.
For example, if the data size of the data to be processed is data size 1 and a model parameter group 1 corresponding to the data size 1 exists locally, the data to be processed is processed using the above neural network model based on the model parameter group 1.
S112: and if the first model parameter group does not exist locally, determining a data size with the minimum difference with the first size in the data sizes corresponding to the locally stored model parameter group, converting the data to be processed into the data with the second size as a second size, and processing the converted data by adopting the neural network model based on the second model parameter group.
Wherein the second model parameter set is: a set of model parameters corresponding to the second size.
Because the model parameter group corresponding to the second size does not exist locally, the second model parameter group with the smallest difference between the corresponding data size and the second size is selected, the neural network model based on the second model parameter group is adopted to process the data to be processed, and a better processing effect is achieved under the condition that the model parameter group corresponding to the second size does not exist.
Specifically, the data size of the data to be processed may be converted into the second size by using the same data value to perform padding or scaling.
For example, when the data is an image, the second size having the smallest difference from the first size may be a data size having the smallest difference from the length size of the first size, a data size having the smallest difference from the width size of the first size, or a data size having the smallest difference from the ratio of the length to the width size of the first size.
As can be seen from the above, when the local storage space cannot store the model parameter sets corresponding to all the data sizes, and when the model parameter sets corresponding to the data sizes of the model to be processed are stored locally, the neural network model based on the corresponding model parameter sets is used to process the data to be processed. And under the condition that the model parameter group corresponding to the data size of the model to be processed is not locally stored, selecting the model parameter group with the minimum difference between the corresponding data size in the stored model parameter group and the data size of the data to be processed, and processing the data to be processed by using the neural network model based on the selected model parameter group. Because the neural network model based on the model parameter group corresponding to the data size of the model to be processed can achieve the best processing effect, when the neural network model corresponding to the data size of the data to be processed does not exist, the error of data processing performed by the neural network model based on the model parameter group with the minimum difference is the minimum, and therefore, under the condition that the number of the model parameter groups stored in the local storage space is limited, the better data processing effect can be achieved by using the scheme.
Next, a model parameter processing method provided by an embodiment of the present invention is described by way of specific examples with reference to fig. 6.
Fig. 6 is a flowchart illustrating a sixth model parameter processing method according to an embodiment of the present invention.
S601: the device acquires model parameter group information from a server, wherein the server comprises 3 model parameter groups, the 3 model parameter groups are respectively a model parameter group 1 corresponding to a data size 1, a model parameter group 2 corresponding to a data size 2 and a model parameter group 3 corresponding to a data size 3, the size of each of the 3 model parameter groups is 400MB, and the data sizes are arranged from large to small as the data size 1, the data size 2 and the data size 3.
S602: and judging whether a model parameter group with the size smaller than the size of the storage space exists or not.
If the size of the storage space is 300MB and is smaller than the size of each model parameter group of 400MB, the local storage space cannot accommodate any model parameter group, and a prompt message of insufficient storage space is sent to the user.
If the size of the storage space is 1GB, it indicates that the size of the storage space is larger than the size of the model parameter group, and the local storage space can accommodate at least 1 model parameter group.
S603: and continuously calculating the number of the model parameter sets which can be stored in the storage space as the parameter set number. In this example, the number of parameter groups is 2.
S604: and judging whether the parameter group quantity is smaller than the preset parameter group quantity set by the user.
If the number of the preset parameter groups is 4, it is indicated that the number 2 of the model parameter groups that can be accommodated by the storage space is less than the maximum number 4 required by the user, and then information that the storage space cannot store the maximum number of the model parameter groups required by the user is sent to the user.
If the number of preset parameter sets is 2, it indicates that the number 2 of model parameter sets that the storage space can accommodate is equal to the maximum number 2 required by the user.
S605: and obtaining the model parameter group from the server according to the preset parameter group quantity 2, for example, obtaining the model parameter group 1 and the model parameter group 3 according to a uniform distribution principle.
S606: after the model parameter group is obtained, the data to be processed can be processed.
S607: and counting the proportion of the data with different data sizes in the processed data, wherein the proportion of the data with the data size 1 is 50%, the proportion of the data with the data size 2 is 40%, and the proportion of the data with the data size 3 is 10%.
The data size with the highest obtained ratio is selected, and since the number of parameter groups is 2, the data size 1 and the data size 2 are selected.
The model parameter group 1 corresponding to the selected data size 1 and the model parameter group 2 corresponding to the data size 2 are set as the model parameter group to be updated.
The step S605 of obtaining the model parameter group is re-executed, thereby implementing a process of cyclically updating the locally stored model parameter group. Since the model parameter group 1 and the model parameter group 3 are stored locally and the parameter groups to be updated are the model parameter group 1 and the model parameter group 2, the local model parameter group 3 is deleted and the model parameter group 2 is acquired from the server.
Corresponding to the model parameter processing method, the embodiment of the invention also provides a model parameter processing device.
Fig. 7 is a schematic structural diagram of a first model parameter processing apparatus according to an embodiment of the present invention, specifically, the apparatus includes:
an information obtaining module 701, configured to obtain sizes of different model parameter groups of the neural network model stored in the server and data sizes corresponding to the model parameter groups;
a quantity calculating module 702, configured to calculate, as a parameter group quantity, a quantity of model parameter groups that can be stored in a storage space according to the size of the storage space locally used for storing the model parameter groups and the size of the obtained model parameter groups;
a first parameter set obtaining module 703, configured to obtain, from the server, the number of parameter sets according to the data size corresponding to each model parameter set.
In an embodiment of the present invention, the first parameter group obtaining module 703 is specifically configured to:
determining the number of the parameter groups to be obtained according to the data size corresponding to each model parameter group according to any one of the following modes, and obtaining the determined model parameter groups to be obtained from the server:
acquiring the total number of different model parameter sets of a neural network model stored in a server, and determining the model parameter sets to be acquired according to the total number and the parameter set number and the principle that the data sizes corresponding to the model parameter sets to be acquired are uniformly distributed in the acquired data sizes;
determining the data size of the data to be processed in the application scene according to the processing requirement of the application scene, and determining the model parameter group to be obtained according to the data size of the data to be processed and the data size corresponding to each model parameter group.
As can be seen from the above, in the solution provided in the embodiment of the present invention, the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the respective model parameter groups are obtained. And calculating the number of the model parameter groups which can be stored in the storage space as the parameter group number according to the size of the storage space locally used for storing the model parameter groups and the size of the acquired model parameter groups. And acquiring the parameter sets from the server according to the data sizes corresponding to the parameter sets. Compared with the method of locally storing all the model parameter sets corresponding to the data sizes, the method provided by the embodiment of the invention can adaptively acquire part of the model parameter sets from the server according to the size of the storage space locally used for storing the model parameter sets, thereby reducing the requirement of the storage model parameter sets in the equipment on the storage space, and enabling the equipment with limited storage space to also adopt the neural network model for data processing.
In an embodiment of the present invention, referring to fig. 8, which is a schematic structural diagram of a second model parameter processing apparatus provided in the present invention, the apparatus further includes:
a parameter set determining module 704, configured to determine a to-be-updated model parameter set when the first parameter set obtaining module 703 obtains the number of model parameter sets from the server according to the data size corresponding to each model parameter set and then meets a model parameter set updating condition;
a parameter group deleting module 705, configured to determine a locally stored model parameter group that is not included in the model parameter group to be updated, and delete the determined parameter group from the local;
the second parameter set obtaining module 706 is configured to determine a model parameter set that is not locally stored and is included in the model parameter set to be updated, and obtain the determined parameter set from the server.
In an embodiment of the present invention, the parameter set determining module 704 is specifically configured to:
under the condition of meeting the updating condition of the model parameter group, acquiring the proportion of data with different data sizes in the processed data;
and selecting the proportion with the highest proportion and the number of the parameter groups from the obtained proportions, determining the data size of the data corresponding to the selected proportion, and taking the model parameter group corresponding to the determined data size as the model parameter group to be updated.
As can be seen from the above, the scheme provided in the embodiment of the present invention updates the locally stored model parameter set, and the method can provide the corresponding model parameter set for the data to be processed again according to the update condition and the data processing requirement, and under the condition that the size of the storage space is fixed, the data processing requirements under different conditions can be met to the greatest extent, so as to achieve a better processing effect.
In an embodiment of the present invention, referring to fig. 9, a schematic structural diagram of a third model parameter processing apparatus provided in the present invention is shown, where the apparatus further includes:
a size determining module 707, configured to, after the information obtaining module 701 obtains the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the model parameter groups, determine whether a model parameter group with a size smaller than the size of the storage space exists in the server according to the size of each model parameter group, and if the model parameter group exists, trigger the quantity calculating module 702.
As can be seen from the above, only when the local storage space can store at least one model parameter group, the embodiment of the present invention continues to perform the subsequent steps, and when the local storage space cannot store any model parameter group, the subsequent steps are not performed, thereby reducing the calculation process and reducing the occupation and consumption of the calculation resources.
In an embodiment of the present invention, referring to fig. 10, a schematic structural diagram of a fourth model parameter processing apparatus provided in the present invention is shown, where the apparatus further includes:
a quantity determining module 708, configured to determine whether the number of parameter groups is greater than a preset number of parameter groups before the first parameter group obtaining module 703 obtains the number of parameter groups of model parameter groups from the server according to the data size corresponding to each model parameter group;
a quantity setting module 709, configured to set the parameter group quantity as the preset parameter group quantity if the determination result of the quantity determining module 708 is yes.
As can be seen from the above, when the number of the model parameter sets that can be accommodated by the local storage space is greater than the number of the preset parameter sets, the model parameter sets are obtained by the number of the preset parameter sets, so that the number of the actually obtained model parameter sets can be controlled by setting the number of the preset parameter sets, thereby reducing the occupation of the local storage space.
In an embodiment of the present invention, referring to fig. 11, a schematic structural diagram of a fifth model parameter processing apparatus provided in the present invention is shown, where the apparatus further includes:
a data obtaining module 710, configured to obtain to-be-processed data after the first parameter group obtaining module 703 obtains the model parameters of the parameter group number from a server according to the data size corresponding to each model parameter group;
a first data processing module 711, configured to process the to-be-processed data by using the neural network model based on a first model parameter group if the first model parameter group locally exists, where the first model parameter group is: a set of model parameters corresponding to a first size, the first size being: the data size of the data to be processed;
a second data processing module 712, configured to determine, if the first model parameter group does not exist locally, a data size with a minimum difference from the first size in data sizes corresponding to a locally stored model parameter group, as a second size, convert the data to be processed into data of the second size, and process the converted data by using the neural network model based on the second model parameter group, where the second model parameter group is: a set of model parameters corresponding to the second size.
As can be seen from the above, when the local storage space cannot store the model parameter sets corresponding to all the data sizes, and when the model parameter sets corresponding to the data sizes of the model to be processed are stored locally, the neural network model based on the corresponding model parameter sets is used to process the data to be processed. And under the condition that the model parameter group corresponding to the data size of the model to be processed is not locally stored, selecting the model parameter group with the minimum difference between the corresponding data size in the stored model parameter group and the data size of the data to be processed, and processing the data to be processed by using the neural network model based on the selected model parameter group. Because the neural network model based on the model parameter group corresponding to the data size of the model to be processed can achieve the best processing effect, when the neural network model corresponding to the data size of the data to be processed does not exist, the error of data processing performed by the neural network model based on the model parameter group with the minimum difference is the minimum, and therefore, under the condition that the number of the model parameter groups stored in the local storage space is limited, the better data processing effect can be achieved by using the scheme.
Corresponding to the above model parameter processing method, an embodiment of the present invention further provides an electronic device, as shown in fig. 12, including a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204, where the processor 1201, the communication interface 1202, and the memory 1203 complete mutual communication through the communication bus 1204,
a memory 1203 for storing a computer program;
the processor 1201 is configured to implement the method steps of any of the above embodiments of the model parameter processing method when executing the program stored in the memory 1203.
When the electronic equipment provided by the embodiment of the invention is applied to model parameter processing, the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the model parameter groups are obtained. And calculating the number of the model parameter groups which can be stored in the storage space as the parameter group number according to the size of the storage space locally used for storing the model parameter groups and the size of the acquired model parameter groups. And acquiring the parameter sets from the server according to the data sizes corresponding to the parameter sets. Compared with the method of locally storing all the model parameter sets corresponding to the data sizes, the method provided by the embodiment of the invention can adaptively acquire part of the model parameter sets from the server according to the size of the storage space locally used for storing the model parameter sets, thereby reducing the requirement of the storage model parameter sets in the equipment on the storage space, and enabling the equipment with limited storage space to also adopt the neural network model for data processing.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In accordance with the model parameter processing method, in another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program is executed by a processor to implement the method steps of any of the above-mentioned model parameter processing method embodiments.
When executing model parameter processing by applying a computer program stored in a computer-readable storage medium provided by an embodiment of the present invention, the size of different model parameter groups of a neural network model stored in a server and the data size corresponding to each model parameter group are obtained. And calculating the number of the model parameter groups which can be stored in the storage space as the parameter group number according to the size of the storage space locally used for storing the model parameter groups and the size of the acquired model parameter groups. And acquiring the parameter sets from the server according to the data sizes corresponding to the parameter sets. Compared with the method of locally storing all the model parameter sets corresponding to the data sizes, the method provided by the embodiment of the invention can adaptively acquire part of the model parameter sets from the server according to the size of the storage space locally used for storing the model parameter sets, thereby reducing the requirement of the storage model parameter sets in the equipment on the storage space, and enabling the equipment with limited storage space to also adopt the neural network model for data processing.
In accordance with the model parameter processing method described above, in yet another embodiment of the present invention, there is provided a computer program product comprising instructions which, when executed on a computer, cause the computer to perform the method steps described in any of the model parameter processing methods described above.
When the computer program product provided by the embodiment of the invention is executed to perform model parameter processing, the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the model parameter groups are obtained. And calculating the number of the model parameter groups which can be stored in the storage space as the parameter group number according to the size of the storage space locally used for storing the model parameter groups and the size of the acquired model parameter groups. And acquiring the parameter sets from the server according to the data sizes corresponding to the parameter sets. Compared with the method of locally storing all the model parameter sets corresponding to the data sizes, the method provided by the embodiment of the invention can adaptively acquire part of the model parameter sets from the server according to the size of the storage space locally used for storing the model parameter sets, thereby reducing the requirement of the storage model parameter sets in the equipment on the storage space, and enabling the equipment with limited storage space to also adopt the neural network model for data processing.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus, the electronic device, the computer-readable storage medium and the computer program product, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to them, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (13)

1. A method of model parameter processing, the method comprising:
acquiring the sizes of different model parameter groups of a neural network model stored in a server and the data sizes corresponding to the model parameter groups;
calculating the number of model parameter groups which can be stored in a storage space according to the size of the storage space for locally storing the model parameter groups and the size of the acquired model parameter groups, and taking the number as the parameter group number;
and acquiring the parameter sets of the parameter sets from the server according to the data sizes corresponding to the parameter sets of the model.
2. The method of claim 1, wherein the obtaining the number of model parameter sets from the server according to the data size corresponding to each model parameter set comprises:
determining the number of the parameter groups to be obtained according to the data size corresponding to each model parameter group according to any one of the following modes, and obtaining the determined model parameter groups to be obtained from the server:
acquiring the total quantity of different model parameter sets of a neural network model stored in a server, and determining the model parameter set to be acquired according to the total quantity and the parameter set quantity and the principle that the data size corresponding to the model parameter set to be acquired is uniformly distributed in the acquired data size;
determining the data size of the data to be processed in the application scene according to the processing requirement of the application scene, and determining the model parameter group to be obtained according to the data size of the data to be processed and the data size corresponding to each model parameter group.
3. The method according to claim 1, wherein after obtaining the number of model parameter sets from the server according to the data size corresponding to each model parameter set, the method further comprises:
determining a model parameter group to be updated under the condition of meeting the model parameter group updating condition;
determining a model parameter group which is locally stored and is not contained in the model parameter group to be updated, and deleting the determined parameter group from the local;
and determining the model parameter group which is not stored locally and is contained in the model parameter group to be updated, and acquiring the determined parameter group from the server.
4. The method of claim 3, wherein determining the set of model parameters to be updated comprises:
obtaining the proportion of data with different data sizes in the processed data;
and selecting the proportion with the highest proportion and the number of the parameter groups from the obtained proportions, determining the data size of the data corresponding to the selected proportion, and taking the model parameter group corresponding to the determined data size as the model parameter group to be updated.
5. The method according to any one of claims 1 to 4, further comprising, after obtaining the sizes of the different sets of model parameters of the neural network model stored in the server and the data sizes corresponding to the respective sets of model parameters:
judging whether a model parameter group with the size smaller than the size of the storage space exists in the server or not according to the size of each model parameter group;
and if so, executing the step of calculating the number of the model parameter sets which can be stored in the storage space according to the size of the storage space locally used for storing the model parameter sets and the size of the acquired model parameter sets.
6. The method according to any one of claims 1-4, wherein before said obtaining the number of model parameter sets from the server according to the data size corresponding to each model parameter set, further comprising:
judging whether the parameter group quantity is larger than a preset parameter group quantity or not;
if so, setting the parameter group quantity as the preset parameter group quantity.
7. The method according to any one of claims 1-4, further comprising, after obtaining the number of parameter sets of the model parameters from a server according to the data size corresponding to each parameter set of the model parameters, the steps of:
acquiring data to be processed;
if a first model parameter group exists locally, processing the data to be processed by adopting the neural network model based on the first model parameter group, wherein the first model parameter group is as follows: a set of model parameters corresponding to a first size, the first size being: the data size of the data to be processed;
if the first model parameter group does not exist locally, determining a data size with the minimum difference with the first size in data sizes corresponding to the locally stored model parameter group, taking the data size as a second size, converting the data to be processed into data with the second size, and processing the converted data by adopting the neural network model based on the second model parameter group, wherein the second model parameter group is as follows: a set of model parameters corresponding to the second size.
8. A model parameter processing apparatus, characterized in that the apparatus comprises:
the information acquisition module is used for acquiring the sizes of different model parameter groups of the neural network model stored in the server and the data sizes corresponding to the model parameter groups;
the quantity calculation module is used for calculating the quantity of the model parameter groups which can be stored in the storage space according to the size of the storage space for locally storing the model parameter groups and the size of the acquired model parameter groups, and the quantity is used as the parameter group quantity;
and the first parameter group acquisition module is used for acquiring the parameter groups of the number of the parameter groups from the server according to the data sizes corresponding to the model parameter groups.
9. The apparatus of claim 8, wherein the first parameter set obtaining module is specifically configured to:
determining the number of the parameter groups to be obtained according to the data size corresponding to each model parameter group according to any one of the following modes, and obtaining the determined model parameter groups to be obtained from the server:
acquiring the total quantity of different model parameter sets of a neural network model stored in a server, and determining the model parameter set to be acquired according to the total quantity and the parameter set quantity and the principle that the data size corresponding to the model parameter set to be acquired is uniformly distributed in the acquired data size;
determining the data size of the data to be processed in the application scene according to the processing requirement of the application scene, and determining the model parameter group to be obtained according to the data size of the data to be processed and the data size corresponding to each model parameter group.
10. The apparatus of claim 8, further comprising:
a parameter set determining module, configured to determine a model parameter set to be updated when the first parameter set obtaining module obtains the number of model parameter sets from the server according to the data size corresponding to each model parameter set and meets a model parameter set updating condition;
the parameter group deleting module is used for determining a locally stored model parameter group which is not contained in the model parameter group to be updated, and deleting the determined parameter group from the local;
and the second parameter group acquisition module is used for determining the model parameter group which is not stored locally and is contained in the model parameter group to be updated, and acquiring the determined parameter group from the server.
11. The apparatus according to any one of claims 8-10, further comprising:
the data acquisition module is used for acquiring data to be processed after the first parameter group acquisition module acquires the model parameters of the parameter group quantity from a server;
a first data processing module, configured to process, if a first model parameter group locally exists, the to-be-processed data by using the neural network model based on the first model parameter group, where the first model parameter group is: a set of model parameters corresponding to a first size, the first size being: the data size of the data to be processed;
a second data processing module, configured to determine, if the first model parameter group does not exist locally, a data size with a minimum difference from the first size in data sizes corresponding to a locally stored model parameter group, as a second size, convert the data to be processed into data of the second size, and process the converted data by using the neural network model based on the second model parameter group, where the second model parameter group is: a set of model parameters corresponding to the second size.
12. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
13. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN201911369292.5A 2019-12-26 2019-12-26 Model parameter processing method and device, electronic equipment and storage medium Active CN111126572B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911369292.5A CN111126572B (en) 2019-12-26 2019-12-26 Model parameter processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911369292.5A CN111126572B (en) 2019-12-26 2019-12-26 Model parameter processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111126572A true CN111126572A (en) 2020-05-08
CN111126572B CN111126572B (en) 2023-12-08

Family

ID=70503362

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911369292.5A Active CN111126572B (en) 2019-12-26 2019-12-26 Model parameter processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111126572B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114938365A (en) * 2022-03-18 2022-08-23 青岛海尔科技有限公司 Method and device for updating functional module, storage medium and electronic device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777998A (en) * 2014-01-20 2014-05-07 北京仿真中心 Efficient calling method of combined model component
CN104391723A (en) * 2014-12-03 2015-03-04 山东中创软件工程股份有限公司 Model packaging and arranging method and device
CN107103113A (en) * 2017-03-23 2017-08-29 中国科学院计算技术研究所 Towards the Automation Design method, device and the optimization method of neural network processor
CN108932124A (en) * 2018-06-26 2018-12-04 Oppo广东移动通信有限公司 neural network model compression method, device, terminal device and storage medium
WO2018233141A1 (en) * 2017-06-24 2018-12-27 平安科技(深圳)有限公司 Data communication processing terminal and method and computer readable storage medium
CN109508485A (en) * 2018-10-30 2019-03-22 平安医疗健康管理股份有限公司 A kind of data processing model dissemination method, device, server and storage medium
CN110188795A (en) * 2019-04-24 2019-08-30 华为技术有限公司 Image classification method, data processing method and device
US20190324809A1 (en) * 2018-04-20 2019-10-24 EMC IP Holding Company LLC Method, apparatus, and computer program product for processing computing task
CN110490316A (en) * 2019-08-21 2019-11-22 腾讯科技(深圳)有限公司 Based on the training managing method of neural network model training system, training system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103777998A (en) * 2014-01-20 2014-05-07 北京仿真中心 Efficient calling method of combined model component
CN104391723A (en) * 2014-12-03 2015-03-04 山东中创软件工程股份有限公司 Model packaging and arranging method and device
CN107103113A (en) * 2017-03-23 2017-08-29 中国科学院计算技术研究所 Towards the Automation Design method, device and the optimization method of neural network processor
WO2018233141A1 (en) * 2017-06-24 2018-12-27 平安科技(深圳)有限公司 Data communication processing terminal and method and computer readable storage medium
US20190324809A1 (en) * 2018-04-20 2019-10-24 EMC IP Holding Company LLC Method, apparatus, and computer program product for processing computing task
CN108932124A (en) * 2018-06-26 2018-12-04 Oppo广东移动通信有限公司 neural network model compression method, device, terminal device and storage medium
CN109508485A (en) * 2018-10-30 2019-03-22 平安医疗健康管理股份有限公司 A kind of data processing model dissemination method, device, server and storage medium
CN110188795A (en) * 2019-04-24 2019-08-30 华为技术有限公司 Image classification method, data processing method and device
CN110490316A (en) * 2019-08-21 2019-11-22 腾讯科技(深圳)有限公司 Based on the training managing method of neural network model training system, training system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
钟雨等: "大数据系统开发中的构件自动选型与参数配置", 计算机科学与探索, no. 09 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114938365A (en) * 2022-03-18 2022-08-23 青岛海尔科技有限公司 Method and device for updating functional module, storage medium and electronic device

Also Published As

Publication number Publication date
CN111126572B (en) 2023-12-08

Similar Documents

Publication Publication Date Title
CN110012217B (en) Method and device for determining acquisition resolution and electronic equipment
KR101871383B1 (en) Method and system for using a recursive event listener on a node in hierarchical data structure
CN113364853B (en) Business service system, business request method and gateway equipment
CN107566857B (en) Video downloading method, device, system, server and terminal
CN110944220B (en) Video screen projection playing method, device, equipment and system
CN110099112B (en) Data storage method, device, medium and terminal equipment based on point-to-point network
CN112685709B (en) Authorization token management method and device, storage medium and electronic equipment
CN108156257B (en) Information pushing method and device
CN110620681A (en) Network connection timeout time setting method, device, equipment and medium
WO2023168856A1 (en) Associated scene recommendation method and device, storage medium, and electronic device
CN112069195A (en) Database-based message transmission method and device, electronic equipment and storage medium
CN111126572B (en) Model parameter processing method and device, electronic equipment and storage medium
CN103563298A (en) Method and system for managing contact information in universal plug and play home network environment
CN108874876B (en) Message pushing method, computer readable storage medium and terminal equipment
CN111355765A (en) Network request processing and sending method and device
CN111131375B (en) Interface service acquisition method, device, computer equipment and storage medium
CN115080156B (en) Flow-batch-integration-based optimized calculation method and device for big data batch calculation
CN111309693A (en) Data synchronization method, device and system, electronic equipment and storage medium
CN107665135B (en) Upgrading program pushing method and device
CN107766086B (en) Function option display method and device, electronic equipment and readable storage medium
CN113779412B (en) Message touch method, node and system based on blockchain network
CN111400327B (en) Data synchronization method and device, electronic equipment and storage medium
CN107688951B (en) Information pushing method and device
CN113064801B (en) Data point burying method and device, readable storage medium and computer equipment
CN111949110B (en) Processing method and device for minimizing energy consumption in mobile edge calculation

Legal Events

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