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

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

Info

Publication number
CN108053034A
CN108053034A CN201810001153.6A CN201810001153A CN108053034A CN 108053034 A CN108053034 A CN 108053034A CN 201810001153 A CN201810001153 A CN 201810001153A CN 108053034 A CN108053034 A CN 108053034A
Authority
CN
China
Prior art keywords
parameter
model
compressed
model parameter
compression
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
CN201810001153.6A
Other languages
Chinese (zh)
Other versions
CN108053034B (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.)
Shanghai Chun Kui Information Technology Co ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810001153.6A priority Critical patent/CN108053034B/en
Publication of CN108053034A publication Critical patent/CN108053034A/en
Application granted granted Critical
Publication of CN108053034B publication Critical patent/CN108053034B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

An embodiment of the present invention provides a kind of model parameter processing method, device, electronic equipment and storage mediums.Wherein, the described method includes the corresponding parameter sets to be compressed of the pending model are obtained, the parameter sets to be compressed include multiple model parameters, according to the model parameter in the parameter sets to be compressed, determine Compression Strategies.Again by each model parameter in the parameter sets to be compressed, processing is compressed according to the Compression Strategies, obtains the storage parameter of data type corresponding with the Compression Strategies.It is realized by this programme and Compression Strategies is neatly selected according to the concrete condition of model parameter, to reduce the size of model, realization is simple and efficient the corresponding data type of conversion model parameters.Meanwhile cause model parameter distortion by the way that applicable Compression Strategies is selected to avoid compression process.

Description

Model parameter processing method, device, electronic equipment and storage medium
Technical field
The present invention relates to machine learning techniques field, in particular to a kind of model parameter processing method, device, electricity Sub- equipment and storage medium.
Background technology
Machine learning (Machine Learning, ML) is a multi-field cross discipline, be related to probability theory, statistics, The multi-door subjects such as Approximation Theory, convextiry analysis, algorithm complexity theory.It is the core of artificial intelligence, is that electronic equipment is made to have intelligence The fundamental way of energy, application is throughout the every field of artificial intelligence.
Machine learning algorithm is the core of machine learning.And the accuracy of machine learning algorithm is joined depending on corresponding model Number.Model parameter is obtained by substantial amounts of sample training, and quantity is more, and shared memory space is also big.If machine learning model is disposed In server-side, then influence of the size of model to server is little.If machine learning model is deployed in mobile terminal, such as Android phone or iphone mobile phones, then the size of model is affected to mobile terminal performance, can also directly affect User experience.And then limit the application of machine learning on mobile terminals.
The content of the invention
It is an object of the invention to provide a kind of model parameter processing method, device, electronic equipment and storage medium, to Solve the problem of that the size of model when machine learning model is applied to electronic equipment has an impact electronic equipment.
To achieve these goals, the technical solution that the embodiment of the present invention uses is as follows:
In a first aspect, an embodiment of the present invention provides a kind of model parameter processing method, the described method includes:According to waiting to locate Model is managed, obtains the corresponding parameter sets to be compressed of the pending model, the parameter sets to be compressed include multiple models Parameter;According to the model parameter in the parameter sets to be compressed, Compression Strategies are determined;It will be in the parameter sets to be compressed Each model parameter is compressed processing according to the Compression Strategies, obtains data class corresponding with the Compression Strategies The storage parameter of type.
Second aspect, an embodiment of the present invention provides a kind of model parameter processing unit, described device includes:Obtain mould Block, for according to pending model, obtaining the corresponding parameter sets to be compressed of the pending model, the parameter set to be compressed Conjunction includes multiple model parameters;Determining module, for according to the model parameter in the parameter sets to be compressed, determining compression plan Slightly;Compression module, for by each model parameter in the parameter sets to be compressed, being carried out according to the Compression Strategies Compression is handled, and obtains the storage parameter of data type corresponding with the Compression Strategies.
The third aspect, an embodiment of the present invention provides a kind of electronic equipment, the electronic equipment includes:Memory;Processing Device;And model parameter processing unit, the model parameter processing unit are stored in the memory and including one or more A software function module performed by the processor, including:Acquisition module, for according to pending model, described in acquisition The corresponding parameter sets to be compressed of pending model, the parameter sets to be compressed include multiple model parameters;Determining module is used According to the model parameter in the parameter sets to be compressed, Compression Strategies are determined;Compression module, for by the ginseng to be compressed Each model parameter in manifold conjunction is compressed processing according to the Compression Strategies, obtains and the Compression Strategies pair The storage parameter for the data type answered.
Fourth aspect, an embodiment of the present invention provides a kind of storage mediums, are stored thereon with computer program, the computer Model parameter processing method described above is realized when program is executed by processor.
Compared with prior art, model parameter processing side provided by the invention is corresponded to by obtaining the pending model Parameter sets to be compressed, recycle and treated according to the Compression Strategies that the model parameter in parameter sets to be compressed determines by described Each model parameter in compression parameter sets is compressed processing, obtains data type corresponding with the Compression Strategies Storage parameter.So as to which by neatly selecting Compression Strategies according to the concrete condition of model parameter, conversion model parameters correspond to Data type to reduce the size of model, realization is simple and efficient.Meanwhile by the way that applicable Compression Strategies is selected to avoid compression Process causes model parameter distortion.Overcome the limitation that machine learning model is applied to mobile electronic equipment.
For the above objects, features and advantages of the present invention is enable to be clearer and more comprehensible, preferred embodiment cited below particularly, and coordinate Appended attached drawing, is described in detail below.
Description of the drawings
It in order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached Figure is briefly described, it should be understood that the following drawings illustrates only certain embodiments of the present invention, therefore is not construed as pair The restriction of scope, for those of ordinary skill in the art, without creative efforts, can also be according to this A little attached drawings obtain other relevant attached drawings.
Fig. 1 is the block diagram for the electronic equipment that present pre-ferred embodiments provide.
Fig. 2 shows model parameter process flow figure provided in an embodiment of the present invention.
Fig. 3 is the sub-step flow chart of step S101 in Fig. 2.
Fig. 4 shows another part of model parameter process flow figure provided in an embodiment of the present invention.
Fig. 5 shows the block diagram of model parameter processing unit provided in an embodiment of the present invention.
Icon:100- electronic equipments;101- memories;102- storage controls;103- processors;At 200- model parameters Manage device;201- acquisition modules;202- determining modules;203- compression modules.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Ground describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.Usually exist The component of the embodiment of the present invention described and illustrated in attached drawing can configure to arrange and design with a variety of herein.Cause This, the detailed description of the embodiment of the present invention to providing in the accompanying drawings is not intended to limit claimed invention below Scope, but it is merely representative of the selected embodiment of the present invention.Based on the embodiment of the present invention, those skilled in the art are not doing Go out all other embodiments obtained on the premise of creative work, belong to the scope of protection of the invention.
Machine learning is the important step of artificial intelligence, and application is very extensive.In correlation technique, have mobile terminal There is machine learning functionality, it is necessary to which a machine learning initial model is first selected to be trained the corresponding a large amount of model parameters of acquisition, then Machine learning model with a large amount of model parameters is stored in mobile terminal.In machine learning function in use, passing through tune It is realized with corresponding model parameter.Typically, the precision that machine learning function is realized depends on model parameter, preferable machine The corresponding model parameter quantity of device learning functionality is huge.In order to ensure model parameter can be by normal use, above-mentioned model ginseng Number is needed for float real-coded GAs.But byte shared by single float real-coded GAs is four bytes, therefore, preferable machine Memory space shared by device learning functionality is bigger, when being stored in mobile terminal, system resource is occupied greatly, directly affects user Experience, is unfavorable for applying in mobile terminal.Therefore, the embodiment of the present invention provides a kind of model parameter processing method, device, electricity Sub- terminal and storage medium, to overcome the limitation that machine learning function is applied in the terminal.
Fig. 1 shows the block diagram for the electronic equipment 100 that present pre-ferred embodiments provide.Electronic equipment 100 is preferred For mobile terminal device, such as smart mobile phone, tablet computer, pocket computer on knee, vehicle-mounted computer, a number can be included Word assistant (personal digital assistant, PDA), wearable mobile terminal etc..The electronic equipment 100 includes Model parameter processing unit 200, memory 101, storage control 102, processor 103.
The memory 101, storage control 102,103 each element of processor directly or indirectly electrically connect between each other It connects, to realize the transmission of data or interaction.For example, these elements can pass through one or more communication bus or signal between each other Line, which is realized, to be electrically connected.The model parameter processing unit 200 include it is at least one can be with software or firmware (firmware) Form be stored in the memory 101 or be solidificated in the electronic equipment 100 operating system (operating system, OS the software function module in).The processor 103 is used to perform the executable module stored in memory 101, such as described The software function module or computer program that model parameter processing unit 200 includes.
Wherein, memory 101 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), Electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc.. Wherein, memory 101 is for storing program, and the processor 103 performs described program, this hair after receiving and executing instruction Method performed by the server for the flow definition that bright any embodiment discloses can be applied in processor 103 or by Reason device 103 is realized.
Processor 103 can be a kind of IC chip, have signal handling capacity.Above-mentioned processor 103 can be with It is general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP), speech processor and video processor etc.;Can also be digital signal processor, application-specific integrated circuit, Field programmable gate array either other programmable logic device, discrete gate or transistor logic, discrete hardware components. It can realize or perform disclosed each method, step and the logic diagram in the embodiment of the present invention.General processor can be Microprocessor or the processor 103 can also be any conventional processors etc..
First embodiment
It please refers to Fig.2, Fig. 2 is a kind of step flow for model parameter processing method that present pre-ferred embodiments provide Figure.The method may include following steps:
Step S101 according to pending model, obtains the corresponding parameter sets to be compressed of the pending model.
Above-mentioned pending model can carry out the model parameter file generated after machine learning functional training.Above-mentioned model Parameter File can include multiple model parameters.
For better compression effectiveness, above-mentioned pending model can be by the model of model pruning modes after training.
In embodiments of the present invention, above-mentioned parameter sets to be compressed are model parameter collection corresponding with pending model.On It can be a set or multiple set to state parameter sets to be compressed.Include at least in each parameter sets to be compressed The corresponding model parameter of two pending models.As a kind of embodiment, as shown in figure 3, obtaining the pending model pair The step of parameter sets to be compressed answered, can include:
Sub-step S1011 obtains the first model parameter of parameter values maximum in the corresponding model parameter of pending model And the second model parameter of parameter values minimum.
In embodiments of the present invention, the corresponding model parameter of pending model is sequentially placed into array, using inquiry language The parameter values that sentence obtains the first model parameter and the second model parameter degree is less than.
As a kind of embodiment, following query statement may be employed:
F_max=A [0];
F_min=A [0];
For (inti=0;i<n;++i)
{
If(f_max<A[i])
{
F_max=A [i];
}
Else if(f_min>A[i])
{
F_min=A [i];
}
}
Above-mentioned f_max represents the parameter values of the first model parameter, will be arranged in primary model in array first The parameter values of parameter assign f_max, by f_max successively compared with the parameter values of each model parameter in array. When occurring being more than the f_max model parameters, the model parameter is changed to by the value of f_max, continues to repeat to compare, until The comparison with the last one model parameter in array is completed, with the parameter values of the value of f_max the first model parameter the most.On The parameter values that f_min represents the second model parameter are stated, first by the parameter for being arranged in primary model parameter in array Numerical value assigns f_min, by f_min successively compared with the parameter values of each model parameter in array.When being less than During the f_min model parameters, the value of f_min is changed to the model parameter, continues to repeat to compare, until in completion and array The comparison of the last one model parameter, with the parameter values of the value of f_min the second model parameter the most.
Sub-step S1012, when the difference between the difference between above-mentioned first model parameter and the second model parameter is more than During default first threshold, piecemeal is carried out to the pending model according to pre-defined rule, to obtain pending submodel.
In the present embodiment, above-mentioned pending submodule can be a part for pending module, by pending module pair The model parameter answered is divided into multiple parameters matrix.By division, to ensure that the model included by each pending submodule is joined Difference in number between the model parameter of the model parameter of parameter values maximum and parameter values minimum is less than first threshold.
As a kind of embodiment, above-mentioned first threshold can be 63335.
Sub-step S1013 is based respectively on the corresponding model parameter of each pending submodel and establishes a corresponding institute State parameter sets to be compressed.
In embodiments of the present invention, established respectively according to the corresponding model parameter of each pending submodel and corresponding wait to press Contracting parameter sets, to obtain multiple parameter sets to be compressed.It should be noted that parameter values in each parameter sets to be compressed Difference between the 3rd maximum model parameter and the 4th model parameter of parameter values minimum is respectively less than first threshold.When waiting to locate When managing model and only corresponding to a parameter sets to be compressed, then corresponding 3rd model parameter of the parameter sets to be compressed is to wait to locate Corresponding first model parameter of model is managed, corresponding 4th model parameter of the parameter sets to be compressed is that pending model corresponds to The second model parameter.
Sub-step S1014, when the difference between first model parameter and the second model parameter is no more than described first During threshold value, the corresponding parameter sets to be compressed are established based on the corresponding model parameter of the pending model.
In embodiments of the present invention, coordination is belonged between sub-step S1014 and step S1012, there is no absolute Sequencing.When the difference between first model parameter and the second model parameter is no more than the first threshold, then directly It connects and establishes a parameter sets to be compressed with the corresponding all model parameters of pending model.
, can be excessive to avoid the difference between model parameter by above-mentioned steps in the present embodiment, cause compressed mould Shape parameter distortion.
Step S102 according to the model parameter in the parameter sets to be compressed, determines Compression Strategies.
Above-mentioned Compression Strategies can include the first strategy and the second strategy.
Above-mentioned first strategy is used to be converted to the model parameter storage parameter of no character type.Above-mentioned no character type Data only account for a byte, therefore, can be by master mould compression of parameters to a quarter using the second strategy.Specifically, select Each model parameter is mapped as the depositing without character type less than pre-set second threshold by default corresponding mapping function Store up data.
Above-mentioned second strategy is used to be converted to the model parameter storage data of short.The data of above-mentioned short Two bytes are accounted for, it therefore, can be by master mould compression of parameters to half using the second strategy.Specifically, select default Each model parameter is mapped as the storage data of the short less than pre-set first threshold by corresponding mapping function.
As a kind of embodiment, corresponding 3rd model parameter of the parameter sets to be compressed and the 4th mould can be obtained Shape parameter.It should be noted that model of the 3rd model parameter for parameter values maximum in the parameter sets to be compressed Parameter, the 4th model parameter are the model parameter of parameter values minimum in the parameter sets to be compressed.Further according to described 3rd model parameter and the 4th model parameter determine the corresponding Compression Strategies.Optionally, according to the 3rd model parameter And the 4th model parameter, determining the mode of the corresponding Compression Strategies can be:When the 3rd model parameter and the 4th mould When difference between shape parameter is less than default second threshold, it is determined that the corresponding Compression Strategies are the first plan pre-seted Slightly;When the difference between the 3rd model parameter and the 4th model parameter is more than default second threshold, it is determined that corresponding The Compression Strategies be pre-set second strategy.Above-mentioned second threshold can be 255.Above-mentioned first strategy and the second strategy Each correspond to a mapping function.The mapping parameters of above-mentioned mapping function can be according to the parameter sets to be compressed corresponding Three model parameters and the 4th model parameter determine.
Different pressures is used for different parameter sets to be compressed by the cooperation of step S101 and step S102 Contracting strategy, had both ensured that model parameter was undistorted, and can also accomplish the compression of optimum efficiency.
Step S103, by each model parameter in the parameter sets to be compressed, according to the Compression Strategies into Row compression is handled, and obtains the storage parameter of data type corresponding with the Compression Strategies.
In the embodiment of the present invention, the parameter values of each model parameter in the parameter sets to be compressed are first utilized into correspondence The mapping functions of Compression Strategies handled, then will treated that parameter values are stored with the corresponding data type of Compression Strategies In electronic equipment 100, to obtain storage parameter.Optionally, when the Compression Strategies are tactful for described first, successively by institute It states each model parameter in parameter sets to be compressed and is mapped as the depositing without character type that numerical value is less than the second threshold Store up data.When the Compression Strategies are tactful for described second, successively by each mould in the parameter sets to be compressed Shape parameter is mapped as storage data of the numerical value less than the short of the first threshold.
Exemplified by using the first strategy and linear mapping function, first by corresponding 3rd model parameter of parameter sets to be compressed Parameter values be mapped as 255, the parameter values of corresponding 4th model parameter are mapped as 0, recycle the Linear Mapping letter Other model parameters in parameter sets to be compressed are mapped between 0-255 by number successively.As a kind of embodiment, it is assumed that linear Mapping function is:
Y=kx+b,
X is taken into the 3rd model parameter respectively and y takes that 255 and x takes the 4th model parameter and y takes 0 to bring into state mapping relations In, to obtain the value of k and b, above-mentioned k is corresponding mapping parameters with b,
K=255/ (f_max-f_min),
B=f_min*255/ (f_min-f_max),
Above-mentioned f_max is the parameter values of corresponding 3rd model parameter, and above-mentioned f_min is the ginseng of corresponding 4th model parameter Number numerical value.The value of k and b is preserved with float floating types again.X is taken to the model in parameter sets to be compressed successively again The parameter values of parameter are the parameter values after the corresponding mapping of model parameter to obtain the value of corresponding y.It will be to be compressed Parameter values after the corresponding mapping of each model parameter of parameter sets carry out being stored in electronics in the form of no character type data In equipment 100, to obtain corresponding storage parameter.
Using the separate same as described above of the second strategy, difference lies in correspond to corresponding 3rd model parameter for the two Parameter values be mapped as first threshold, and the numerical value of other model parameters in parameter sets to be compressed is subjected to mapping processing and is It after the parameter values of first threshold, is stored in electronic equipment 100 with short data, is joined with obtaining corresponding storage Number.
The compression to model can be efficiently realized by above-mentioned steps and is stored in electronic equipment 100.Avoid mould Influence of the type size to 100 performance of electronic equipment.When needing using the model, as shown in figure 4, the method further includes:
Step S201 is called when detecting a storage parameter in the pending model, obtains and be called Store the corresponding Compression Strategies of parameter.
In embodiments of the present invention, can by judging the data type belonging to the storage parameter of the calling, then The corresponding Compression Strategies of the storage parameter of the calling are determined according to the data type.
Step S202 obtains decompression strategy according to the Compression Strategies.
In embodiments of the present invention, can corresponding inverse function be obtained according to the corresponding mapping function of Compression Strategies, and with The inverse function is as decompression strategy.Specifically, the mapping parameters that mapping function is obtained by inquiring about are obtained, and according to mapping parameters Obtain inverse function.Example is connected, can inverse function be obtained according to the value of the k preserved, the value of b and corresponding mapping function.
The called storage parameter is carried out decompression processing, with acquisition pair by step S203 using the decompression strategy The available model parameter answered.
In embodiments of the present invention, at can be using numerical value of the corresponding inverse function of decompression strategy to storing parameter Reason, the numerical value of the model parameter after being decompressed with generation, and stored with real-coded GA, so as to the identifiable model parameter quilt of model It calls.So that it is guaranteed that the machine learning function can be used normally.The numerical value of model parameter after decompression with before corresponding compression Model parameter it is basically identical.In other embodiments, after calling, determine that the model parameter of the floating type does not use It afterwards, can be with the model parameter of the corresponding deletion floating type.
Fig. 5 shown with a kind of corresponding model parameter processing unit 200 of the above method, the details side in following apparatus Case is referred to the above method to realize, described device is applied in electronic equipment 100.Model parameter processing includes:
Acquisition module 201, for according to pending model, obtaining the corresponding parameter set to be compressed of the pending model It closes, the parameter sets to be compressed include multiple model parameters.
Determining module 202, for according to the model parameter in the parameter sets to be compressed, determining Compression Strategies.
Compression module 203, for by each model parameter in the parameter sets to be compressed, according to the compression Strategy is compressed processing, obtains the storage parameter of data type corresponding with the Compression Strategies.
The embodiment of the present invention further discloses a kind of storage medium, is stored thereon with computer program, the computer program The model parameter processing method that present invention discloses is realized when being performed by processor 103.
To be situated between in conclusion an embodiment of the present invention provides a kind of model parameter processing method, device, electronic equipment and storages Matter.The method is applied to the electronic equipment, the method may include according to pending model, obtains the pending mould The corresponding parameter sets to be compressed of type, the parameter sets to be compressed include multiple model parameters;According to the parameter to be compressed Model parameter in set, determines Compression Strategies;By each model parameter in the parameter sets to be compressed, according to institute It states Compression Strategies and is compressed processing, obtain the storage parameter of data type corresponding with the Compression Strategies.So as to pass through root Compression Strategies are neatly selected according to the concrete condition of model parameter, and the corresponding data type of conversion model parameters is to reduce model Size, realization are simple and efficient.Meanwhile cause model parameter distortion by the way that applicable Compression Strategies is selected to avoid compression process.
In several embodiments provided herein, it should be understood that disclosed apparatus and method can also pass through Other modes are realized.The apparatus embodiments described above are merely exemplary, for example, flow chart and block diagram in attached drawing Show the devices of multiple embodiments according to the present invention, method and computer program product architectural framework in the cards, Function and operation.In this regard, each box in flow chart or block diagram can represent the one of a module, program segment or code Part, a part for the module, program segment or code include one or more and are used to implement holding for defined logic function Row instruction.It should also be noted that at some as in the realization method replaced, the function that is marked in box can also be to be different from The order marked in attached drawing occurs.For example, two continuous boxes can essentially perform substantially in parallel, they are sometimes It can perform in the opposite order, this is depending on involved function.It is it is also noted that every in block diagram and/or flow chart The combination of a box and the box in block diagram and/or flow chart can use function or the dedicated base of action as defined in performing It realizes or can be realized with the combination of specialized hardware and computer instruction in the system of hardware.
In addition, each function module in each embodiment of the present invention can integrate to form an independent portion Point or modules individualism, can also two or more modules be integrated to form an independent part.
If the function is realized in the form of software function module and is independent production marketing or in use, can be with It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words The part contribute to the prior art or the part of the technical solution can be embodied in the form of software product, the meter Calculation machine software product is stored in a storage medium, is used including some instructions so that a computer equipment (can be People's computer, server or network equipment etc.) perform all or part of the steps of the method according to each embodiment of the present invention. And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to Non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those Element, but also including other elements that are not explicitly listed or further include as this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that Also there are other identical elements in process, method, article or equipment including the element.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the invention, for the skill of this field For art personnel, the invention may be variously modified and varied.Within the spirit and principles of the invention, that is made any repaiies Change, equivalent substitution, improvement etc., should all be included in the protection scope of the present invention.It should be noted that:Similar label and letter exists Similar terms is represented in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, is then not required in subsequent attached drawing It is further defined and is explained.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in change or replacement, should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention described should be subject to the protection scope in claims.

Claims (10)

1. a kind of model parameter processing method, which is characterized in that the described method includes:
According to pending model, the corresponding parameter sets to be compressed of the pending model, the parameter sets to be compressed are obtained Including multiple model parameters;
According to the model parameter in the parameter sets to be compressed, Compression Strategies are determined;
By each model parameter in the parameter sets to be compressed, processing is compressed according to the Compression Strategies, is obtained Obtain the storage parameter of data type corresponding with the Compression Strategies.
2. the method as described in claim 1, which is characterized in that it is described according to pending model, obtain corresponding ginseng to be compressed The step of manifold is closed includes:
Obtain the first model parameter and parameter number of parameter values maximum in the corresponding model parameter of the pending model It is worth the second minimum model parameter;
When the difference between first model parameter and the second model parameter is more than default first threshold, according to pre- set pattern Piecemeal then is carried out to the pending model, to obtain pending submodel;
It is based respectively on the corresponding model parameter of each pending submodel and establishes the corresponding parameter sets to be compressed;
When the difference between first model parameter and the second model parameter is no more than the first threshold, treated based on described The corresponding model parameter of processing model establishes the corresponding parameter sets to be compressed.
3. method as claimed in claim 2, which is characterized in that according to the model parameter in the parameter sets to be compressed, really The step of determining Compression Strategies includes:
Corresponding 3rd model parameter of the parameter sets to be compressed and the 4th model parameter are obtained, the 3rd model parameter is The model parameter of parameter values maximum in the parameter sets to be compressed, the 4th model parameter are the parameter set to be compressed The model parameter of parameter values minimum in conjunction;
According to the 3rd model parameter and the 4th model parameter, the corresponding Compression Strategies are determined.
4. method as claimed in claim 3, which is characterized in that according to the 3rd model parameter and the 4th model parameter, really The step of fixed corresponding Compression Strategies, includes:
When the difference between the 3rd model parameter and the 4th model parameter is less than default second threshold, it is determined that corresponding The Compression Strategies be the first strategy pre-seted, first strategy is used to the model parameter being converted to no character type Storage data;
When the difference between the 3rd model parameter and the 4th model parameter is more than default second threshold, it is determined that corresponding The Compression Strategies be the second strategy pre-seted, second strategy is used to the model parameter being converted to short Store data.
5. method as claimed in claim 4, which is characterized in that join each model in the parameter sets to be compressed The step of number, is handled according to the Compression Strategies, the storage parameter of acquisition data type corresponding with the Compression Strategies Including:
When the Compression Strategies are tactful for described first, each model in the parameter sets to be compressed is joined successively Number is mapped as the storage data without character type that numerical value is less than the second threshold;
When the Compression Strategies are tactful for described second, each model in the parameter sets to be compressed is joined successively Number is mapped as storage data of the numerical value less than the short of the first threshold.
6. the method as described in claim 1, which is characterized in that the method further includes:
It is called, obtains corresponding with the storage parameter being called when detecting a storage parameter in the pending model The Compression Strategies;
Decompression strategy is obtained according to the Compression Strategies;
The called storage parameter is subjected to decompression processing using the decompression strategy, is joined with obtaining corresponding available model Number.
7. method as claimed in claim 6, which is characterized in that obtain the compression plan corresponding with called storage parameter Slightly include:
Judge the data type belonging to the storage parameter of the calling;
The corresponding Compression Strategies of the storage parameter of the calling are determined according to the data type.
8. a kind of model parameter processing unit, which is characterized in that described device includes:
Acquisition module, it is described to treat for according to pending model, obtaining the corresponding parameter sets to be compressed of the pending model Compression parameter sets include multiple model parameters;
Determining module, for according to the model parameter in the parameter sets to be compressed, determining Compression Strategies;
Compression module, for by each model parameter in the parameter sets to be compressed, according to the Compression Strategies into Row compression is handled, and obtains the storage parameter of data type corresponding with the Compression Strategies.
9. a kind of electronic equipment, which is characterized in that the electronic equipment includes:
Memory;
Processor;And
Model parameter processing unit, the model parameter processing unit be stored in the memory and including it is one or more by The software function module that the processor performs, including:
Acquisition module, it is described to treat for according to pending model, obtaining the corresponding parameter sets to be compressed of the pending model Compression parameter sets include multiple model parameters;
Determining module, for according to the model parameter in the parameter sets to be compressed, determining Compression Strategies;
Compression module, for by each model parameter in the parameter sets to be compressed, according to the Compression Strategies into Row compression is handled, and obtains the storage parameter of data type corresponding with the Compression Strategies.
10. a kind of storage medium, is stored thereon with computer program, which is characterized in that the computer program is executed by processor Methods of the Shi Shixian as any one of claim 1-7.
CN201810001153.6A 2018-01-02 2018-01-02 Model parameter processing method and device, electronic equipment and storage medium Active CN108053034B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810001153.6A CN108053034B (en) 2018-01-02 2018-01-02 Model parameter processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810001153.6A CN108053034B (en) 2018-01-02 2018-01-02 Model parameter processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108053034A true CN108053034A (en) 2018-05-18
CN108053034B CN108053034B (en) 2020-10-16

Family

ID=62126179

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810001153.6A Active CN108053034B (en) 2018-01-02 2018-01-02 Model parameter processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108053034B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110991643A (en) * 2019-12-25 2020-04-10 北京奇艺世纪科技有限公司 Model deployment method and device, electronic equipment and storage medium
CN111680799A (en) * 2020-04-08 2020-09-18 北京字节跳动网络技术有限公司 Method and apparatus for processing model parameters
CN112035401A (en) * 2019-06-03 2020-12-04 北京京东尚科信息技术有限公司 Model data processing method and device, electronic equipment and readable medium
EP3945471A1 (en) 2020-07-28 2022-02-02 Siemens Aktiengesellschaft Method for automated determination of a model compression technique for compression of an artificial intelligence-based model

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101416511A (en) * 2006-04-07 2009-04-22 微软公司 Quantization adjustments for DC shift artifacts
US20110085735A1 (en) * 2009-10-09 2011-04-14 Xerox Corporation Edge detection for mixed raster content (mrc) images for improved compression and image quality
CN105763855A (en) * 2016-04-22 2016-07-13 微景天下(北京)科技有限公司 Image transmission system and image transmission method
CN106485316A (en) * 2016-10-31 2017-03-08 北京百度网讯科技有限公司 Neural network model compression method and device
CN106936439A (en) * 2016-09-20 2017-07-07 南开大学 It is a kind of general based on the compression preprocess method of block sorting thought and application
CN107341763A (en) * 2017-06-30 2017-11-10 北京金山安全软件有限公司 Image processing method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101416511A (en) * 2006-04-07 2009-04-22 微软公司 Quantization adjustments for DC shift artifacts
US20110085735A1 (en) * 2009-10-09 2011-04-14 Xerox Corporation Edge detection for mixed raster content (mrc) images for improved compression and image quality
CN105763855A (en) * 2016-04-22 2016-07-13 微景天下(北京)科技有限公司 Image transmission system and image transmission method
CN106936439A (en) * 2016-09-20 2017-07-07 南开大学 It is a kind of general based on the compression preprocess method of block sorting thought and application
CN106485316A (en) * 2016-10-31 2017-03-08 北京百度网讯科技有限公司 Neural network model compression method and device
CN107341763A (en) * 2017-06-30 2017-11-10 北京金山安全软件有限公司 Image processing method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GOGS等: "Improvedandextendedlocatingfunctionalityoncompressedsuffixarrays", 《JOURNALOFDISCRETEALGORITHMS》 *
王蓉芳等: "利用纹理信息的图像分块自适应压缩感知", 《电子学报》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035401A (en) * 2019-06-03 2020-12-04 北京京东尚科信息技术有限公司 Model data processing method and device, electronic equipment and readable medium
CN110991643A (en) * 2019-12-25 2020-04-10 北京奇艺世纪科技有限公司 Model deployment method and device, electronic equipment and storage medium
CN110991643B (en) * 2019-12-25 2024-01-30 北京奇艺世纪科技有限公司 Model deployment method and device, electronic equipment and storage medium
CN111680799A (en) * 2020-04-08 2020-09-18 北京字节跳动网络技术有限公司 Method and apparatus for processing model parameters
US11809429B2 (en) 2020-04-08 2023-11-07 Beijing Bytedance Network Technology Co., Ltd. Method for processing model parameters, and apparatus
CN111680799B (en) * 2020-04-08 2024-02-20 北京字节跳动网络技术有限公司 Method and device for processing model parameters
EP3945471A1 (en) 2020-07-28 2022-02-02 Siemens Aktiengesellschaft Method for automated determination of a model compression technique for compression of an artificial intelligence-based model
WO2022023022A1 (en) 2020-07-28 2022-02-03 Siemens Aktiengesellschaft Method for automated determination of a model compression technique for compression of an artificial intelligence-based model

Also Published As

Publication number Publication date
CN108053034B (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN108053034A (en) Model parameter processing method, device, electronic equipment and storage medium
CN108415980A (en) Question and answer data processing method, electronic device and storage medium
CN107610695A (en) Driver&#39;s voice wakes up the dynamic adjusting method of instruction word weight
CN107688667A (en) Intelligent robot client service method, electronic installation and computer-readable recording medium
CN106528896B (en) A kind of database optimizing method and device
CN104424263A (en) Data recording method and data recording device
CN108038135A (en) Electronic device, the method for multilist correlation inquiry and storage medium
CN111563075B (en) Service verification system, method and equipment and storage medium
CN107729063A (en) Call method, device and the terminal of SDK
CN108491326A (en) Behavioral test recombination method, device and storage medium
CN108108190A (en) A kind of computational methods and Related product
CN107562428A (en) Rule-based adaptable software quick interface arrangement method and system
CN113033221A (en) Smart card issuing method, computer device and computer readable storage medium
CN104915435A (en) Data query method and device
CN108108189A (en) A kind of computational methods and Related product
CN107071553A (en) Method, device and computer readable storage medium for modifying video and voice
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN107589907A (en) Data processing method, electronic equipment and computer-readable recording medium
CN114662689A (en) Pruning method, device, equipment and medium for neural network
CN107612554A (en) Data compressing method
CN113887719A (en) Model compression method and device
CN114116699A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN106502775A (en) The method and system of DSP algorithm is dispatched in a kind of timesharing
CN112835867A (en) Data preprocessing method and device
CN112989036A (en) Feature extraction method and device for text classification

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
TR01 Transfer of patent right

Effective date of registration: 20240507

Address after: Room 403, Unit 1, Building 19, No. 2 Zhenzhu South Road, Pukou District, Nanjing City, Jiangsu Province, 210000

Patentee after: Chen Hua

Country or region after: China

Patentee after: Chen Xiang

Address before: 11 / F, building B1, software industry phase 4.1, No.1, Software Park East Road, Donghu New Technology Development Zone, Wuhan City, Hubei Province, 430000

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240717

Address after: 200131 building C, No. 888, Huanhu West 2nd Road, Lingang New District, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai

Patentee after: Shanghai Chun Kui Information Technology Co.,Ltd.

Country or region after: China

Address before: Room 403, Unit 1, Building 19, No. 2 Zhenzhu South Road, Pukou District, Nanjing City, Jiangsu Province, 210000

Patentee before: Chen Hua

Country or region before: China

Patentee before: Chen Xiang