CN110163340A - The method, apparatus and computer readable storage medium calculated using convolutional neural networks - Google Patents

The method, apparatus and computer readable storage medium calculated using convolutional neural networks Download PDF

Info

Publication number
CN110163340A
CN110163340A CN201910175821.1A CN201910175821A CN110163340A CN 110163340 A CN110163340 A CN 110163340A CN 201910175821 A CN201910175821 A CN 201910175821A CN 110163340 A CN110163340 A CN 110163340A
Authority
CN
China
Prior art keywords
convolutional neural
neural networks
sparse
channels
sparse channels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910175821.1A
Other languages
Chinese (zh)
Inventor
詹成君
周方云
方允福
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910175821.1A priority Critical patent/CN110163340A/en
Publication of CN110163340A publication Critical patent/CN110163340A/en
Pending legal-status Critical Current

Links

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

Landscapes

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

Abstract

The present invention relates to the method, apparatus for using convolutional neural networks to be calculated and computer readable storage mediums.Disclose a kind of method calculated using convolutional neural networks, comprising: receive the characteristic with different attribute of at least two channels input;Based on the attribute of received characteristic determine the degree of rarefication in each channel at least two channels;At least two channels are reset according to identified degree of rarefication, so that the sparse channels continuous arrangement at least two channels, the degree of rarefication of sparse channels is more than or equal to preset value;The parameter of housebroken convolutional neural networks model is adjusted based on the channel after rearrangement, and convolutional calculation is separately carried out using characteristic of the convolutional neural networks model adjusted to sparse channels and non-sparse channels, the degree of rarefication of non-sparse channels is less than preset value.

Description

The method, apparatus and computer-readable storage calculated using convolutional neural networks Medium
Technical field
The present invention relates to using convolutional neural networks (CNN) to be calculated, middle use convolutional Neural net is related in particular to The method, apparatus and computer readable storage medium that network is calculated.
Background technique
Convolutional neural networks are widely used in being calculated and being predicted in the fields such as game AI, image recognition, object detection. It can be used in game AI and game situation calculated in convolutional neural networks and simulates player exercises.In order to accelerate game AI is to the calculating speed of player exercises, and to further enhance user experience, the prior art is usually using rarefaction to convolutional Neural Convolutional layer in network is accelerated.A kind of method for optimizing convolutional layer calculating speed using rarefaction is: by convolutional calculation Matrix multiplication is converted to, accelerates to calculate by using matrix multiplication is accelerated.Another method is adjustment convolutional neural networks mould Type structure and re -training: making Model Weight rarefaction or is used together with RELU activation primitive with repetitive exercise model, increases Add degree of rarefication, then accelerates convolutional layer calculating speed using the mode that sparse matrix calculates.However, above method or dilute The precision of model can not be accelerated or can reduce when spending inadequate or need to instruct convolutional neural networks model again by dredging Practice.
Summary of the invention
There is provided a kind of solution that can alleviate, be mitigated or eliminated the above problem will be advantageous.
According to an aspect of the present invention, a kind of method calculated using convolutional neural networks is provided, comprising: receive The characteristic with different attribute of at least two channels input;Based on received characteristic attribute determine at least two The degree of rarefication in each channel in a channel;At least two channels are reset according to identified degree of rarefication, so that at least The degree of rarefication of sparse channels continuous arrangement in two channels, sparse channels is more than or equal to preset value;Based on the channel after rearrangement The parameter of housebroken convolutional neural networks model is adjusted, and using convolutional neural networks model adjusted to sparse channels Convolutional calculation is separately carried out with the characteristic of non-sparse channels, the degree of rarefication of non-sparse channels is less than preset value.
In some embodiments, the parameter of housebroken convolutional neural networks model is included at least for defining convolutional Neural The weight parameter of the structured file of the structure of network and parameter when being calculated for defining using convolutional neural networks.
In some embodiments, weight parameter includes the offset parameter for each channel.
In some embodiments, adjusting housebroken convolutional neural networks model includes to housebroken convolutional neural networks The structural adjustment of model is sparse channels to describe which channel in channel.
In some embodiments, adjusting housebroken convolutional neural networks model includes the sequence adjustment reset according to channel Respective weights parameter in housebroken convolutional neural networks model.
In some embodiments, using convolutional neural networks model adjusted to the spy of sparse channels and non-sparse channels Sign data separately carry out convolutional calculation, and the degree of rarefication of non-sparse channels is less than preset value further include: based on convolution mind adjusted The calculating of sparse channels fast convolution is carried out for rearranged adjacent one or more sparse channels through the parameter in network model; The rearranged non-sparse channels of adjacent one or more are carried out based on the parameter in convolutional neural networks model adjusted Conventional convolution calculates;And the conventional convolution for the result and non-sparse channels that the sparse channels fast convolution of sparse channels is calculated Calculated result merges, and obtains calculated result;Wherein, sparse channels fast convolution calculating refers to only to non-in sparse channels Zero is calculated.
In some embodiments, the result that the sparse channels fast convolutions of sparse channels is calculated and non-sparse channels it is normal Rule convolutional calculation result merges to obtain calculated result further include: based on the offset parameter in weight parameter to sparse channels The conventional convolution calculated result of result and non-sparse channels that sparse channels fast convolution calculates merges.
In some embodiments, this method further includes converting calculated result to operation to be performed instruction.
In some embodiments, housebroken convolutional neural networks are pre- to first pass through the characteristic data set with different attribute What the set indicated with the data of operation to be performed instruction was trained.
In some embodiments, method further includes by key-value pairs of sparse table of the characteristic of each sparse channels Show that form indicates, wherein key indicates the position of nonzero term in sparse matrix, and value indicates the value of the nonzero term.
In some embodiments, each step of method is executed in the convolutional layer of convolutional neural networks.
According to another aspect of the present invention, a kind of equipment calculated using convolutional neural networks is provided, comprising: defeated Enter module, receives the characteristic with different attribute of at least two channels input;Sparse data representation module, based on being connect The attribute of the characteristic of receipts determines the degree of rarefication in each channel at least two channels;And according to identified degree of rarefication At least two channels are reset, so that the sparse channels continuous arrangement at least two channels, the degree of rarefication of sparse channels More than or equal to preset value;And convolutional neural networks model adjusts module, adjusts housebroken convolution based on the channel after rearrangement The parameter and convolutional neural networks computing module of neural network model, using convolutional neural networks model adjusted to dilute The characteristic of dredging road and non-sparse channels separately carries out convolutional calculation, and the degree of rarefication of non-sparse channels is less than preset value.
In some embodiments, the parameter of housebroken convolutional neural networks model is included at least for defining convolutional Neural The weight parameter of the structured file of the structure of network and parameter when being calculated for defining using convolutional neural networks.
In some embodiments, weight parameter includes the offset parameter for each channel.
In some embodiments, adjusting housebroken convolutional neural networks model includes to housebroken convolutional neural networks The structural adjustment of model is sparse channels to describe which channel in channel.
In some embodiments, adjusting housebroken convolutional neural networks model includes the sequence adjustment reset according to channel Respective weights parameter in housebroken convolutional neural networks model.
In some embodiments, convolutional neural networks computing module, using convolutional neural networks model adjusted to dilute The characteristic of dredging road and non-sparse channels separately carries out convolutional calculation, and the degree of rarefication of non-sparse channels is less than preset value and also wraps It includes: rearranged adjacent one or more sparse channels being carried out based on the parameter in convolutional neural networks model adjusted Sparse channels fast convolution calculates;Based on the parameter in convolutional neural networks model adjusted for rearranged adjacent one Or multiple non-sparse channels carry out conventional convolution calculating;And result that the sparse channels fast convolutions of sparse channels is calculated and The conventional convolution calculated result of non-sparse channels merges, and obtains calculated result;Wherein, sparse channels fast convolution, which calculates, is Finger only calculates the nonzero term in sparse channels.
In some embodiments, the result that the sparse channels fast convolutions of sparse channels is calculated and non-sparse channels it is normal Rule convolutional calculation result merges to obtain calculated result further include: based on the offset parameter in weight parameter to sparse channels The conventional convolution calculated result of result and non-sparse channels that sparse channels fast convolution calculates merges.
In some embodiments, which is also configured to convert calculated result to operation to be performed instruction.
In some embodiments, it is that pre- first pass through has not which, which is also configured to housebroken convolutional neural networks, The set indicated with the data that the characteristic data set and operation to be performed of attribute instruct is trained.
In some embodiments, which is also configured to the characteristic of each sparse channels with key-value pairs Rarefaction representation form indicates that wherein key indicates the position of nonzero term in sparse matrix, and value indicates the value of the nonzero term.
In some embodiments, which, which is also configured to each step, is executed in the convolutional layer of convolutional neural networks 's.
Another aspect according to the present invention provides a kind of computer-readable Jie of non-transient of computer program instructions Matter makes processor execute method as described above when there is processor to execute computer program instructions.
Yet another aspect according to the present invention, provides a kind of calculating equipment, including processor and stores computer thereon The memory of program, computer program are configured to that processor is made to execute method as described above when performing on a processor.
According to the embodiment being described below, these and other aspects of the invention will be apparent it is clear, and It will be elucidated with reference to the embodiment being described below.
Detailed description of the invention
Below in conjunction with attached drawing in the description of exemplary embodiment, more details of the invention, feature and advantage quilt It is open, in the accompanying drawings:
Fig. 1 shows the schematic diagram of the scene calculated according to embodiments of the present invention game AI operation;
Fig. 2 shows operate the flow chart calculated to game AI according to embodiments of the present invention;
Fig. 3 shows the structural schematic diagram of convolutional neural networks computing module according to an embodiment of the present invention;
Fig. 4 shows the schematic diagram of the data flow according to an embodiment of the present invention calculated using convolutional neural networks;
Fig. 5 diagrammatically illustrates the flow chart of convolutional neural networks calculation method according to an embodiment of the present invention;
Fig. 6 further illustrates the flow chart of convolutional neural networks calculation method according to an embodiment of the present invention;And
Fig. 7 generally illustrates an example system comprising represent may be implemented one of various techniques described herein or The Example Computing Device of multiple systems and/or equipment.
Specific embodiment
In order to make those skilled in the art more fully understand the present invention program, below in conjunction with attached in the embodiment of the present invention Figure carries out complete, clearly description to the scheme in the embodiment of the present invention.Obviously, described embodiment is only the present invention A part embodiment, and not all embodiments.Based on the embodiments of the present invention, those skilled in the art are not making Obtained whole other embodiments belong to the range that the present invention is protected under the premise of creative work.
Convolutional neural networks are widely used in being calculated and being predicted in the fields such as game AI, image recognition, object detection. In the application scenarios in game AI, game situation and simulation player exercises are judged usually using convolutional neural networks model. The method for usually judging game situation and simulation player exercises is as follows: designing convolutional neural networks model according to game rule first Structure and the input of the feature in multiple channels, then by the method for supervised learning or intensified learning to convolutional neural networks model knot Structure is trained to obtain the respective weights of convolutional neural networks model, then the convolutional neural networks model is arranged into game It is calculated in actual motion scene.In game process, the feature extracted from actual motion scene is entered and convolutional Neural Network model, the ad hoc rules such as the convolutional layer defined according to convolutional neural networks, pond layer, full articulamentum and activation primitive layer into Row series of computation.The result of calculating is converted into corresponding operation in game, to simulate player exercises by game AI.
Fig. 1 is shown can be using the schematic diagram of the scene 100 of the game AI of the embodiment of the present invention.Fig. 1 shows a kind of trip Play battle picture, wherein true player 101 and AI player 102 just carry out game fighting.Player 101 is removed in game fighting picture It further include other objects, such as firing area 103, tower 104, stone 105 etc. outside AI player 102.It, can in game process To judge game situation and the operation of AI player 102 is simulated by extracting the various characteristics in game fighting scene.Feature Attribute possessed by data can include but is not limited to: game path, game role itself, with the game role battle it is other Game role, the teammate of the game role, the accessory (such as pet, stage property, weapon etc.) of the game role and the game The accessory of other game roles of role's battle, the accessory of the teammate of the game role, in game stage property (such as Reward stage property, punishment stage property, barrier) etc..The sparsity of the characteristic of data attribute as characterized above be it is known, because This can determine whether its corresponding feature channel is sparse according to the attribute of the characteristic extracted.
It is calculated using convolutional neural networks the embodiment provides a kind of using sparse data representation Scheme.Input channel includes sparse channels and non-sparse channels.Sparse channels and non-sparse channels are relative concepts, and are used Degree of rarefication defines the range in two channels.Degree of rarefication refers to the number of zero and all values in the channel in each channel The ratio of number.The channel that degree of rarefication is more than or equal to preset value is defined as sparse channels, and degree of rarefication is less than the logical of preset value Road is defined as non-sparse channels.The preset value can be, for example, 90%, can also be flat according to the actual scene and operation that use Platform is adjusted the preset value.According to one embodiment of present invention, by being rearranged to feature input channel, make Sparse channels arranged adjacent is obtained, to accelerate the calculating speed of convolutional neural networks, and then improves the speed calculated.According to this hair Bright embodiment is divided into the feature input channel of the model structure of the first layer (such as convolutional layer) of convolutional neural networks dilute Dredge road and non-sparse (dense) channel.The data of sparse channels can be using sparse format, that is, key-value to being indicated (that is, only saving nonzero value), wherein key indicates the position of nonzero term in sparse matrix, and value indicates the value of the nonzero term.This Outside, (that is, all values that data channel is saved using array or matrix) can be indicated using conventional non-sparse format.It is non-sparse The data in channel are indicated using above-mentioned non-sparse format.Then sparse channels and non-sparse channels are rearranged, so that Sparse channels arranged adjacent and non-sparse channels arranged adjacent.Next, quickly being counted based on the above arrangement using sparse convolution Calculation method calculates adjacent one or more sparse channels;Using general convolution calculation method to adjacent one or more Non- sparse channels are calculated.It finally adds up, obtains to the convolutional calculation result of above-mentioned sparse channels and non-sparse channels The calculated result of convolutional layer.
Fig. 2 shows operate the flow chart 200 calculated to game AI according to embodiments of the present invention.Solid line in Fig. 2 Box representative products processing module, dashed rectangle 206, which represents, calculates relevant part.
Under the scene of game fighting, true player and AI player typically from game fighting picture obtain game state and Information.AI player predefines characteristic information by Feature Engineering and tuning verifying from game fighting picture/map, then leads to It crosses feature extraction module 201 and reads the picture/cartographic information for being directed to a certain frame or multiple frames in game fighting, and be converted into Characteristic.The feature that convolutional neural networks computing module 202 is extracted using housebroken 205 Duis of AI convolutional neural networks model Data are calculated, and AI the model calculation is obtained.The calculated result is usually one or more floating-point arrays, wherein every number Group represents a kind of game operation instruction.AI the model calculation is converted to game operation instruction by game AI conversion module 203.Most Game operation instruction is sent to apparatus control module 204 afterwards, control game object is operated, and realizes the target effect of game AI Fruit.Wherein AI convolutional neural networks model is the number using characteristic data set and operation to be performed instruction with different attribute According to the set of expression be trained in advance and obtain.Dashed rectangle 206 is to calculate relevant part, specifically includes feature extraction Module 201, AI convolutional neural networks module 205 and convolutional neural networks computing module 202.
It is appreciated that being not limited to the application in terms of game AI according to the scheme of the embodiment of the present invention, but it is suitable for appointing The scene what is calculated using convolutional neural networks.
The structure that Fig. 3 shows the equipment 300 according to an embodiment of the present invention calculated using convolutional neural networks is shown It is intended to.The equipment 300 calculated using convolutional neural networks is particularly suitable for the case where there are sparse channels in feature input, It the use of the equipment 300 that convolutional neural networks are calculated mainly include input module 301, sparse data representation module 302, convolution Neural network model adjusts module 303 and convolutional neural networks computing module 304.
Input module 301 receives the characteristic of the different attribute in the characterization game of subchannel input, and comes from AI The housebroken convolutional neural networks model of convolutional neural networks module.
Sparse data representation module 302 determines that each channel is based on the different attribute for the characteristic that subchannel inputs It is no to belong to sparse channels, and according to resetting the continuously arranged criterion of sparse channels to the channel.In some embodiments In, determine whether identified sparse channels are continuous namely adjacent in whole feature input channels, if identified sparse Channel is discontinuous, then rearranges to each input channel, so that sparse channels continuous adjacent arrangement and non-sparse logical Road arranged adjacent.In Fig. 3, sparse channels are identified using the box 3021 of non-shadow, are identified using the box 3022 of shade non- Sparse channels.When determining the arrangement of the non-continuous adjacent of sparse channels 3021, input channel is reset.
Convolutional neural networks model adjustment module 303 adjusts the housebroken convolutional Neural net based on the channel of rearrangement The parameter of network model.In some embodiments, parameter includes structured file 3031 and weight parameter 3032.Structured file is usually fixed Network topology connection between the type of certain layer used in adopted convolutional neural networks, dimension and these layers.Weight parameter File, which is usually saved, inputs the relevant parameter information calculated, such as the weight parameter of each convolutional layer with feature.Some In the case of weight parameter file further include offset parameter (bias).In the structured file of convolutional neural networks, about first layer The description of (for example, convolutional layer) defines the port number and dimension of input feature vector.Convolutional neural networks model adjusts 303 base of module In sparse data representation module 302 identified each channel whether belong to sparse channels as a result, increasing in structured file Additional identifier, which channel in the identifier indicative character input channel is sparse channels.Convolutional neural networks model It is sparse channels that adjustment module 303, which is based further on which channel in feature input channel, is based on each channel and weight parameter Corresponding relationship the relevant parameter in weight parameter file is adjusted.
Convolutional neural networks computing module 304 using convolutional neural networks model adjusted to the sparse channels with it is non- The characteristic of sparse channels separately carries out convolutional calculation.In some embodiments, convolutional neural networks computing module 304 includes The quick computing module 3041 of sparse channels, non-sparse channels computing module 3042 and merging module 3043.Sparse channels are quickly counted It is sparse for rearranged adjacent one or more based on the parameter in housebroken convolutional neural networks model to calculate module 3041 Channel carries out sparse channels and quickly calculates.Sparse channels, which quickly calculate, to be referred to and utilizes the dilute of the characteristic inputted in sparse channels Dredge the calculating of characteristic.That is: can ignore when cumulative because zero is all zero multiplied by the result of any number, so sparse calculating The nonzero value that the respective weights Parameter File of nonzero value in feature input can be only calculated when the convolution in channel, inputs by feature In nonzero value be added in the corresponding position of result according to the definition of convolutional calculation.It is quickly calculated by using sparse channels Calculation amount is greatly reduced, the purpose quickly calculated is realized.Non- sparse channels computing module 3042 carries out non-sparse channels Conventional convolution calculates.Hereafter merging module 3043 is to the quick computing module of sparse channels 3041 and non-sparse channels computing module Both 3042 calculated result sums up.The result of adduction is used for the calculating of convolutional neural networks.
By dividing or being reset to together by sparse channels, can be completely secured according to the scheme of the embodiment of the present invention Under the premise of convolutional neural networks model computational accuracy, calculation amount is substantially reduced.In this way, calculating, which on the one hand can be promoted, calculates speed Degree reduces the time-consuming that game AI model calculates, quickly response operation;On the other hand occupancy central processing unit can also be reduced The resource and energy consumption of CPU.The size that feature input can also be reduced using the expression of sparse format data simultaneously, is reduced in a part Deposit the occupancy of resource.
Fig. 4 shows showing for the data flow 400 according to an embodiment of the present invention calculated using convolutional neural networks It is intended to.
Sparse data representation: corresponding sparse data representation and processing flow schematic diagram are as shown in Figure 4.Subchannel is special The data of sign input can be regarded as multiple rectangular matrixes (usually rectangular for scene of game, such as 10 × 10), according to matrix The degree of rarefication of middle data is divided into sparse channels and non-sparse channels, and convolutional neural networks model mark is then divided into structured file and power Weight parameter two parts.Structured file and weight parameter respectively obtain sparse channels and non-sparse channels as the input of computing module As a result, it is last optionally with fractional weight parameter (bias in weight parameter, each channel bias value having the same) close And result obtains complete convolutional calculation and refers to that the result sparse channels and dense channel adds up as a result, merging here.
Convolutional neural networks model mark is divided into structured file and weight parameter two parts, and wherein structured file defines volume Product neural network is linked using the network topology of the type of certain layer, dimension and these layers, and weight parameter file then saves The relevant parameter information (weight of such as each convolutional layer and the bias in each channel) calculated is inputted with feature.It is rolling up The description of first layer convolutional layer defines the port number and dimension of input feature vector in the structured file of product neural network model, only needs Additionally to increase mark, show which is that the input of subchannel feature can be realized in sparse channels in the channel of input feature vector.
Fig. 5 diagrammatically illustrates the flow chart 500 of convolutional neural networks calculation method according to an embodiment of the present invention.In step In rapid 501, the characteristic with different attribute of reception subchannel input and for convolutional neural networks network first Housebroken convolutional neural networks model.Illustratively, attribute may include as described above according to institute in map picture Game path, the game role itself, the team with other game roles of game role battle, the game role extracted Friend, the accessory (such as pet, stage property, weapon etc.) of the game role, other game roles with game role battle Accessory, the accessory of teammate of the game role, stage property (such as reward stage property, punishment stage property, obstacle in game Object) etc..In one embodiment, the parameter of housebroken convolutional neural networks model is included at least for defining the convolution mind The weight parameter of the structured file of structure through network and parameter when being calculated for defining using convolutional neural networks.? It further include the offset parameter for each channel in one embodiment, in weight parameter.The housebroken convolutional neural networks are The set progress that the data of characteristic data set and player's operation to be performed instruction with different attribute indicate is first passed through in advance Trained.
In step 502, it is sparse logical to determine whether each channel belongs to for the attribute based on the characteristic of subchannel input Road.As described above, different characteristic data attribute has different sparsities.Therefore, the feature based on different channel datas The attribute of data can determine whether the sparsity in the channel and the channel belong to sparse channels.
In step 503, according to resetting the continuously arranged criterion of sparse channels to each channel.If each feature is logical Road is arranged not in accordance with the continuously arranged criterion of sparse channels, then is reset.It in some embodiments, will be sparse Channel is divided to together with continuous arrangement, then remaining non-sparse channels are divided to continuous arrangement together.In one embodiment, If sparse channels in each feature channel continuous arrangement, is not required to be rearranged again.
In step 504, housebroken convolutional neural networks model parameter is adjusted based on the channel of rearrangement.In some realities It applies in example, which includes in the structural adjustment of housebroken convolutional neural networks model and convolutional neural networks model Respective weights parameter adjustment.In structure description file of the sequence reset according to channel to modify convolutional neural networks model Definition, the corresponding sequence for adjusting the weight parameter in convolutional neural networks model, so as to can be with according to the principle of convolutional calculation Guarantee that the result of convolutional calculation is consistent with the calculated result before not resetting.In some embodiments, housebroken convolution is adjusted Neural network model includes: model structure adjustment, which channel of the addition in Expressive Features input channel is sparse channels Identifier;Model Weight adjustment adjusts the respective weights in model structure according to the sequence of rearrangement, so that weight parameter It is still corresponding with the feature channel before not resetting.
In step 505, in calculating using convolutional neural networks model adjusted to sparse channels and non-sparse logical The characteristic in road separately carries out convolutional calculation.
Fig. 6 further illustrates the flow chart of convolutional neural networks calculation method according to an embodiment of the present invention.In Fig. 6 The specific implementation of convolutional calculation in one embodiment is further also gone out.In step 5051, based on convolution mind adjusted The calculating of sparse channels fast convolution is carried out for rearranged adjacent one or more sparse channels through the parameter in network model. Fast convolution calculating refers to that the nonzero term only for characteristic in sparse channels is calculated.Due to sparse channels input Characteristic has sparsity, and zero is all zero multiplied by the structure of any number, be can be ignored when carrying out accumulation operations, Therefore the nonzero value in feature input can be only calculated, the corresponding position of result is added to according still further to the definition of convolutional calculation.This Sample, calculation amount can substantially reduce, to realize the purpose quickly calculated.
In one embodiment, the characteristic of each sparse channels can use key-value pairs of rarefaction representation form It indicates.No matter indicated using the sparse format for only saving nonzero value, or using non-sparse (that is, being saved using array or matrix All values), each characteristic value corresponding to the progress of corresponding weight can only calculate, therefore convolutional calculation result will not change. The data expression of sparse channels is not limited to sparse data representation, and it is quick that sparse matrix also can be used using non-sparse data representation The purpose for accelerating to calculate equally may be implemented in convolution algorithm.
In one embodiment, sparse channels fast convolution calculating can be not limited to the first of the convolutional neural networks It is executed in layer.The calculating of sparse channels fast convolution can be held in other layers of convolutional neural networks according to the position of convolutional layer Row.For example, if the first layer of convolutional neural networks is full articulamentum, the second layer is pond layer, third layer is convolutional layer, then on The calculating of sparse channels fast convolution is stated to calculate in the third layer of convolutional neural networks.It is appreciated that in deployment convolutional Neural net It can determine whether subsequent network layer is carried out using sparse calculation according to the degree of rarefication in channel each in application scenarios when network model Accelerate.
In step 5052, based on the parameter in convolutional neural networks model adjusted to rearranged adjacent one or Multiple sparse channels carry out conventional convolution calculating.
In step 5053, the convolutional calculation result of said two devices is summed it up, to obtain calculated result.According to convolutional calculation Principle, the result of convolutional calculation is exactly the calculated result of all output channels, and each output channel is independent from each other, adjust The sequence of sparse channels and non-sparse channels in whole feature channel does not influence each defeated with the sequence of corresponding Model Weight Enter channel as a result, therefore final convolution results be sparse channels and non-sparse channels result add up it is obtained.
It in one embodiment, further include offset parameter (bias) in the weight parameter of the convolutional neural networks model. In one embodiment, the result that the sparse channels fast convolutions of the sparse channels is calculated and the non-sparse channels it is normal Rule convolutional calculation result merges to obtain calculated result further include: based on the offset parameter in the weight parameter to described dilute Dredge the result of the sparse channels fast convolution calculating in road and the conventional convolution calculated result weighted sum of the non-sparse channels.It is right There is the case where bias value in weight parameter, common calculation method is added in the result of each output channel Bias value.In this embodiment, when carrying out result merging, it is only necessary in the volume of the convolution results of sparse channels, non-sparse channels Increase the bias in product any of result or final convolution results three.
In one embodiment, the method also includes the calculated result is converted to operation to be performed instruction.
In one embodiment, the method also includes the padding processing to convolutional layer.In general, convolutional layer is to guarantee Dimension is unanimously or to handle boundary information, and in each channel, four direction presses ranks progress zero padding operation, the behaviour up and down for meeting Make to be referred to as padding.For the padding of sparse channels, 0 value itself, which not will do it corresponding calculate, to be ignored, as long as adjusting Coordinate corresponding to whole original nonzero value.
In one embodiment, the method also includes the stride processing to convolutional layer, the stride parameters of convolutional layer Whether the nonzero value that will affect feature input needs to be calculated with Model Weight parameter, can be sentenced before the computation by increasing Certainly condition is judged.
Fig. 7 generally illustrates an example system 700 comprising various techniques described herein may be implemented in representative The Example Computing Device 710 of one or more systems and/or equipment.Calculate equipment 710 can be for example with client (for example, Client device) associated equipment, system on chip, the server of service provider, and/or any other suitable calculating sets Standby or computing system.Calculating can be taken to set above for the equipment 300 of Fig. 3 description calculated using convolutional neural networks Standby 710 form.Alternatively, the equipment 300 calculated using convolutional neural networks can be with the form quilt of video app 716 It is embodied as computer program.More specifically, the equipment 300 calculated using convolutional neural networks may be implemented as video and broadcast The component part of device is put, or as the plug-in unit that separately can be downloaded and install with video player.
Example Computing Device 710 as shown includes the processing system 711 being coupled with each other, one or more computers Readable medium 712 and one or more I/O Interfaces 713.Although being not shown, calculating equipment 710 can also include being Bus of uniting or other data and order conveyer system, various assemblies are coupled to each other.System bus may include different bus Any one or combination of structure, the bus structures such as memory bus or Memory Controller, peripheral bus, general string Row bus, and/or processor or local bus using any one of various bus architectures.It is contemplated that various other show Example, such as control and data line.
Processing system 711 represents the function that one or more operations are executed using hardware.Therefore, processing system 711 is schemed It is shown as including the hardware element 714 that can be configured to processor, functional block etc..This may include being realized within hardware as dedicated Integrated circuit or the other logical devices formed using one or more semiconductors.Hardware element 714 is not by the material that it is formed Or in which the limitation of the processing mechanism used.For example, processor can be by (multiple) semiconductor and/or transistor (for example, electronics Integrated circuit (IC)) composition.In such context, processor-executable instruction can be electronically-executable instruction.
Computer-readable medium 712 is illustrated as including storage/memory 715.715 table of storage/memory Show memory/memory capacity associated with one or more computer-readable mediums.Storage/memory 715 can wrap Include Volatile media (such as random-access memory (ram)) and/or non-volatile media (such as read-only memory (ROM), sudden strain of a muscle It deposits, CD, disk etc.).Storage/memory 715 may include mounting medium (for example, RAM, ROM, Fixed disk drive Device etc.) and removable medium (for example, flash memory, removable hard disk drive, CD etc.).Computer-readable medium 712 can be with By be described further below it is various other in a manner of configured.
One or more I/O interfaces 713, which represent, allows users to input order and information and optionally to equipment 710 is calculated Also allow to present information to the function of user and/or other assemblies or equipment using various input-output apparatus.Input equipment Example include keyboard, cursor control device (for example, mouse), microphone (for example, for voice input), scanner, touch Function (for example, capacitive or other sensors for being configured as detection physical touch), camera are (for example, can be using visible or not It is gesture that visible wavelength (such as infrared frequency), which will not be related to the motion detection touched) etc..The example of output equipment includes Show equipment (for example, monitor or projector), loudspeaker, printer, network interface card, haptic response apparatus etc..Therefore, equipment is calculated 710 can by be described further below it is various in a manner of configured with support user interaction.
Calculating equipment 710 can also include video app 716.Video app 716 may, for example, be the use convolution mind of Fig. 3 The software instances of the equipment 300 calculated through network, and this is realized with the other elements calculated in equipment 710 with being combined The technology of text description.
It herein can be in hardware and software element or the general various technologies of described in the text up and down of program module.Generally, this A little modules include routines performing specific tasks or implementing specific abstract data types, programs, objects, element, component, data knot Structure etc..Term as used herein " module " (for example, input module 301, sparse data representation module 302 in earlier paragraphs, Convolutional neural networks model adjustment module 303 and convolutional neural networks computing module 304), " function " and " component " typically represent Software, firmware, hardware or combinations thereof.Technique described herein be characterized in it is platform-independent, it is meant that these technologies can be with It realizes on a variety of computing platforms having a variety of processors.
The realization of described module and technology can store on some form of computer-readable medium or across certain The computer-readable medium transmission of kind form.Computer-readable medium may include various Jie that can be accessed by calculating equipment 710 Matter.As an example, not a limit, computer-readable medium may include " computer readable storage medium " and " computer-readable letter Number medium ".
With simple signal transmission, carrier wave or signal itself on the contrary, " computer readable storage medium " is to refer to persistently The medium and/or equipment of storage information and/or tangible storage device.Therefore, computer readable storage medium refers to non-signal Bearing medium.Computer readable storage medium include such as volatile and non-volatile, removable and irremovable medium and/or To be suitable for storage information (such as computer readable instructions, data structure, program module, logic element/circuit or other numbers According to) the hardware of storage equipment etc realized of method or technique.The example of computer readable storage medium may include but not It is limited to RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storages Device, hard disk, cassette tape, tape, disk storage device or other magnetic storage apparatus or other storage equipment, tangible medium Or the product suitable for storing expectation information and can be accessed by computer.
" computer-readable signal media ", which refers to be configured as such as sending an instruction to via network, calculates equipment 710 The signal bearing medium of hardware.Signal media typically can by computer readable instructions, data structure, program module or other Data are embodied in such as modulated data signal of carrier wave, data-signal or other transmission mechanisms.Signal media further includes any Information transmitting medium.Term " modulated data signal " refer to the information in signal is encoded in this way being arranged or Change the signal of one or more of its feature.As an example, not a limit, communication media includes such as cable network or straight The wireless medium of the wired medium of line and such as sound, RF, infrared and other wireless medium in succession.
As previously mentioned, hardware element 714 and computer-readable medium 712 represent the instruction realized in the form of hardware, module, Programming device logic and/or immobilising device logic, can be used to implement technique described herein in some embodiments At least some aspects.Hardware element may include integrated circuit or system on chip, specific integrated circuit (ASIC), field-programmable The component of gate array (FPGA), Complex Programmable Logic Devices (CPLD) and other realizations or other hardware devices in silicon. In this context, hardware element can be used as instruction, module and/or the logic for executing and being embodied by hardware element and be defined Program task processing equipment, and for store be used for execution instruction hardware device, for example, previously described calculating Machine readable storage medium storing program for executing.
Combination above-mentioned can be used for realizing various techniques described herein and module.It therefore, can be by software, hardware Or program module and other program modules are embodied as on some form of computer readable storage medium and/or by one or more The one or more instructions and/or logic that a hardware element 714 embodies.Calculating equipment 710 can be configured as realization and software And/or the corresponding specific instruction of hardware module and/or function.Thus, for example by using the computer-readable of processing system Storage medium and/or hardware element 714 at least partly can realize that be embodied as module can be by calculating equipment with hardware 710 modules executed as software.Instruction and/or function can be by one or more products (for example, one or more calculate sets Standby 710 and/or processing system 711) can be performed/can operate to realize the techniques described herein, module and example.
In various embodiments, a variety of different configurations can be used by calculating equipment 710.It can for example, calculating equipment 710 Be implemented as include personal computer, desktop computer, multi-screen computer, laptop computer, net book etc. calculating Machine class equipment.Equipment 710 is calculated to be also implemented as including such as mobile phone, portable music player, portable game The mobile device class equipment for the mobile devices such as equipment, tablet computer, multi-screen computer of playing.Calculating equipment 710 can also be real Now be television-like device comprising have or be connected to leisure viewing environment in generally larger screen equipment.These set Standby includes TV, set-top box, game machine etc..
Technique described herein can be supported by these various configurations of calculating equipment 710, and be not limited to this paper institute The specific example of the technology of description.Calculating equipment 710 can also be interacted by the various communication technologys " cloud " 720.
Cloud 720 includes and/or representative is used for the platform 722 of resource 724.The hardware of 722 abstract cloud 720 of platform is (for example, clothes Be engaged in device) and software resource bottom function.Resource 724 may include executing calculating on far from the server for calculating equipment 710 The application and/or data that can be used when machine processing.Resource 724 can also include by internet and/or passing through such as honeycomb Or the service that the subscriber network of Wi-Fi network provides.Platform 722 can be with abstract resource and function will calculate equipment 710 and its He calculates equipment connection.Platform 722 can be also used for the classification of abstract resource with provide encounter for via platform 722 realize Resource 724 demand respective horizontal classification.
Although with structural features and or methods of action specific language description theme, but it is to be understood that appended The theme limited in claim is not necessarily limited to above-mentioned specific feature or action.On the contrary, above-mentioned specific features and movement are public Open the exemplary forms to realize claim.
The present invention is not limited to game AI, any other for being calculated and being predicted using convolutional neural networks can be also used for Scene, such as image recognition, object detection etc..
Term used herein is merely for for the purpose of describing particular embodiments and being not intended to limit the present invention.As herein Used in, singular "one", " one " and "the" be intended to also include plural form, unless context clearly separately has finger Show.It will be further appreciated that term " includes " and/or "comprising" when used in this manual specify addressed feature, The presence of entirety, step, operations, elements, and/or components, but be not excluded for other one or more features, entirety, step, operation, One or more other features, entirety, step, operation, component, assembly unit are added in the presence of component, assembly unit and/or its group And/or its group.As used in this article, term "and/or" includes associated times for listing one or more of project Meaning and all combination.
By research attached drawing, disclosure and appended claims, those skilled in the art are in the required guarantor of practice When the theme of shield, it is to be understood that and realize the modification for the disclosed embodiments.In mutually different dependent claims The only fact for describing certain measures does not indicate that the combination of these measures cannot be used to make a profit.

Claims (15)

1. a kind of method calculated using convolutional neural networks, comprising:
Receive the characteristic with different attribute of at least two channels input;
Based on the attribute of received characteristic determine the degree of rarefication in each channel at least two channel;
At least two channel is reset according to identified degree of rarefication, so that sparse at least two channel The degree of rarefication of channel continuous arrangement, the sparse channels is more than or equal to preset value;
The parameter of housebroken convolutional neural networks model is adjusted based on the channel after rearrangement, and
It is separately carried out using characteristic of the convolutional neural networks model adjusted to the sparse channels and non-sparse channels The degree of rarefication of convolutional calculation, the non-sparse channels is less than the preset value.
2. according to the method described in claim 1, wherein the parameter of the housebroken convolutional neural networks model includes at least By defining the structured file of the structure of the convolutional neural networks and based on defining and being carried out using the convolutional neural networks The weight parameter of parameter when calculation.
3. according to the method described in claim 2, wherein the weight parameter includes the offset parameter for each channel.
4. according to the method described in claim 1, the housebroken convolutional neural networks model of adjustment includes to described through instructing The structural adjustment of experienced convolutional neural networks model is sparse channels to describe which channel in the channel.
5. according to the method described in claim 1, the housebroken convolutional neural networks model of adjustment includes according to channel weight The sequence of row adjusts the respective weights parameter in the housebroken convolutional neural networks model.
6. according to the method described in claim 1, wherein using convolutional neural networks model adjusted to the sparse channels Convolutional calculation is separately carried out with the characteristic of non-sparse channels, the degree of rarefication of the non-sparse channels is less than the preset value also Include:
Based on the parameter in convolutional neural networks model adjusted for rearranged adjacent one or more sparse channels into Row sparse channels fast convolution calculates;
Based on the parameter in convolutional neural networks model adjusted for the rearranged adjacent non-sparse channels of one or more Carry out conventional convolution calculating;And
The conventional convolution of result and the non-sparse channels that the sparse channels fast convolution of the sparse channels calculates is calculated As a result it merges, obtains calculated result;
Wherein, the sparse channels fast convolution calculating, which refers to, only calculates the nonzero term in the sparse channels.
7. according to the method described in claim 6, the result wherein calculated the sparse channels fast convolution of the sparse channels It merges to obtain calculated result with the conventional convolution calculated result of the non-sparse channels further include: be based on the weight parameter In the offset parameter routine of result and the non-sparse channels that the sparse channels fast convolutions of the sparse channels is calculated Convolutional calculation result merges.
8. according to the method described in claim 6, further include:
The calculated result is converted into operation to be performed instruction.
9. according to the method described in claim 1, wherein the housebroken convolutional neural networks are that pre- first pass through has difference What the set that the data of characteristic data set and the operation to be performed instruction of attribute indicate was trained.
10. according to the method described in claim 1, further include:
The characteristic of each sparse channels is indicated with key-value pairs of rarefaction representation form, wherein key is indicated sparse The position of nonzero term in matrix, value indicate the value of the nonzero term.
11. method according to any of the preceding claims, each step of the method is in the convolutional Neural net It is executed in the convolutional layer of network.
12. a kind of equipment calculated using convolutional neural networks, comprising:
Input module receives the characteristic with different attribute of at least two channels input;
Sparse data representation module, based on the attribute of received characteristic determine that each of described at least two channel is logical The degree of rarefication in road;And at least two channel is reset according to identified degree of rarefication, so that described at least two The degree of rarefication of sparse channels continuous arrangement in channel, the sparse channels is more than or equal to preset value;And
Convolutional neural networks model adjusts module, and the ginseng of housebroken convolutional neural networks model is adjusted based on the channel after rearrangement Number, and
Convolutional neural networks computing module, using convolutional neural networks model adjusted to sparse channels and non-sparse logical The characteristic in road separately carries out convolutional calculation, and the degree of rarefication of the non-sparse channels is less than the preset value.
13. equipment according to claim 12, wherein the parameter of the housebroken convolutional neural networks model is at least wrapped It includes the structured file of the structure for defining the convolutional neural networks and is carried out for defining using the convolutional neural networks The weight parameter of parameter when calculating.
14. a kind of non-transient computer-readable medium of computer program instructions, when there is processor to execute the computer journey Sequence instruction makes the processor execute method described in any one of -11 according to claim 1.
15. a kind of calculating equipment, the memory of computer program is stored including processor and thereon, and the computer program is matched Being set to when executing on the processor makes the processor perform claim require method described in any one of 1-11.
CN201910175821.1A 2019-03-08 2019-03-08 The method, apparatus and computer readable storage medium calculated using convolutional neural networks Pending CN110163340A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910175821.1A CN110163340A (en) 2019-03-08 2019-03-08 The method, apparatus and computer readable storage medium calculated using convolutional neural networks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910175821.1A CN110163340A (en) 2019-03-08 2019-03-08 The method, apparatus and computer readable storage medium calculated using convolutional neural networks

Publications (1)

Publication Number Publication Date
CN110163340A true CN110163340A (en) 2019-08-23

Family

ID=67638387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910175821.1A Pending CN110163340A (en) 2019-03-08 2019-03-08 The method, apparatus and computer readable storage medium calculated using convolutional neural networks

Country Status (1)

Country Link
CN (1) CN110163340A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113078974A (en) * 2020-01-03 2021-07-06 百度(美国)有限责任公司 Method for neural network sparse channel generation and inference
CN113869500A (en) * 2021-10-18 2021-12-31 安谋科技(中国)有限公司 Model operation method, data processing method, electronic device, and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113078974A (en) * 2020-01-03 2021-07-06 百度(美国)有限责任公司 Method for neural network sparse channel generation and inference
CN113869500A (en) * 2021-10-18 2021-12-31 安谋科技(中国)有限公司 Model operation method, data processing method, electronic device, and medium

Similar Documents

Publication Publication Date Title
Gulli et al. Deep learning with Keras
KR102107709B1 (en) Spatial transformer modules
McGill et al. Deciding how to decide: Dynamic routing in artificial neural networks
KR102344473B1 (en) Superpixel Methods for Convolutional Neural Networks
US10942711B2 (en) Information processing method and information processing apparatus
US9659032B1 (en) Building a palette of colors from a plurality of colors based on human color preferences
CN110059740A (en) A kind of deep learning semantic segmentation model compression method for embedded mobile end
CN111684490A (en) Optimization of dynamic object instance detection, segmentation and structure mapping
US10796225B2 (en) Distributing tensor computations across computing devices
US11693627B2 (en) Contiguous sparsity pattern neural networks
CN106897742A (en) Method, device and electronic equipment for detecting object in video
CN111670457A (en) Optimization of dynamic object instance detection, segmentation and structure mapping
KR20180075368A (en) Dropout method for improving training speed and memory efficiency on artificial neural network and learning method based on the same
JP6856112B1 (en) Neural network weight reduction device, neural network weight reduction method and program
Ougiaroglou et al. Exploring the effect of data reduction on Neural Network and Support Vector Machine classification
WO2019108252A1 (en) Optimizations for dynamic object instance detection, segmentation, and structure mapping
TWI738144B (en) Information processing method and device, electronic equipment and storage medium
CN110163340A (en) The method, apparatus and computer readable storage medium calculated using convolutional neural networks
WO2020103606A1 (en) Model processing method and device, terminal, and storage medium
CN112088354A (en) Block floating point computations using shared exponents
EP3493104A1 (en) Optimizations for dynamic object instance detection, segmentation, and structure mapping
CN110287857A (en) A kind of training method of characteristic point detection model
US20140330826A1 (en) Methods and systems for data reduction in cluster analysis in distributed data environments
CN117056595A (en) Interactive project recommendation method and device and computer readable storage medium
JP2021144461A (en) Learning device and inference device

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