WO2023116155A1 - 神经网络操作方法、装置及存储介质 - Google Patents

神经网络操作方法、装置及存储介质 Download PDF

Info

Publication number
WO2023116155A1
WO2023116155A1 PCT/CN2022/126458 CN2022126458W WO2023116155A1 WO 2023116155 A1 WO2023116155 A1 WO 2023116155A1 CN 2022126458 W CN2022126458 W CN 2022126458W WO 2023116155 A1 WO2023116155 A1 WO 2023116155A1
Authority
WO
WIPO (PCT)
Prior art keywords
neural network
tensor
layer
sample data
dimension
Prior art date
Application number
PCT/CN2022/126458
Other languages
English (en)
French (fr)
Inventor
金立强
高秋彬
刘正宣
Original Assignee
大唐移动通信设备有限公司
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
Priority claimed from CN202210039452.5A external-priority patent/CN116366401A/zh
Application filed by 大唐移动通信设备有限公司 filed Critical 大唐移动通信设备有限公司
Publication of WO2023116155A1 publication Critical patent/WO2023116155A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L25/00Baseband systems
    • H04L25/02Details ; arrangements for supplying electrical power along data transmission lines

Definitions

  • the present disclosure relates to the field of communication technologies, and in particular to a neural network operation method, device and storage medium.
  • the input dimension of the neural network (the input dimension is different due to the collection of some data) and/or the output dimension are uncertain, it is necessary to train a neural network for all possible input dimensions and/or output dimensions to cope with different dimensions and task requirements.
  • Fig. 1 is a schematic diagram of a training method for a neural network with variable dimensions in the prior art, as shown in Fig. 1 , the existing feasible solution is to train a neural network for different input dimensions, as shown in Fig. 1 , The system will automatically select the corresponding neural network to make predictions according to the input dimension. As the input dimension increases (real-time data collected from partial to complete), the prediction value of the neural network gradually changes from "rough" to "accurate”.
  • Embodiments of the present disclosure provide a neural network operation method, device, and storage medium to solve the technical problem in the prior art that the number of neural networks increases as the number of possible dimensions increases.
  • an embodiment of the present disclosure provides a method for operating a neural network, including:
  • the random mask layer is used to perform random mask processing on tensors input to the random mask layer;
  • the second neural network is trained using sample data.
  • variable dimension type includes one or more of the following types:
  • the input dimension is variable
  • the output dimension is variable
  • the middle dimension is variable.
  • adding a random mask layer in the first neural network according to the type of variable dimension includes:
  • variable dimension When the type of the variable dimension is a variable input dimension, a random mask layer is added before the input layer of the first neural network.
  • adding a random mask layer in the first neural network according to the type of variable dimension includes:
  • variable dimension is a variable output dimension
  • a random mask layer is added after the output layer of the first neural network.
  • adding a random mask layer in the first neural network according to the type of variable dimension includes:
  • variable dimension is a variable middle dimension
  • a random mask layer is added to the middle layer of the first neural network.
  • adding a random mask layer at the middle layer of the first neural network includes:
  • a random masking layer is added before or after the associated intermediate layer.
  • adding a random mask layer in the middle layer of the neural network includes:
  • a random masking layer is added before or after each associated intermediate layer, respectively.
  • the training of the second neural network using sample data includes:
  • the dimension of the input data of each sample data is the first threshold
  • directly use all the sample data to train the second neural network the first threshold is the maximum dimension of the input data of all sample data value.
  • the training of the second neural network using sample data includes:
  • the first sample data is first enhanced, and then all the first sample data and all the second sample data are used to train the second neural network ;
  • the first sample data is the sample data whose dimension of the input data is not the first threshold;
  • the second sample data is the sample data whose dimension of the input data is the first threshold;
  • the first threshold is all The maximum value of the dimensions of the input data for the sample data.
  • the enhancing processing of the first sample data includes:
  • the enhancing processing of the first sample data includes:
  • Low-order zero padding is performed on the input data of the first sample data.
  • the training of the second neural network using sample data includes:
  • the first sample data is first eliminated, and then all the second sample data are used to train the second neural network; the first sample data is input data The dimension of the sample data is not the first threshold; the second sample data is the sample data of the dimension of the input data is the first threshold; the first threshold is the maximum value of the dimensions of the input data of all the sample data.
  • performing random mask processing on tensors input to the random mask layer includes:
  • Random masking is performed on the tensor input to the random mask layer by using the random mask tensor.
  • the expression of performing random mask processing on the tensor input to the random mask layer is as follows:
  • X represents the tensor input to the random mask layer
  • M represents a random mask tensor
  • the random mask tensor is a hard-valued mask tensor.
  • the random mask tensor is a soft value mask tensor.
  • the random mask tensor is a combination of a hard valued mask tensor and a soft valued mask tensor.
  • the sample data to train the second neural network after using the sample data to train the second neural network, it further includes:
  • the random mask layer in the trained second neural network is replaced with a tensor transformation layer; the tensor transformation layer is used to perform dimension transformation on the tensor input to the tensor transformation layer.
  • said replacing the random mask layer in the trained second neural network with a tensor transformation layer includes:
  • the random mask layer before the input layer of the second neural network after training is replaced by a tensor filling layer;
  • the quantity filling layer is used to increase the dimension of the tensor input to the tensor filling layer to a first threshold; the first threshold is the maximum value of the dimensions of the input data of all sample data.
  • said replacing the random mask layer in the trained second neural network with a tensor transformation layer includes:
  • the random mask layer after the output layer of the second neural network after training is replaced by a tensor clipping layer;
  • a quantity clipping layer is used to reduce dimensions of tensors input to the tensor clipping layer to a first target value.
  • said replacing the random mask layer in the trained second neural network with a tensor transformation layer includes:
  • the random mask layer of the middle layer of the second neural network after training is replaced by a tensor clipping cascade tensor filling layer;
  • the tensor pruning and cascading tensor filling layer is used to reduce the dimension of the tensor input to the tensor pruning and cascading tensor filling layer first to a second target value, and then increase it to the original dimension.
  • an embodiment of the present disclosure provides an electronic device, including a memory, a transceiver, and a processor;
  • the memory is used to store computer programs; the transceiver is used to send and receive data under the control of the processor; the processor is used to read the computer programs in the memory and perform the following operations:
  • variable dimension type includes one or more of the following types:
  • the input dimension is variable
  • the output dimension is variable
  • the middle dimension is variable.
  • adding a random mask layer in the first neural network according to the type of variable dimensionality includes:
  • variable dimension When the type of the variable dimension is a variable input dimension, a random mask layer is added before the input layer of the first neural network.
  • adding a random mask layer in the first neural network according to the type of variable dimension includes:
  • variable dimension is a variable output dimension
  • a random mask layer is added after the output layer of the first neural network.
  • adding a random mask layer in the first neural network according to the type of variable dimension includes:
  • variable dimension is a variable middle dimension
  • a random mask layer is added to the middle layer of the first neural network.
  • adding a random mask layer in the middle layer of the first neural network includes:
  • a random masking layer is added before or after the associated intermediate layer.
  • adding a random mask layer in the middle layer of the neural network includes:
  • a random masking layer is added before or after each associated intermediate layer, respectively.
  • the training of the second neural network using sample data includes:
  • the dimension of the input data of each sample data is the first threshold
  • directly use all the sample data to train the second neural network the first threshold is the maximum dimension of the input data of all sample data value.
  • the training of the second neural network using sample data includes:
  • the first sample data is first enhanced, and then all the first sample data and all the second sample data are used to train the second neural network ;
  • the first sample data is the sample data whose dimension of the input data is not the first threshold;
  • the second sample data is the sample data whose dimension of the input data is the first threshold;
  • the first threshold is all The maximum value of the dimensions of the input data for the sample data.
  • the enhancing processing of the first sample data includes:
  • the enhancing processing of the first sample data includes:
  • Low-order zero padding is performed on the input data of the first sample data.
  • the training of the second neural network using sample data includes:
  • first sample data first remove the first sample data, and then use all the second sample data to train the second neural network;
  • the first sample data is input data
  • the dimension of the sample data is not the first threshold;
  • the second sample data is the sample data of the dimension of the input data is the first threshold;
  • the first threshold is the maximum value of the dimensions of the input data of all the sample data.
  • performing random mask processing on tensors input to the random mask layer includes:
  • Random masking is performed on the tensor input to the random mask layer by using the random mask tensor.
  • the expression of performing random mask processing on the tensor input to the random mask layer is as follows:
  • X represents the tensor input to the random mask layer
  • M represents a random mask tensor
  • the random mask tensor is a hard-valued mask tensor.
  • the random mask tensor is a soft value mask tensor.
  • the random mask tensor is a combination of a hard valued mask tensor and a soft valued mask tensor.
  • the sample data to train the second neural network after using the sample data to train the second neural network, it further includes:
  • the random mask layer in the trained second neural network is replaced with a tensor transformation layer; the tensor transformation layer is used to perform dimension transformation on the tensor input to the tensor transformation layer.
  • said replacing the random mask layer in the trained second neural network with a tensor transformation layer includes:
  • the random mask layer before the input layer of the second neural network after training is replaced with a tensor filling layer;
  • the quantity filling layer is used to increase the dimension of the tensor input to the tensor filling layer to a first threshold; the first threshold is the maximum value of the dimensions of the input data of all sample data.
  • said replacing the random mask layer in the trained second neural network with a tensor transformation layer includes:
  • the random mask layer after the output layer of the second neural network after training is replaced by a tensor clipping layer;
  • a quantity clipping layer is used to reduce dimensions of tensors input to the tensor clipping layer to a first target value.
  • said replacing the random mask layer in the trained second neural network with a tensor transformation layer includes:
  • the random mask layer of the middle layer of the second neural network after training is replaced by a tensor clipping cascade tensor filling layer;
  • the tensor pruning and cascading tensor filling layer is used to reduce the dimension of the tensor input to the tensor pruning and cascading tensor filling layer first to a second target value, and then increase it to the original dimension.
  • an embodiment of the present disclosure provides a method for operating a neural network, which is characterized in that it includes:
  • the target neural network includes at least one tensor transformation layer, and the tensor transformation layer is used for input Tensors to the tensor transformation layer are dimensionally transformed.
  • the target neural network is the second neural network described in any one of the first aspects.
  • an embodiment of the present disclosure provides an electronic device, including a memory, a transceiver, and a processor;
  • the memory is used to store computer programs; the transceiver is used to send and receive data under the control of the processor; the processor is used to read the computer programs in the memory and perform the following operations:
  • the target neural network includes at least one tensor transformation layer, and the tensor transformation layer is used for input Tensors to the tensor transformation layer are dimensionally transformed.
  • the target neural network is the second neural network described in any one of the first aspects.
  • an embodiment of the present disclosure provides a neural network operation device, including:
  • the addition module is used to add a random mask layer in the first neural network according to the type of variable dimension to obtain a second neural network; the random mask layer is used to perform tensor input to the random mask layer random masking;
  • a training module configured to use sample data to train the second neural network.
  • variable dimension type includes one or more of the following types:
  • the input dimension is variable
  • the output dimension is variable
  • the middle dimension is variable.
  • the adding module is specifically used for:
  • variable dimension When the type of the variable dimension is a variable input dimension, a random mask layer is added before the input layer of the first neural network.
  • the adding module is specifically used for:
  • variable dimension is a variable output dimension
  • a random mask layer is added after the output layer of the first neural network.
  • the adding module is specifically used for:
  • variable dimension is a variable middle dimension
  • a random mask layer is added to the middle layer of the first neural network.
  • the adding module is specifically used for:
  • a random masking layer is added before or after the associated intermediate layer.
  • the adding module is specifically used for:
  • a random masking layer is added before or after each associated intermediate layer, respectively.
  • the training module is specifically used for:
  • the dimension of the input data of each sample data is the first threshold
  • directly use all the sample data to train the second neural network the first threshold is the maximum dimension of the input data of all sample data value.
  • the training module is specifically used for:
  • the first sample data is first enhanced, and then all the first sample data and all the second sample data are used to train the second neural network ;
  • the first sample data is the sample data whose dimension of the input data is not the first threshold;
  • the second sample data is the sample data whose dimension of the input data is the first threshold;
  • the first threshold is all The maximum value of the dimensions of the input data for the sample data.
  • the training module is specifically used for:
  • the training module is specifically used for:
  • Low-order zero padding is performed on the input data of the first sample data.
  • the training module is specifically used for:
  • first sample data first remove the first sample data, and then use all the second sample data to train the second neural network;
  • the first sample data is input data
  • the dimension of the sample data is not the first threshold;
  • the second sample data is the sample data of the dimension of the input data is the first threshold;
  • the first threshold is the maximum value of the dimensions of the input data of all the sample data.
  • the training module is specifically used for:
  • Random masking is performed on the tensor input to the random mask layer by using the random mask tensor.
  • the expression of performing random mask processing on the tensor input to the random mask layer is as follows:
  • X represents the tensor input to the random mask layer
  • M represents a random mask tensor
  • the random mask tensor is a hard-valued mask tensor.
  • the random mask tensor is a soft value mask tensor.
  • the random mask tensor is a combination of a hard valued mask tensor and a soft valued mask tensor.
  • a deployment module is also included;
  • the deployment module is used to replace the random mask layer in the trained second neural network with a tensor transformation layer; the tensor transformation layer is used to dimension the tensor input to the tensor transformation layer transform.
  • the deployment module is specifically used for:
  • the random mask layer before the input layer of the second neural network after training is replaced by a tensor filling layer;
  • the quantity filling layer is used to increase the dimension of the tensor input to the tensor filling layer to a first threshold; the first threshold is the maximum value of the dimensions of the input data of all sample data.
  • the deployment module is specifically used for:
  • the random mask layer after the output layer of the second neural network after training is replaced by a tensor clipping layer;
  • a quantity clipping layer is used to reduce dimensions of tensors input to the tensor clipping layer to a first target value.
  • the deployment module is specifically used for:
  • the random mask layer of the middle layer of the second neural network after training is replaced by a tensor clipping cascade tensor filling layer;
  • the tensor pruning and cascading tensor filling layer is used to reduce the dimension of the tensor input to the tensor pruning and cascading tensor filling layer first to a second target value, and then increase it to the original dimension.
  • an embodiment of the present disclosure provides a neural network operating device, including:
  • Acquisition module used to obtain forecast data
  • a processing module configured to input the predicted data into the deployed target neural network to obtain a predicted result output by the target neural network; wherein the target neural network includes at least one tensor transformation layer, and the tensor transformation Layers are used to perform dimension transformations on tensors input to the tensor transformation layer.
  • the target neural network is the second neural network described in any one of the fifth aspects.
  • the embodiments of the present disclosure further provide a processor-readable storage medium, the processor-readable storage medium stores a computer program, and the computer program is used to make the processor perform the above-mentioned first aspect or the first aspect.
  • the embodiments of the present disclosure further provide a computer-readable storage medium, the computer-readable storage medium stores a computer program, and the computer program is used to make the computer perform the above-mentioned first aspect or the third aspect.
  • the embodiments of the present disclosure further provide a communication device-readable storage medium, where the communication device-readable storage medium stores a computer program, and the computer program is used to enable the communication device to perform the above-mentioned first aspect or the first aspect.
  • an embodiment of the present disclosure further provides a chip product-readable storage medium, the chip product-readable storage medium stores a computer program, and the computer program is used to make the chip product perform the above-mentioned first aspect or the first aspect.
  • the neural network operation method, device and storage medium provided by the embodiments of the present disclosure only need to train and deploy a neural network to meet the requirements of different input and output dimensions by adding a random mask layer to the neural network. Low overhead, easy deployment and continuous evolution of online training.
  • Fig. 1 is the schematic diagram of the training method of the neural network of variable dimension in the prior art
  • FIG. 2 is a schematic flowchart of a neural network operation method provided by an embodiment of the present disclosure
  • Fig. 3 is a block diagram of dimension variable neural network training provided by an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a hard-value mask tensor provided by an embodiment of the present disclosure
  • FIG. 5 is a block diagram of a dimension-variable neural network deployment provided by an embodiment of the present disclosure
  • Fig. 6 is a schematic diagram of tensor filling and tensor clipping modules provided by an embodiment of the present disclosure
  • FIG. 7 is a schematic diagram of an autoencoder neural network provided by an embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram of a single-symbol and double-symbol DMRS provided by an embodiment of the present disclosure
  • FIG. 9 is a block diagram of CSI compression feedback based on an autoencoder provided by an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • Fig. 11 is a schematic structural diagram of a neural network operating device provided by an embodiment of the present disclosure.
  • Artificial neural network is a simplified model that abstracts and establishes the neuron network of the human brain from the perspective of information processing.
  • neural network is a computing model composed of a large number of computing nodes connected to each other in a specific way. This model is usually an expression or approximate expression of a certain algorithm or a certain function mapping. .
  • engineers first need to determine the structure and hyperparameters of the neural network, then feed the data into the model and give gradient backpropagation to update the weights of the trained neural network.
  • the trained neural network is an approximation of the mapping relationship between input data and labels, and the predicted value can be obtained by feeding new data into the neural network during the deployment phase.
  • Common neural networks include fully connected feedforward neural networks, convolutional neural networks, and recurrent neural networks.
  • graphics processing units GPUs
  • the training and deployment of neural networks are usually task-oriented, so the input and output dimensions of neural networks are generally determined.
  • a neural network trained for task A usually cannot be used for task B, or its performance is poor when used for task B.
  • the input and output dimensions of the neural network are uncertain, it is necessary to train a neural network for all possible input and output dimensions to cope with different dimensions and task requirements.
  • the system responds based on the predictions of a deployed neural network whose input is data collected in real time. When the real-time requirements of the system are high, the system hopes that the neural network can also give some "rough" prediction results based on part of the collected data, so that the system can respond in a better direction in advance, thereby saving the total time for responding in the optimal direction .
  • the existing feasible solution is to train a neural network for different input data dimensions (partial data collected leads to different input dimensions), as shown in Figure 1.
  • the system will automatically select the corresponding neural network to make predictions according to the input dimension.
  • the prediction value of the neural network gradually changes from "rough” to "accurate”.
  • the prior art needs to deploy multiple neural networks to cope with different input and output dimension requirements.
  • the number of neural networks will increase as the number of possible dimensions increases, the complexity of model training is high, and the model storage overhead is large, which is not conducive to actual deployment and continuous evolution of neural network online learning.
  • the embodiments of the present disclosure propose a neural network operation method, device, and storage medium.
  • the method By adding a random mask layer to the neural network, the method only needs to train and deploy a neural network to meet the requirements of different input and output dimensions. Low training complexity, low storage overhead, easy deployment and continuous evolution of online training.
  • Fig. 2 is a schematic flow diagram of the neural network operation method provided by the embodiment of the present disclosure.
  • the embodiment of the present disclosure provides a neural network operation method, and its execution subject may be an electronic device, for example, a terminal, a base station, a core network elements, etc.
  • the method includes:
  • Step 201 Add a random mask layer to the first neural network according to the type of variable dimension to obtain a second neural network; the random mask layer is used to perform random mask processing on the tensor input to the random mask layer ;
  • Step 202 using the sample data to train the second neural network.
  • variable dimension type includes one or more of the following types:
  • the input dimension is variable
  • the output dimension is variable
  • the middle dimension is variable.
  • adding a random mask layer in the first neural network according to the type of variable dimensionality includes:
  • variable input dimension When the type of the variable dimension is variable input dimension, a random mask layer is added before the input layer of the first neural network.
  • adding a random mask layer in the first neural network according to the type of variable dimensionality includes:
  • variable output dimension When the type of the variable dimension is variable output dimension, a random mask layer is added after the output layer of the first neural network.
  • adding a random mask layer in the first neural network according to the type of variable dimensionality includes:
  • variable dimension is a variable middle dimension
  • a random mask layer is added to the middle layer of the first neural network.
  • adding a random mask layer to the middle layer of the first neural network includes:
  • a random masking layer is added before or after the associated intermediate layer.
  • a random mask layer is added to the middle layer of the neural network, including:
  • a random masking layer is added before or after each associated intermediate layer, respectively.
  • using sample data to train the second neural network includes:
  • the first threshold is the maximum value of the dimensions of the input data of all the sample data.
  • using sample data to train the second neural network includes:
  • the first sample data is first enhanced, and then all the first sample data and all the second sample data are used to train the second neural network;
  • the first sample data is the sample data whose dimension of the input data is not the first threshold;
  • the second sample data is the sample data whose dimension of the input data is the first threshold;
  • the first threshold is the input data of all sample data The maximum value of the dimension.
  • performing enhanced processing on the first sample data includes:
  • performing enhanced processing on the first sample data includes:
  • Low-order zero padding is performed on the input data of the first sample data.
  • using sample data to train the second neural network includes:
  • first sample data first remove the first sample data, and then use all the second sample data to train the second neural network;
  • the first sample data is the dimension of the input data is not is the sample data of the first threshold;
  • the second sample data is the sample data of which the dimension of the input data is the first threshold;
  • the first threshold is the maximum value of the dimensions of the input data of all the sample data.
  • random masking is performed on tensors input to the random masking layer, comprising:
  • the random masking process is performed on the tensor input to the random masking layer by using the random masking tensor.
  • the expression for performing random masking on the tensor input to the random masking layer is as follows:
  • X represents the tensor input to the random mask layer
  • M represents a random mask tensor
  • the random mask tensor is a hard-valued mask tensor.
  • the random mask tensor is a soft-valued mask tensor.
  • the random mask tensor is a combination of a hard valued mask tensor and a soft valued mask tensor.
  • the random mask layer in the trained second neural network is replaced with a tensor transformation layer; the tensor transformation layer is used to perform dimension transformation on the tensor input to the tensor transformation layer.
  • the random mask layer in the trained second neural network is replaced with a tensor transformation layer, including:
  • the random mask layer before the input layer of the second neural network after training is replaced by a tensor filling layer; the tensor The filling layer is used to increase the dimension of the tensor input to the tensor filling layer to a first threshold; the first threshold is the maximum value of the dimensions of the input data of all sample data.
  • the random mask layer in the trained second neural network is replaced with a tensor transformation layer, including:
  • the random mask layer after the output layer of the second neural network after training is replaced by a tensor clipping layer; the tensor The clipping layer is used to reduce the dimensions of tensors input to the tensor clipping layer to a first target value.
  • the random mask layer in the trained second neural network is replaced with a tensor transformation layer, including:
  • the random mask layer of the middle layer of the second neural network after training is replaced by a tensor clipping cascade tensor filling layer;
  • the tensor pruning and cascading tensor filling layer is used to reduce the dimension of the tensor input to the tensor pruning and cascading tensor filling layer first to a second target value, and then increase to the original dimension.
  • the embodiments of the present disclosure determine the input tensor dimensions and output tensor dimensions of the neural input layer, output layer, and some intermediate layers according to the maximum dimension of the training data, the maximum dimension of the label, and task requirements.
  • Fig. 3 is a training block diagram of a variable-dimensional neural network provided by an embodiment of the present disclosure. As shown in Fig. 3 , in the training phase, a random mask module (also called “random mask layer”) to train the network. Specifically, the following steps may be included:
  • the training data can only use the data of the largest dimension (if there is data of non-maximum dimension, these data can be eliminated first), or data enhancement can be done before training, through high or low zero padding , to increase the low-dimensional input data to the maximum dimension.
  • the neural network After adding the random mask module, the neural network updates the training neural network by calculating the gradient value of the loss function with respect to the weight of the neural network.
  • the random mask operation (random mask processing) acts on the tensor X, expressed as
  • R X tensor is the dimension of the i-th order of the input tensor, and the operation Represents a tensor bitwise multiplication
  • M is a (random) mask tensor, is the mask result.
  • the mask tensor M is a random tensor, which is independent and identically distributed for each training sample and each training cycle (Epoch).
  • R mask tensor M of order X can be but not limited to:
  • a soft value mask with exponential decay tensor indexed as The element values are as follows:
  • the real number ⁇ [0, ⁇ max ] obeys a certain distribution (for example, uniform distribution), and for each I i , ⁇ is also independent and identically distributed.
  • part of hard value masks and part of soft value masks can be used, that is, a combination of hard value masks and soft value masks.
  • hard value masks is a first t bit is 1 after a vector with bits 0, Equivalent to the post- The bit value is set to zero, and the tensor dimension is unchanged.
  • the optimizer computes gradient backpropagation based on the loss and updates the neural network weight parameters.
  • Neural networks can be but not limited to convolutional neural networks, feedforward fully connected neural networks, recurrent neural networks and their combinations;
  • the loss function can be but not limited to mean square error, 1 norm, classification cross entropy, cosine similarity
  • the random mask module avoids the problem of gradient disappearance or non-leadability by customizing the gradient and using the mask tensor as a constant tensor;
  • the random mask on the input side, the random mask on the output side, and the random mask on the middle layer can exist at the same time, or only a few of them can exist.
  • the specific number of used can be determined according to the specific task.
  • Fig. 5 is a block diagram of the deployment of the dimension-variable neural network provided by the embodiment of the present disclosure.
  • the dimension-variable neural network removes the random mask module from the trained neural network and adds tensor A padding module (also called a "tensor padding layer”) and a tensor clipping module (also called a "tensor clipping layer”) are constructed. Specifically, the following steps may be included:
  • the random mask module on the left side of the input layer is replaced with a tensor filling module, and the input tensor is filled to the maximum input dimension by low-order or high-order zero padding;
  • the random mask module on the right side of the output layer is replaced by the tensor clipping module, and the tensor is output by high-order or low-order clipping;
  • the random mask module between the middle layer i and the middle layer i+1 is replaced by a tensor cropping module cascaded with a tensor filling module.
  • variable-dimensional neural network is constructed based on the above-mentioned trained neural network by removing the random mask module and replacing the tensor filling and tensor clipping modules, as shown in Figure 5.
  • the replaced tensor padding and tensor cropping modules are shown in Figure 6, when the input tensor X i-th order length is less than Then fill the tensor with zero padding on the high or low bits so that the dimension of the i-th order is equal to
  • the random mask tensor M corresponding to the tensor X needs to add an additional reverse rearrangement operation for the i-th order index.
  • the output tensor X cuts the tensor by intercepting low or high bits, in order to obtain a tensor that meets the output dimension requirements
  • the random mask tensor M corresponding to the tensor X needs to add an additional reverse rearrangement operation for the i-th order index.
  • the system only needs one neural network deployment, the output tensor is tailored as needed, and the input tensor is filled with zeros to meet the requirements of different input and output dimensions.
  • the neural network is an autoencoder for image compression, where the encoder module is used to compress pictures, and the decoder module is used to restore pictures.
  • a random hard value mask module is added between the encoder and the decoder, the parameter t ⁇ [0,8192] of the mask tensor obeys the uniform distribution, and the Adam optimizer is used to train the autoencoder neural network.
  • the encoder is deployed on the sending end and the decoder is deployed on the receiving end.
  • the sending end intercepts the tensor output by the encoder according to the compression rate requirements; the receiving end determines the number of filling bits of the tensor according to the length of the received tensor and fills the tensor, and then sends it to the decoder to restore the picture.
  • the smaller the Z dimension of the coding feature the higher the compression rate The higher the value, the blurrier the restored image; the larger the encoding feature dimension, the lower the compression rate ⁇ , and the clearer the restored image.
  • Possible values for the compression ratio are In the training phase, the parameters t ⁇ 8192, 4096, 2048, 1024 ⁇ of the hard value mask module obey the equal probability distribution Acts on the encoder output.
  • the receiving end estimates the channel coefficients on all time-frequency resource blocks according to the received value of the demodulation reference signal (DMRS), and the channel restoration algorithm is realized based on the neural network.
  • DMRS demodulation reference signal
  • the single-symbol DMRS and double-symbol DMRS are configured as shown in FIG. 8 .
  • the single-symbol DMRS configuration corresponds to the input dimension of the neural network is 48 ⁇ 1 ⁇ 2 (48 corresponds to the frequency, 1 corresponds to the time, and 2 corresponds to the real and imaginary parts of the complex number), and the double-symbol DMRS configuration (additional configuration on the basis of the single-symbol configuration One DMRS symbol) corresponds to the input dimension of the neural network is 48 ⁇ 2 ⁇ 2, and the output dimension of the neural network is 96 ⁇ 14 ⁇ 2.
  • a soft value mask is performed on the index dimension (time dimension) of the second order of the input tensor, and the parameter ⁇ [0, 20] Evenly distributed.
  • the deployed neural network with variable input dimension is used for channel estimation of both single-symbol and dual-symbol DMRS configurations.
  • the single-symbol DMRS configuration corresponds to a neural network input dimension of 48 ⁇ 1 ⁇ 2, and the double-symbol DMRS configuration Corresponding to the neural network input dimension 48 ⁇ 2 ⁇ 2.
  • the artificial intelligence-based channel state information (CSI) compression algorithm is implemented using an autoencoder, the encoder is deployed on the UE side, and the decoder is deployed on the base station side.
  • the UE side estimates the channel H based on the CSI reference signal (RS) and calculates the precoding vector V.
  • the encoder compresses the 768-dimensional V input value encoder into a vector, and the tensor cutting module cuts the output of the encoder according to the number of bits k to be fed back and sends it to the base station.
  • the base station performs tensor filling on the received bit stream according to the number of feedback bits, and inputs it to the decoder to restore the precoding vector
  • a tensor mask module is added between the encoder and decoder of the self-encoder, and a random hard value mask is used.
  • the parameter t ⁇ [1,384] of the mask tensor obeys a uniform distribution, and the loss function is cosine similarity.
  • the neural network operation method proposed by the embodiments of the present disclosure only needs to train and deploy a neural network to meet the requirements of different input and output dimensions. This method has low training complexity, low storage overhead, easy deployment and continuous evolution of online training.
  • Fig. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As shown in Fig. 10, the electronic device includes a memory 1020, a transceiver 1000, and a processor 1010, wherein:
  • the memory 1020 is used to store computer programs; the transceiver 1000 is used to send and receive data under the control of the processor 1010; the processor 1010 is used to read the computer programs in the memory 1020 and perform the following operations:
  • the random mask layer is used to perform random mask processing on tensors input to the random mask layer;
  • the second neural network is trained using sample data.
  • the transceiver 1000 is configured to receive and send data under the control of the processor 1010 .
  • the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by the processor 1010 and various circuits of the memory represented by the memory 1020 are linked together.
  • the bus architecture can also link together various other circuits such as peripherals, voltage regulators, and power management circuits, etc., which are well known in the art and therefore will not be further described herein.
  • the bus interface provides the interface.
  • Transceiver 1000 may be a plurality of elements, including a transmitter and a receiver, providing a unit for communicating with various other devices over transmission media, including wireless channels, wired channels, optical cables, and other transmission media.
  • the processor 1010 is responsible for managing the bus architecture and general processing, and the memory 1020 can store data used by the processor 1010 when performing operations.
  • the processor 1010 may be a central processing unit (CPU), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmable Gate Array, FPGA) or a complex programmable logic device (Complex Programmable Logic Device, CPLD), the processor can also adopt a multi-core architecture.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • FPGA field programmable gate array
  • CPLD Complex Programmable Logic Device
  • variable dimension type includes one or more of the following types:
  • the input dimension is variable
  • the output dimension is variable
  • the middle dimension is variable.
  • adding a random mask layer in the first neural network according to the type of variable dimension includes:
  • variable dimension When the type of the variable dimension is a variable input dimension, a random mask layer is added before the input layer of the first neural network.
  • adding a random mask layer in the first neural network according to the type of variable dimension includes:
  • variable dimension is a variable output dimension
  • a random mask layer is added after the output layer of the first neural network.
  • adding a random mask layer in the first neural network according to the type of variable dimension includes:
  • variable dimension is a variable middle dimension
  • a random mask layer is added to the middle layer of the first neural network.
  • adding a random mask layer in the middle layer of the first neural network includes:
  • a random masking layer is added before or after the associated intermediate layer.
  • adding a random mask layer in the middle layer of the neural network includes:
  • a random masking layer is added before or after each associated intermediate layer, respectively.
  • the training of the second neural network using sample data includes:
  • the dimension of the input data of each sample data is the first threshold
  • directly use all the sample data to train the second neural network the first threshold is the maximum dimension of the input data of all sample data value.
  • the training of the second neural network using sample data includes:
  • the first sample data is first enhanced, and then all the first sample data and all the second sample data are used to train the second neural network ;
  • the first sample data is the sample data whose dimension of the input data is not the first threshold;
  • the second sample data is the sample data whose dimension of the input data is the first threshold;
  • the first threshold is all The maximum value of the dimensions of the input data for the sample data.
  • the enhancing processing of the first sample data includes:
  • the enhancing processing of the first sample data includes:
  • Low-order zero padding is performed on the input data of the first sample data.
  • the training of the second neural network using sample data includes:
  • first sample data first remove the first sample data, and then use all the second sample data to train the second neural network;
  • the first sample data is input data
  • the dimension of the sample data is not the first threshold;
  • the second sample data is the sample data of the dimension of the input data is the first threshold;
  • the first threshold is the maximum value of the dimensions of the input data of all the sample data.
  • performing random mask processing on tensors input to the random mask layer includes:
  • Random masking is performed on the tensor input to the random mask layer by using the random mask tensor.
  • the expression of performing random mask processing on the tensor input to the random mask layer is as follows:
  • X represents the tensor input to the random mask layer
  • M represents a random mask tensor
  • the random mask tensor is a hard-valued mask tensor.
  • the random mask tensor is a soft value mask tensor.
  • the random mask tensor is a combination of a hard valued mask tensor and a soft valued mask tensor.
  • the sample data to train the second neural network after using the sample data to train the second neural network, it further includes:
  • the random mask layer in the trained second neural network is replaced with a tensor transformation layer; the tensor transformation layer is used to perform dimension transformation on the tensor input to the tensor transformation layer.
  • said replacing the random mask layer in the trained second neural network with a tensor transformation layer includes:
  • the random mask layer before the input layer of the second neural network after training is replaced by a tensor filling layer;
  • the quantity filling layer is used to increase the dimension of the tensor input to the tensor filling layer to a first threshold; the first threshold is the maximum value of the dimensions of the input data of all sample data.
  • said replacing the random mask layer in the trained second neural network with a tensor transformation layer includes:
  • the random mask layer after the output layer of the second neural network after training is replaced by a tensor clipping layer;
  • a quantity clipping layer is used to reduce dimensions of tensors input to the tensor clipping layer to a first target value.
  • said replacing the random mask layer in the trained second neural network with a tensor transformation layer includes:
  • the random mask layer of the middle layer of the second neural network after training is replaced by a tensor clipping cascade tensor filling layer;
  • the tensor pruning and cascading tensor filling layer is used to reduce the dimension of the tensor input to the tensor pruning and cascading tensor filling layer first to a second target value, and then increase it to the original dimension.
  • the above-mentioned electronic device provided by the embodiments of the present disclosure can implement all the method steps implemented by the above-mentioned method embodiment in which the execution subject is the electronic device, and can achieve the same technical effect, and no further description of the method and method in this embodiment will be made here. The same parts and beneficial effects of the embodiments are described in detail.
  • An embodiment of the present disclosure also provides a method for operating a neural network, including:
  • the target neural network includes at least one tensor transformation layer, and the tensor transformation layer is used for input Tensors to the tensor transformation layer are dimensionally transformed.
  • the target neural network is the second neural network described in any one of the above embodiments.
  • the neural network operation method proposed by the embodiments of the present disclosure only needs to train and deploy a neural network to meet the requirements of different input and output dimensions. This method has low training complexity, low storage overhead, easy deployment and continuous evolution of online training.
  • An embodiment of the present disclosure also provides an electronic device, including a memory, a transceiver, and a processor, wherein:
  • the memory is used to store computer programs; the transceiver is used to send and receive data under the control of the processor; the processor is used to read the computer programs in the memory and perform the following operations:
  • the target neural network includes at least one tensor transformation layer, and the tensor transformation layer is used for input Tensors to the tensor transformation layer are dimensionally transformed.
  • a transceiver for receiving and sending data under the control of the processor.
  • the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processors and various circuits represented by memories linked together.
  • the bus architecture can also link together various other circuits such as peripherals, voltage regulators, and power management circuits, etc., which are well known in the art and therefore will not be further described herein.
  • the bus interface provides the interface.
  • a transceiver may be a plurality of elements, including a transmitter and a receiver, providing means for communicating with various other devices over transmission media, including wireless channels, wired channels, fiber optic cables, and other transmission media.
  • the processor is responsible for managing the bus architecture and general processing, and the memory stores data that the processor uses when performing operations.
  • the processor can be a central processing unit (CPU), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmable Gate Array, FPGA) or a complex programmable logic device (Complex Programmable Logic Device, CPLD ), the processor can also adopt a multi-core architecture.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • FPGA field programmable gate array
  • CPLD Complex Programmable Logic Device
  • the target neural network is the second neural network described in any one of the above embodiments.
  • the electronic device proposed by the embodiments of the present disclosure only needs to train and deploy one neural network to meet the requirements of different input and output dimensions.
  • This method has low training complexity, low storage overhead, easy deployment and continuous evolution of online training.
  • Fig. 11 is a schematic structural diagram of a neural network operating device provided by an embodiment of the present disclosure. As shown in Fig. 11, an embodiment of the present disclosure provides a neural network operating device, including an adding module 1101 and a training module 1102, wherein:
  • the adding module 1101 is used to add a random mask layer in the first neural network according to the type of variable dimension to obtain a second neural network; the random mask layer is used to perform tensor input to the random mask layer Random mask processing; the training module 1102 is used to use sample data to train the second neural network.
  • variable dimension type includes one or more of the following types:
  • the input dimension is variable
  • the output dimension is variable
  • the middle dimension is variable.
  • the adding module is specifically used for:
  • variable dimension When the type of the variable dimension is a variable input dimension, a random mask layer is added before the input layer of the first neural network.
  • the adding module is specifically used for:
  • variable dimension is a variable output dimension
  • a random mask layer is added after the output layer of the first neural network.
  • the adding module is specifically used for:
  • variable dimension is a variable middle dimension
  • a random mask layer is added to the middle layer of the first neural network.
  • the adding module is specifically used for:
  • a random masking layer is added before or after the associated intermediate layer.
  • the adding module is specifically used for:
  • a random masking layer is added before or after each associated intermediate layer, respectively.
  • the training module is specifically used for:
  • the dimension of the input data of each sample data is the first threshold
  • directly use all the sample data to train the second neural network the first threshold is the maximum dimension of the input data of all sample data value.
  • the training module is specifically used for:
  • the first sample data is first enhanced, and then all the first sample data and all the second sample data are used to train the second neural network ;
  • the first sample data is the sample data whose dimension of the input data is not the first threshold;
  • the second sample data is the sample data whose dimension of the input data is the first threshold;
  • the first threshold is all The maximum value of the dimensions of the input data for the sample data.
  • the training module is specifically used for:
  • the training module is specifically used for:
  • Low-order zero padding is performed on the input data of the first sample data.
  • the training module is specifically used for:
  • first sample data first remove the first sample data, and then use all the second sample data to train the second neural network;
  • the first sample data is input data
  • the dimension of the sample data is not the first threshold;
  • the second sample data is the sample data of the dimension of the input data is the first threshold;
  • the first threshold is the maximum value of the dimensions of the input data of all the sample data.
  • the training module is specifically used for:
  • Random masking is performed on the tensor input to the random mask layer by using the random mask tensor.
  • the expression of performing random mask processing on the tensor input to the random mask layer is as follows:
  • X represents the tensor input to the random mask layer
  • M represents a random mask tensor
  • the random mask tensor is a hard-valued mask tensor.
  • the random mask tensor is a soft value mask tensor.
  • the random mask tensor is a combination of a hard valued mask tensor and a soft valued mask tensor.
  • a deployment module is also included;
  • the deployment module is used to replace the random mask layer in the trained second neural network with a tensor transformation layer; the tensor transformation layer is used to dimension the tensor input to the tensor transformation layer transform.
  • the deployment module is specifically used for:
  • the random mask layer before the input layer of the second neural network after training is replaced by a tensor filling layer;
  • the quantity filling layer is used to increase the dimension of the tensor input to the tensor filling layer to a first threshold; the first threshold is the maximum value of the dimensions of the input data of all sample data.
  • the deployment module is specifically used for:
  • the random mask layer after the output layer of the second neural network after training is replaced by a tensor clipping layer;
  • a quantity clipping layer is used to reduce dimensions of tensors input to the tensor clipping layer to a first target value.
  • the deployment module is specifically used for:
  • the random mask layer of the middle layer of the second neural network after training is replaced by a tensor clipping cascade tensor filling layer;
  • the tensor pruning and cascading tensor filling layer is used to reduce the dimension of the tensor input to the tensor pruning and cascading tensor filling layer first to a second target value, and then increase it to the original dimension.
  • the above-mentioned neural network operating device provided by the embodiments of the present disclosure can realize all the method steps implemented by the above-mentioned method embodiments in which the execution subject is an electronic device, and can achieve the same technical effect.
  • the same parts and beneficial effects as those of the method embodiment will be described in detail.
  • An embodiment of the present disclosure also provides a neural network operating device, including:
  • Acquisition module used to obtain forecast data
  • a processing module configured to input the predicted data into the deployed target neural network to obtain a predicted result output by the target neural network; wherein the target neural network includes at least one tensor transformation layer, and the tensor transformation Layers are used to perform dimension transformations on tensors input to the tensor transformation layer.
  • the target neural network is the second neural network described in any one of the above embodiments.
  • the neural network operating device proposed by the embodiments of the present disclosure only needs to train and deploy one neural network to meet the requirements of different input and output dimensions.
  • This method has low training complexity, low storage overhead, easy deployment and continuous evolution of online training.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a processor-readable storage medium.
  • the technical solution of the present disclosure is essentially or part of the contribution to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
  • a computer-readable storage medium stores a computer program, and the computer program is used to make a computer execute the steps of the neural network operation method provided by the above method embodiments .
  • the above-mentioned computer-readable storage medium provided by the embodiments of the present disclosure can realize all the method steps realized by the above-mentioned method embodiments, and can achieve the same technical effect.
  • the same parts and beneficial effects are described in detail.
  • the computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), Optical memory (such as CD, DVD, BD, HVD, etc.), and semiconductor memory (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state hard disk (SSD)), etc.
  • magnetic storage such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.
  • Optical memory such as CD, DVD, BD, HVD, etc.
  • semiconductor memory such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state hard disk (SSD)
  • first and second in the embodiments of the present disclosure are used to distinguish similar objects, and are not used to describe a specific order or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the present disclosure are capable of practice in sequences other than those illustrated or described herein and that "first" and “second” distinguish objects. It is usually one category, and the number of objects is not limited. For example, there may be one or more first objects.
  • the applicable system may be a global system of mobile communication (GSM) system, a code division multiple access (CDMA) system, a wideband code division multiple access (WCDMA) general packet Wireless business (general packet radio service, GPRS) system, long term evolution (long term evolution, LTE) system, LTE frequency division duplex (frequency division duplex, FDD) system, LTE time division duplex (time division duplex, TDD) system, Long term evolution advanced (LTE-A) system, universal mobile telecommunications system (UMTS), worldwide interoperability for microwave access (WiMAX) system, 5G new air interface (New Radio, NR) system, etc.
  • GSM global system of mobile communication
  • CDMA code division multiple access
  • WCDMA wideband code division multiple access
  • GPRS general packet Wireless business
  • long term evolution long term evolution
  • LTE long term evolution
  • LTE frequency division duplex frequency division duplex
  • FDD frequency division duplex
  • TDD time division duplex
  • LTE-A Long term evolution advanced
  • the terminal device involved in the embodiments of the present disclosure may be a device that provides voice and/or data connectivity to users, a handheld device with a wireless connection function, or other processing devices connected to a wireless modem.
  • the name of the terminal equipment may be different.
  • the terminal equipment may be called User Equipment (User Equipment, UE).
  • the wireless terminal equipment can communicate with one or more core networks (Core Network, CN) via the radio access network (Radio Access Network, RAN), and the wireless terminal equipment can be a mobile terminal equipment, such as a mobile phone (or called a "cellular "telephones) and computers with mobile terminal equipment, such as portable, pocket, hand-held, computer built-in or vehicle-mounted mobile devices, which exchange language and/or data with the radio access network.
  • a mobile terminal equipment such as a mobile phone (or called a "cellular "telephones) and computers with mobile terminal equipment, such as portable, pocket, hand-held, computer built-in or vehicle-mounted mobile devices, which exchange language and/or data with the radio access network.
  • PCS Personal Communication Service
  • SIP Session Initiated Protocol
  • WLL Wireless Local Loop
  • PDA Personal Digital Assistant
  • Wireless terminal equipment can also be called system, subscriber unit, subscriber station, mobile station, mobile station, remote station, access point , remote terminal (remote terminal), access terminal (access terminal), user terminal (user terminal), user agent (user agent), and user device (user device), which are not limited in the embodiments of the present disclosure.
  • the network device involved in the embodiments of the present disclosure may be a base station, and the base station may include multiple cells that provide services for terminals.
  • the base station can also be called an access point, or it can be a device in the access network that communicates with the wireless terminal device through one or more sectors on the air interface, or other names.
  • the network device can be used to interchange received over-the-air frames with Internet Protocol (IP) packets and act as a router between the wireless terminal device and the rest of the access network, which can include the Internet Protocol (IP) communication network.
  • IP Internet Protocol
  • Network devices may also coordinate attribute management for the air interface.
  • the network equipment involved in the embodiments of the present disclosure may be a network equipment (Base Transceiver Station, BTS) in Global System for Mobile communications (GSM) or Code Division Multiple Access (Code Division Multiple Access, CDMA) ), it can also be a network device (NodeB) in Wide-band Code Division Multiple Access (WCDMA), or it can be an evolved network device in a long-term evolution (long term evolution, LTE) system (evolutional Node B, eNB or e-NodeB), 5G base station (gNB) in the 5G network architecture (next generation system), can also be a home evolved base station (Home evolved Node B, HeNB), relay node (relay node) , a home base station (femto), a pico base station (pico), etc., are not limited in this embodiment of the present disclosure.
  • a network device may include a centralized unit (centralized unit, CU) node and a distributed unit (distributed unit, DU) node
  • MIMO transmission can be Single User MIMO (Single User MIMO, SU-MIMO) or Multi-User MIMO (Multiple User MIMO, MU-MIMO).
  • MIMO transmission can be 2D-MIMO, 3D-MIMO, FD-MIMO, or massive-MIMO, or diversity transmission, precoding transmission, or beamforming transmission, etc.
  • the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Accordingly, the present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) having computer-usable program code embodied therein.
  • processor-executable instructions may also be stored in a processor-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the processor-readable memory produce a manufacturing product, the instruction device realizes the functions specified in one or more procedures of the flow chart and/or one or more blocks of the block diagram.
  • processor-executable instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented
  • the executed instructions provide steps for implementing the functions specified in the procedure or procedures of the flowchart and/or the block or blocks of the block diagrams.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Power Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

本公开实施例提供一种神经网络操作方法、装置及存储介质,包括:根据可变维度的类型在第一神经网络中添加随机掩膜层,得到第二神经网络;所述随机掩膜层用于对输入至所述随机掩膜层的张量进行随机掩膜处理;利用样本数据对所述第二神经网络进行训练。本公开实施例提供的神经网络操作方法、装置及存储介质,通过在神经网络中添加随机掩膜层,仅需训练和部署一个神经网络适应不同输入输出维度要求,该方法训练复杂度低、存储开销低,易于部署和在线训练持续演进。

Description

神经网络操作方法、装置及存储介质
相关申请的交叉引用
本申请要求于2021年12月23日提交的申请号为202111593613.7,发明名称为“神经网络训练与部署方法、装置及存储介质”和于2022年01月13日提交的申请号为202210039452.5,发明名称为“神经网络操作方法、装置及存储介质”的中国专利申请的优先权,其通过引用方式全部并入本文。
技术领域
本公开涉及通信技术领域,尤其涉及一种神经网络操作方法、装置及存储介质。
背景技术
当神经网络输入维度(采集到部分数据导致输入维度不同)和/或输出维度不确定时,需要对所有可能的输入维度和/或输出维度分别训练一个神经网络以应对不同维度和任务需求。
图1是现有技术中维度可变的神经网络的训练方法的原理图,如图1所示,现有可行的解决方案便是对不同输入维度分别训练一个神经网络,如图1所示,系统根据输入维度会自动选择相应的神经网络做出预测,随着输入维度的不断增大(采集到实时的数据从部分到完整),神经网络的预测值由“粗糙”逐渐转向“准确”。
但是,上述方案中神经网络的个数会随着维度可能的情况的增加而增加,神经网络(模型)训练的复杂度高,模型存储开销大,不利于实际部署和神经网络在线学习持续演进。
发明内容
本公开实施例提供一种神经网络操作方法、装置及存储介质,用以解决现有技术中神经网络的个数会随着维度可能的情况的增加而增加的技术问题。
第一方面,本公开实施例提供一种神经网络操作方法,包括:
根据可变维度的类型在第一神经网络中添加随机掩膜层,得到第二神经网络;所述随机掩膜层用于对输入至所述随机掩膜层的张量进行随机掩膜处理;
利用样本数据对所述第二神经网络进行训练。
在一些实施例中,所述可变维度类型包括以下类型中的一种或多种:
输入维度可变;
输出维度可变;
中间维度可变。
在一些实施例中,所述根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在所述可变维度的类型为输入维度可变的情况下,在所述第一神经网络的输入层之前添加随机掩膜层。
在一些实施例中,所述根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在所述可变维度的类型为输出维度可变的情况下,在所述第一神经网络的输出层之后添加随机掩膜层。
在一些实施例中,所述根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在所述可变维度的类型为中间维度可变的情况下,在所述第一神经网络的中间层添加随机掩膜层。
在一些实施例中,所述在所述第一神经网络的中间层添加随机掩 膜层,包括:
在只有一个中间维度可变的情况下,在相关联的中间层之前或之后添加一个随机掩膜层。
在一些实施例中,所述在所述神经网络的中间层添加随机掩膜层,包括:
在有多个中间维度可变的情况下,在每一相关联的中间层之前或之后分别添加一个随机掩膜层。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练,包括:
在每一样本数据的输入数据的维度均为第一阈值的情况,直接利用所有的样本数据对所述第二神经网络进行训练;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练,包括:
在存在至少一个第一样本数据的情况,先对所述第一样本数据进行增强处理,再利用所有的第一样本数据和所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述对所述第一样本数据进行增强处理,包括:
对所述第一样本数据的输入数据进行高位补零。
在一些实施例中,所述对所述第一样本数据进行增强处理,包括:
对所述第一样本数据的输入数据进行低位补零。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练,包括:
在存在至少一个第一样本数据的情况,先剔除所述第一样本数据, 再利用所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述对输入至所述随机掩膜层的张量进行随机掩膜处理,包括:
确定输入至所述随机掩膜层的张量以及随机掩膜张量;
利用所述随机掩膜张量对输入至所述随机掩膜层的张量进行随机掩膜处理。
在一些实施例中,所述对输入至所述随机掩膜层的张量进行随机掩膜处理的表达式如下:
Figure PCTCN2022126458-appb-000001
其中,
Figure PCTCN2022126458-appb-000002
表示随机掩膜层输出的张量,X表示输入至随机掩膜层的张量,
Figure PCTCN2022126458-appb-000003
表示张量逐位点乘运算,M表示随机掩膜张量。
在一些实施例中,所述随机掩膜张量为硬值掩膜张量。
在一些实施例中,所述随机掩膜张量为软值掩膜张量。
在一些实施例中,所述随机掩膜张量由硬值掩膜张量和软值掩膜张量组合而成。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练之后,还包括:
将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层;所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,所述将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的输入层之前存在随机掩膜层的情况下,将经过训练后的第二神经网络的输入层之前的随机掩膜层替 换为张量填充层;所述张量填充层用于将输入至所述张量填充层的张量的维度增大到第一阈值;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的输出层之后存在随机掩膜层的情况下,将经过训练后的第二神经网络的输出层之后的随机掩膜层替换为张量裁剪层;所述张量裁剪层用于将输入至所述张量裁剪层的张量的维度减小到第一目标值。
在一些实施例中,所述将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的中间层存在随机掩膜层的情况下,将经过训练后的第二神经网络的中间层的随机掩膜层替换为张量裁剪级联张量填充层;所述张量裁剪级联张量填充层用于将输入至所述张量裁剪级联张量填充层的张量的维度先减小到第二目标值,再增大到原来的维度。
第二方面,本公开实施例提供一种电子设备,包括存储器,收发机,处理器;
存储器,用于存储计算机程序;收发机,用于在所述处理器的控制下收发数据;处理器,用于读取所述存储器中的计算机程序并执行以下操作:
在一些实施例中,所述可变维度类型包括以下类型中的一种或多种:
输入维度可变;
输出维度可变;
中间维度可变。
在一些实施例中,所述根据可变维度的类型在第一神经网络中添 加随机掩膜层,包括:
在所述可变维度的类型为输入维度可变的情况下,在所述第一神经网络的输入层之前添加随机掩膜层。
在一些实施例中,所述根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在所述可变维度的类型为输出维度可变的情况下,在所述第一神经网络的输出层之后添加随机掩膜层。
在一些实施例中,所述根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在所述可变维度的类型为中间维度可变的情况下,在所述第一神经网络的中间层添加随机掩膜层。
在一些实施例中,所述在所述第一神经网络的中间层添加随机掩膜层,包括:
在只有一个中间维度可变的情况下,在相关联的中间层之前或之后添加一个随机掩膜层。
在一些实施例中,所述在所述神经网络的中间层添加随机掩膜层,包括:
在有多个中间维度可变的情况下,在每一相关联的中间层之前或之后分别添加一个随机掩膜层。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练,包括:
在每一样本数据的输入数据的维度均为第一阈值的情况,直接利用所有的样本数据对所述第二神经网络进行训练;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练,包括:
在存在至少一个第一样本数据的情况,先对所述第一样本数据进 行增强处理,再利用所有的第一样本数据和所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述对所述第一样本数据进行增强处理,包括:
对所述第一样本数据的输入数据进行高位补零。
在一些实施例中,所述对所述第一样本数据进行增强处理,包括:
对所述第一样本数据的输入数据进行低位补零。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练,包括:
在存在至少一个第一样本数据的情况,先剔除所述第一样本数据,再利用所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述对输入至所述随机掩膜层的张量进行随机掩膜处理,包括:
确定输入至所述随机掩膜层的张量以及随机掩膜张量;
利用所述随机掩膜张量对输入至所述随机掩膜层的张量进行随机掩膜处理。
在一些实施例中,所述对输入至所述随机掩膜层的张量进行随机掩膜处理的表达式如下:
Figure PCTCN2022126458-appb-000004
其中,
Figure PCTCN2022126458-appb-000005
表示随机掩膜层输出的张量,X表示输入至随机掩膜层的张量,
Figure PCTCN2022126458-appb-000006
表示张量逐位点乘运算,M表示随机掩膜张量。
在一些实施例中,所述随机掩膜张量为硬值掩膜张量。
在一些实施例中,所述随机掩膜张量为软值掩膜张量。
在一些实施例中,所述随机掩膜张量由硬值掩膜张量和软值掩膜张量组合而成。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练之后,还包括:
将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层;所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,所述将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的输入层之前存在随机掩膜层的情况下,将经过训练后的第二神经网络的输入层之前的随机掩膜层替换为张量填充层;所述张量填充层用于将输入至所述张量填充层的张量的维度增大到第一阈值;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的输出层之后存在随机掩膜层的情况下,将经过训练后的第二神经网络的输出层之后的随机掩膜层替换为张量裁剪层;所述张量裁剪层用于将输入至所述张量裁剪层的张量的维度减小到第一目标值。
在一些实施例中,所述将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的中间层存在随机掩膜层的情况下,将经过训练后的第二神经网络的中间层的随机掩膜层替换为张量裁剪级联张量填充层;所述张量裁剪级联张量填充层用于将输入至所述张量裁剪级联张量填充层的张量的维度先减小到第二目标值,再增 大到原来的维度。
第三方面,本公开实施例提供一种神经网络操作方法,其特征在于,包括:
获取预测数据;
将所述预测数据输入至部署好的目标神经网络,得到所述目标神经网络输出的预测结果;其中,所述目标神经网络包括至少一个张量变换层,所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,所述目标神经网络为所述第一方面中的任一项所述的第二神经网络。
第四方面,本公开实施例提供一种电子设备,包括存储器,收发机,处理器;
存储器,用于存储计算机程序;收发机,用于在所述处理器的控制下收发数据;处理器,用于读取所述存储器中的计算机程序并执行以下操作:
获取预测数据;
将所述预测数据输入至部署好的目标神经网络,得到所述目标神经网络输出的预测结果;其中,所述目标神经网络包括至少一个张量变换层,所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,所述目标神经网络为所述第一方面中的任一项所述的第二神经网络。
第五方面,本公开实施例提供一种神经网络操作装置,包括:
添加模块,用于根据可变维度的类型在第一神经网络中添加随机掩膜层,得到第二神经网络;所述随机掩膜层用于对输入至所述随机掩膜层的张量进行随机掩膜处理;
训练模块,用于利用样本数据对所述第二神经网络进行训练。
在一些实施例中,所述可变维度类型包括以下类型中的一种或多种:
输入维度可变;
输出维度可变;
中间维度可变。
在一些实施例中,所述添加模块具体用于:
在所述可变维度的类型为输入维度可变的情况下,在所述第一神经网络的输入层之前添加随机掩膜层。
在一些实施例中,所述添加模块具体用于:
在所述可变维度的类型为输出维度可变的情况下,在所述第一神经网络的输出层之后添加随机掩膜层。
在一些实施例中,所述添加模块具体用于:
在所述可变维度的类型为中间维度可变的情况下,在所述第一神经网络的中间层添加随机掩膜层。
在一些实施例中,所述添加模块具体用于:
在只有一个中间维度可变的情况下,在相关联的中间层之前或之后添加一个随机掩膜层。
在一些实施例中,所述添加模块具体用于:
在有多个中间维度可变的情况下,在每一相关联的中间层之前或之后分别添加一个随机掩膜层。
在一些实施例中,所述训练模块具体用于:
在每一样本数据的输入数据的维度均为第一阈值的情况,直接利用所有的样本数据对所述第二神经网络进行训练;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述训练模块具体用于:
在存在至少一个第一样本数据的情况,先对所述第一样本数据进行增强处理,再利用所有的第一样本数据和所有的第二样本数据对所 述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述训练模块具体用于:
对所述第一样本数据的输入数据进行高位补零。
在一些实施例中,所述训练模块具体用于:
对所述第一样本数据的输入数据进行低位补零。
在一些实施例中,所述训练模块具体用于:
在存在至少一个第一样本数据的情况,先剔除所述第一样本数据,再利用所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述训练模块具体用于:
确定输入至所述随机掩膜层的张量以及随机掩膜张量;
利用所述随机掩膜张量对输入至所述随机掩膜层的张量进行随机掩膜处理。
在一些实施例中,所述对输入至所述随机掩膜层的张量进行随机掩膜处理的表达式如下:
Figure PCTCN2022126458-appb-000007
其中,
Figure PCTCN2022126458-appb-000008
表示随机掩膜层输出的张量,X表示输入至随机掩膜层的张量,
Figure PCTCN2022126458-appb-000009
表示张量逐位点乘运算,M表示随机掩膜张量。
在一些实施例中,所述随机掩膜张量为硬值掩膜张量。
在一些实施例中,所述随机掩膜张量为软值掩膜张量。
在一些实施例中,所述随机掩膜张量由硬值掩膜张量和软值掩膜张量组合而成。
在一些实施例中,还包括部署模块;
所述部署模块用于将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层;所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,所述部署模块具体用于:
在经过训练后的第二神经网络的输入层之前存在随机掩膜层的情况下,将经过训练后的第二神经网络的输入层之前的随机掩膜层替换为张量填充层;所述张量填充层用于将输入至所述张量填充层的张量的维度增大到第一阈值;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述部署模块具体用于:
在经过训练后的第二神经网络的输出层之后存在随机掩膜层的情况下,将经过训练后的第二神经网络的输出层之后的随机掩膜层替换为张量裁剪层;所述张量裁剪层用于将输入至所述张量裁剪层的张量的维度减小到第一目标值。
在一些实施例中,所述部署模块具体用于:
在经过训练后的第二神经网络的中间层存在随机掩膜层的情况下,将经过训练后的第二神经网络的中间层的随机掩膜层替换为张量裁剪级联张量填充层;所述张量裁剪级联张量填充层用于将输入至所述张量裁剪级联张量填充层的张量的维度先减小到第二目标值,再增大到原来的维度。
第六方面,本公开实施例提供一种神经网络操作装置,包括:
获取模块,用于获取预测数据;
处理模块,用于将所述预测数据输入至部署好的目标神经网络,得到所述目标神经网络输出的预测结果;其中,所述目标神经网络包括至少一个张量变换层,所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,在一些实施例中,所述目标神经网络为所述第五方面中的任一项所述的第二神经网络。
第七方面,本公开实施例还提供一种处理器可读存储介质,所述处理器可读存储介质存储有计算机程序,所述计算机程序用于使处理器执行如上所述第一方面或第三方面所述的神经网络操作方法的步骤。
第八方面,本公开实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序用于使计算机执行如上所述第一方面或第三方面所述的神经网络操作方法的步骤。
第九方面,本公开实施例还提供一种通信设备可读存储介质,所述通信设备可读存储介质存储有计算机程序,所述计算机程序用于使通信设备执行如上所述第一方面或第三方面所述的神经网络操作方法的步骤。
第十方面,本公开实施例还提供一种芯片产品可读存储介质,所述芯片产品可读存储介质存储有计算机程序,所述计算机程序用于使芯片产品执行如上所述第一方面或第三方面所述的神经网络操作方法的步骤。
本公开实施例提供的神经网络操作方法、装置及存储介质,通过在神经网络中添加随机掩膜层,仅需训练和部署一个神经网络适应不同输入输出维度要求,该方法训练复杂度低、存储开销低,易于部署和在线训练持续演进。
附图说明
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普 通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是现有技术中维度可变的神经网络的训练方法的原理图;
图2是本公开实施例提供的神经网络操作方法的流程示意图;
图3是本公开实施例提供的维度可变神经网络训练框图;
图4是本公开实施例提供的硬值掩膜张量示意图;
图5是本公开实施例提供的维度可变神经网络部署框图;
图6是本公开实施例提供的张量填充与张量裁剪模块示意图;
图7是本公开实施例提供的自编码器神经网络示意图;
图8是本公开实施例提供的单符号和双符号DMRS示意图;
图9是本公开实施例提供的基于自编码器的CSI压缩反馈框图;
图10是本公开实施例提供的一种电子设备的结构示意图;
图11是本公开实施例提供的一种神经网络操作装置的结构示意图。
具体实施方式
人工神经网络是从信息处理角度对人脑的神经元网络进行抽象建立的一种简化模型。在学术界和工业界,人工神经网络简称为神经网络,是一种由大量计算节点按特定方式相互连接构成的计算模型,该模型通常是对某种算法、某种函数映射的表达或近似表达。在神经网络的训练阶段,工程人员首先需要确定神经网络的结构、超参数,然后将数据喂入模型并给予梯度反向传播更新训练神经网络的权重。训练好的神经网络是输入数据与标签之间映射关系的一种近似,在部署阶段将新的数据喂入神经网络就可以得到预测值。常见的神经网络有全连接前馈神经网络、卷积神经网络、递归神经网络等。随着计算机性能的提升以及图形处理器(GPU)的大量部署,神经网络在计算机视觉、自然语言处理、生物医学、自动控制领域的应用已经十分普遍。
神经网络的训练和部署通常是面向具体任务的,因此神经网络的输入和输出维度一般是确定的。面向A任务训练的神经网络通常无法用于B任务,或者用于B任务时性能较差。当神经网络输入和输出维度不确定时,需要对所有可能的输入和输出维度分别训练一个神经网络以应对不同维度和任务需求。例如,系统根据部署的神经网络预测值做出响应,神经网络的输入是实时采集到的数据。当系统实时性要求较高时,系统希望神经网络基于采集到的部分数据也能给出一些“粗糙的”预测结果,以便系统提前向较优方向响应,从而节省向最优方向响应的总时间。现有可行的解决方案便是对不同输入数据维度(采集到部分数据导致输入维度不同)分别训练一个神经网络,如图1所示。系统根据输入维度会自动选择相应的神经网络做出预测,随着输入维度的不断增大(采集到实时的数据从部分到完整),神经网络的预测值由“粗糙”逐渐转向“准确”。
当神经网络的输入和输出维度不确定时,现有技术需要部署多个神经网络以应对不同的输入输出维度要求。神经网络的个数会随着维度可能的情况增加而增加,模型训练的复杂度高,模型存储开销大,不利于实际部署和神经网络在线学习持续演进。
基于上述技术问题,本公开实施例提出一种神经网络操作方法、装置及存储介质,该方法通过在神经网络中添加随机掩膜层,仅需训练和部署一个神经网络适应不同输入输出维度要求,训练复杂度低、存储开销低,易于部署和在线训练持续演进。
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
图2是本公开实施例提供的神经网络操作方法的流程示意图,如图2所示,本公开实施例提供一种神经网络操作方法,其执行主体可以为电子设备,例如,终端、基站、核心网网元等。该方法包括:
步骤201、根据可变维度的类型在第一神经网络中添加随机掩膜层,得到第二神经网络;该随机掩膜层用于对输入至该随机掩膜层的张量进行随机掩膜处理;
步骤202、利用样本数据对该第二神经网络进行训练。
在一些实施例中,该可变维度类型包括以下类型中的一种或多种:
输入维度可变;
输出维度可变;
中间维度可变。
在一些实施例中,根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在该可变维度的类型为输入维度可变的情况下,在该第一神经网络的输入层之前添加随机掩膜层。
在一些实施例中,根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在该可变维度的类型为输出维度可变的情况下,在该第一神经网络的输出层之后添加随机掩膜层。
在一些实施例中,根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在该可变维度的类型为中间维度可变的情况下,在该第一神经网络的中间层添加随机掩膜层。
在一些实施例中,在该第一神经网络的中间层添加随机掩膜层,包括:
在只有一个中间维度可变的情况下,在相关联的中间层之前或之后添加一个随机掩膜层。
在一些实施例中,在该神经网络的中间层添加随机掩膜层,包括:
在有多个中间维度可变的情况下,在每一相关联的中间层之前或之后分别添加一个随机掩膜层。
在一些实施例中,利用样本数据对该第二神经网络进行训练,包括:
在每一样本数据的输入数据的维度均为第一阈值的情况,直接利用所有的样本数据对该第二神经网络进行训练;该第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,利用样本数据对该第二神经网络进行训练,包括:
在存在至少一个第一样本数据的情况,先对该第一样本数据进行增强处理,再利用所有的第一样本数据和所有的第二样本数据对该第二神经网络进行训练;该第一样本数据为输入数据的维度不为第一阈值的样本数据;该第二样本数据为输入数据的维度为该第一阈值的样本数据;该第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,对该第一样本数据进行增强处理,包括:
对该第一样本数据的输入数据进行高位补零。
在一些实施例中,对该第一样本数据进行增强处理,包括:
对该第一样本数据的输入数据进行低位补零。
在一些实施例中,利用样本数据对该第二神经网络进行训练,包括:
在存在至少一个第一样本数据的情况,先剔除该第一样本数据,再利用所有的第二样本数据对该第二神经网络进行训练;该第一样本数据为输入数据的维度不为第一阈值的样本数据;该第二样本数据为输入数据的维度为该第一阈值的样本数据;该第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,对输入至该随机掩膜层的张量进行随机掩膜处 理,包括:
确定输入至该随机掩膜层的张量以及随机掩膜张量;
利用该随机掩膜张量对输入至该随机掩膜层的张量进行随机掩膜处理。
在一些实施例中,该对输入至该随机掩膜层的张量进行随机掩膜处理的表达式如下:
Figure PCTCN2022126458-appb-000010
其中,
Figure PCTCN2022126458-appb-000011
表示随机掩膜层输出的张量,X表示输入至随机掩膜层的张量,
Figure PCTCN2022126458-appb-000012
表示张量逐位点乘运算,M表示随机掩膜张量。
在一些实施例中,该随机掩膜张量为硬值掩膜张量。
在一些实施例中,该随机掩膜张量为软值掩膜张量。
在一些实施例中,该随机掩膜张量由硬值掩膜张量和软值掩膜张量组合而成。
在一些实施例中,利用样本数据对该第二神经网络进行训练之后,还包括:
将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层;该张量变换层用于对输入至该张量变换层的张量进行维度变换。
在一些实施例中,将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的输入层之前存在随机掩膜层的情况下,将经过训练后的第二神经网络的输入层之前的随机掩膜层替换为张量填充层;该张量填充层用于将输入至该张量填充层的张量的维度增大到第一阈值;该第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的输出层之后存在随机掩膜层的 情况下,将经过训练后的第二神经网络的输出层之后的随机掩膜层替换为张量裁剪层;该张量裁剪层用于将输入至该张量裁剪层的张量的维度减小到第一目标值。
在一些实施例中,将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的中间层存在随机掩膜层的情况下,将经过训练后的第二神经网络的中间层的随机掩膜层替换为张量裁剪级联张量填充层;该张量裁剪级联张量填充层用于将输入至该张量裁剪级联张量填充层的张量的维度先减小到第二目标值,再增大到原来的维度。
本公开实施例根据训练数据的最大维度、标签的最大维度,以及任务要求确定神经输入层、输出层、一些中间层的输入张量维度、输出张量维度。
图3是本公开实施例提供的维度可变神经网络训练框图,如图3所示,在训练阶段,对需要维度可变的张量所对应的层添加输随机掩膜模块(也可称为“随机掩膜层”)来训练网络。具体可以包括如下步骤:
1、如果神经网络输入的维度可变,则在输入层左侧添加随机掩膜模块;
2、如果神经网络输出的维度可变,则在输出层右侧添加随机掩膜模块;
3、如果神经网络中第i个中间层的输出与第i+1个中间层的输入维度可变,则在中间层i与中间层i+1之间添加随机掩膜模块;
4、若神经网络的输入、输出、中间层同时存在多个维度可变要求,则在相应位置添加多个随机掩膜模块。
5、在输入层左侧,训练数据可以只采用最大维度的数据(如果存在非最大维度的数据,可以先剔除这些数据),也可以训练之前先 做数据增强处理,通过高位或者低位补零方式,把低维度的输入数据增加到最大维度。
通过添加随机掩膜模块后,神经网络通过计算损失函数关于神经网络权重的梯度值更新训练神经网络。随机掩膜操作(随机掩膜处理)对张量X作用,表示为
Figure PCTCN2022126458-appb-000013
其中,
Figure PCTCN2022126458-appb-000014
X,M均为
Figure PCTCN2022126458-appb-000015
维度(例如,X是长度64,宽度64的图片,那么L X=64×64×3,3表示红绿蓝三基色通道)的R X阶张量,
Figure PCTCN2022126458-appb-000016
是输入张量第i阶的维度,运算
Figure PCTCN2022126458-appb-000017
表示张量逐位点乘,M是(随机)掩膜张量,
Figure PCTCN2022126458-appb-000018
是掩膜结果。掩膜张量M为随机张量,对于每一个训练样本、每一个训练周期(Epoch)都是独立同分布的。R X阶的掩膜张量M,维度为
Figure PCTCN2022126458-appb-000019
Figure PCTCN2022126458-appb-000020
可以是但不限于:
1、硬值掩膜(Hard-Masking)
Figure PCTCN2022126458-appb-000021
表示需要掩膜的阶数(例如,对6×6×3维度的图片,长宽6×6维度掩膜,对红绿蓝三基色通道的3维度不做掩膜,则I={1,2},如图4所示,3阶张量维度是6×6×3,对于
Figure PCTCN2022126458-appb-000022
Figure PCTCN2022126458-appb-000023
t=3和t=4)。张量
Figure PCTCN2022126458-appb-000024
索引为
Figure PCTCN2022126458-appb-000025
的元素取值如下:
Figure PCTCN2022126458-appb-000026
其中,整数
Figure PCTCN2022126458-appb-000027
服从某一给定概率分布(例如,均匀分布),对于每个I i,t独立同分布。
2、软值掩膜(Soft-Masking)
例如,指数衰减的软值掩膜
Figure PCTCN2022126458-appb-000028
张量
Figure PCTCN2022126458-appb-000029
索引为
Figure PCTCN2022126458-appb-000030
的元素取值如下:
Figure PCTCN2022126458-appb-000031
其中,实数λ∈[0,λ max]服从某一分布(例如,均匀分布),对于每个I i,λ也是独立同分布。
3、在M中,还可以一部分采用硬值掩膜,一部分采用软值掩膜,也即硬值掩膜与软值掩膜的组合。
上述掩膜张量作用于某一张量时,不会改变张量本身维度,等价于对该张量进行加权操作,
Figure PCTCN2022126458-appb-000032
索引小的位置的张量值分配更大权重。
例如,对于一阶张量(向量),硬值掩膜
Figure PCTCN2022126458-appb-000033
Figure PCTCN2022126458-appb-000034
是一个前t位为1后
Figure PCTCN2022126458-appb-000035
位为0的向量,
Figure PCTCN2022126458-appb-000036
Figure PCTCN2022126458-appb-000037
等价于对X的后
Figure PCTCN2022126458-appb-000038
位数值置零,张量维度不变。
训练过程中,优化器基于损失计算梯度反向传播,并更新神经网络权值参数。
此外,在图3中还可以包含如下内容:
1、神经网络可以是但不限于卷积神经网络、前馈全连接神经网络、递归神经网络及其组合;
2、损失函数可以是但不限于均方误差、1范数、分类交叉熵、余弦相似度;
3、随机掩膜模块通过自定义梯度,掩膜张量当作常数张量等方式,避免梯度消失或不可导问题;
4、输入侧随机掩膜、输出侧随机掩膜、中间层随机掩膜可以同时存在,也可以只存在其中几个,具体使用几个可以根据具体任务确定。
图5是本公开实施例提供的维度可变神经网络部署框图,如图5所示,在部署阶段,维度可变的神经网络通过对训练好的神经网络移除随机掩膜模块,添加张量填充模块(也可称为“张量填充层”)和张 量裁剪模块(也可称为“张量裁剪层”)来构造。具体可以包括如下步骤:
1、输入层左侧的随机掩膜模块替换为张量填充模块,通过低位或者高位补零方式将输入张量填充至最大输入维度;
2、输出层右侧的随机掩膜模块替换为张量裁剪模块,通过高位或者低位裁剪方式输出张量;
3、中间层i与中间层i+1之间的随机掩膜模块替换为,张量裁剪模块级联张量填充模块。
在整个过程中,仅需训练和部署一个神经网络便可适应不同的输入输出维度要求,避免了多个神经网络训练和存储问题。
维度可变的神经网络基于上述训练好的神经网络,移除随机掩膜模块,替换张量填充和张量剪裁模块来构造,如图5所示。替换的张量填充和张量裁剪模块如图6所示,当输入张量X第i阶长度小于
Figure PCTCN2022126458-appb-000039
则采取对高位或者低位补零来填充张量使得第i阶的维数等于
Figure PCTCN2022126458-appb-000040
1、若采取高位补零,训练过程如图3一样;
2、若采取低位补零,则张量X所对应的随机掩膜张量M,第i阶索引还需要额外增加反向重排操作。
当输出张量X的第i阶维度大于要求维度时,输出张量X通过截取低位或者高位的方式剪裁张量,目的是得到满足输出维度要求的张量
Figure PCTCN2022126458-appb-000041
1、若采取低位截取,训练过程与图3一样;
2、若采取高位截取,则在训练阶段张量X对应的随机掩膜张量M,第i阶索引还需要额外增加反向重排操作。
可以看到,系统仅需一个神经网络部署,输出张量按需剪裁,输入张量补零填充就可以满足不同输入输出维度要求。
下面以几个具体的实施例,对上述方法进行进一步说明。
实施例1:
如图7所示,神经网络为一个自编码器,用于图像压缩,其中编码器模块用于压缩图片,解码器模块用于恢复图片。编码器输入和解码器输出均为
Figure PCTCN2022126458-appb-000042
维的图片,编码器输出(也是解码器的输入)维度要求可变,最大维度为L Z=8192。在训练阶段,编码器与译码器之间添加随机硬值掩膜模块,掩膜张量的参数t∈[0,8192]服从均匀分布,采用Adam优化器训练自编码器神经网络。当神经网络训练完成后,编码器被部署在发送端,解码器被部署在接收端。发送端根据压缩率要求,截取编码器输出张量;接收端根据接收到的张量长度确定张量填充比特数并填充张量,然后送入解码器恢复图片。
实施例2:
与实施例1一样,自编码器用于图像压缩,编码器输入和解码器输出均为
Figure PCTCN2022126458-appb-000043
维的图片,编码器输出(也是译码器的输入)维度可变,最大维度为L Z=128×128×3×(1-η min)。编码特征Z维度越小,压缩率
Figure PCTCN2022126458-appb-000044
越高,恢复的图像越模糊;编码特征维度越大,压缩率η越低,恢复的图像越清晰。压缩率的可能值为
Figure PCTCN2022126458-appb-000045
在训练阶段,硬值掩膜模块的参数t∈{8192,4096,2048,1024}服从等概率分布
Figure PCTCN2022126458-appb-000046
Figure PCTCN2022126458-appb-000047
作用于编码器输出。
实施例3:
基于人工智能的信道估计算法中,接收端根据解调参考信号(DMRS)的接收值,估计出所有时频资源块上的信道系数,信道恢复算法基于神经网络实现的。在单个时隙(14个OFDM符号),8个物理资源块(96个频点)下,单符号DMRS和双符号DMRS配置如图8所示。单符号DMRS配置对应于神经网络输入维度是48×1×2(48对 应频率,1对应时间,2对应复数的实部和虚部),双符号DMRS配置(在单符号配置基础上再额外配置一个DMRS符号)对应于神经网络输入维度48×2×2,神经网络的输出维度是96×14×2。用于信道估计的神经网络最大输入维度是L X=48×2×2,训练阶段对输入张量第2阶的索引维度(时间维度)进行软值掩膜,参数λ∈[0,20]均匀分布。部署后的输入维度可变的神经网络同时用于单符号和双符号DMRS配置的信道估计。
实施例4:
与实施例3一样,在单个时隙(14个OFDM符号)、8个物理资源块(96个频点)下,单符号DMRS配置对应于神经网络输入维度48×1×2,双符号DMRS配置对应于神经网络输入维度48×2×2。用于信道估计的神经网络最大输入维度是L X=48×2×2。在训练阶段,对输入张量第2阶的索引维度(时间维度)进行硬值掩膜,参数为t=1,2,概率分布为
Figure PCTCN2022126458-appb-000048
实施例5:
如图9所示,基于人工智能的信道状态信息(CSI)压缩算法采用自编码器实现,编码器部署于UE侧,解码器部署于基站侧。UE侧基于CSI参考信号(RS)估计出信道H并计算预编码向量V,预编码向量V的维度大小为n band×n T×2=12×32×2=768,其中n band=12表示12个子带,n T=32表示32根发天线,2表示实部虚部。编码器将768维度的V输入值编码器压缩成一个向量,张量裁剪模块根据需要反馈的比特数k裁剪编码器的输出后发送给基站测。基站侧根据反馈比特数对接收到的比特流做张量填充,并输入到解码器恢复出预编码向量
Figure PCTCN2022126458-appb-000049
在训练阶段,自编码的编码器与解码器之间添加张量掩膜模块,采用随机硬值掩膜,掩膜张量的参数t∈[1,384]服从均匀分布,损失函数为余弦相似度。
本公开实施例提出的神经网络操作方法,仅需训练和部署一个神 经网络适应不同输入输出维度要求,该方法训练复杂度低、存储开销低,易于部署和在线训练持续演进。
图10是本公开实施例提供的一种电子设备的结构示意图,如图10所示,所述电子设备包括存储器1020,收发机1000,处理器1010,其中:
存储器1020,用于存储计算机程序;收发机1000,用于在所述处理器1010的控制下收发数据;处理器1010,用于读取所述存储器1020中的计算机程序并执行以下操作:
根据可变维度的类型在第一神经网络中添加随机掩膜层,得到第二神经网络;所述随机掩膜层用于对输入至所述随机掩膜层的张量进行随机掩膜处理;
利用样本数据对所述第二神经网络进行训练。
具体地,收发机1000,用于在处理器1010的控制下接收和发送数据。
其中,在图10中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器1010代表的一个或多个处理器和存储器1020代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。收发机1000可以是多个元件,即包括发送机和接收机,提供用于在传输介质上与各种其他装置通信的单元,这些传输介质包括无线信道、有线信道、光缆等传输介质。处理器1010负责管理总线架构和通常的处理,存储器1020可以存储处理器1010在执行操作时所使用的数据。
处理器1010可以是中央处理器(CPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或复杂可编程逻辑器件 (Complex Programmable Logic Device,CPLD),处理器也可以采用多核架构。
在一些实施例中,所述可变维度类型包括以下类型中的一种或多种:
输入维度可变;
输出维度可变;
中间维度可变。
在一些实施例中,所述根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在所述可变维度的类型为输入维度可变的情况下,在所述第一神经网络的输入层之前添加随机掩膜层。
在一些实施例中,所述根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在所述可变维度的类型为输出维度可变的情况下,在所述第一神经网络的输出层之后添加随机掩膜层。
在一些实施例中,所述根据可变维度的类型在第一神经网络中添加随机掩膜层,包括:
在所述可变维度的类型为中间维度可变的情况下,在所述第一神经网络的中间层添加随机掩膜层。
在一些实施例中,所述在所述第一神经网络的中间层添加随机掩膜层,包括:
在只有一个中间维度可变的情况下,在相关联的中间层之前或之后添加一个随机掩膜层。
在一些实施例中,所述在所述神经网络的中间层添加随机掩膜层,包括:
在有多个中间维度可变的情况下,在每一相关联的中间层之前或之后分别添加一个随机掩膜层。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练,包括:
在每一样本数据的输入数据的维度均为第一阈值的情况,直接利用所有的样本数据对所述第二神经网络进行训练;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练,包括:
在存在至少一个第一样本数据的情况,先对所述第一样本数据进行增强处理,再利用所有的第一样本数据和所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述对所述第一样本数据进行增强处理,包括:
对所述第一样本数据的输入数据进行高位补零。
在一些实施例中,所述对所述第一样本数据进行增强处理,包括:
对所述第一样本数据的输入数据进行低位补零。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练,包括:
在存在至少一个第一样本数据的情况,先剔除所述第一样本数据,再利用所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述对输入至所述随机掩膜层的张量进行随机掩膜处理,包括:
确定输入至所述随机掩膜层的张量以及随机掩膜张量;
利用所述随机掩膜张量对输入至所述随机掩膜层的张量进行随机掩膜处理。
在一些实施例中,所述对输入至所述随机掩膜层的张量进行随机掩膜处理的表达式如下:
Figure PCTCN2022126458-appb-000050
其中,
Figure PCTCN2022126458-appb-000051
表示随机掩膜层输出的张量,X表示输入至随机掩膜层的张量,
Figure PCTCN2022126458-appb-000052
表示张量逐位点乘运算,M表示随机掩膜张量。
在一些实施例中,所述随机掩膜张量为硬值掩膜张量。
在一些实施例中,所述随机掩膜张量为软值掩膜张量。
在一些实施例中,所述随机掩膜张量由硬值掩膜张量和软值掩膜张量组合而成。
在一些实施例中,所述利用样本数据对所述第二神经网络进行训练之后,还包括:
将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层;所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,所述将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的输入层之前存在随机掩膜层的情况下,将经过训练后的第二神经网络的输入层之前的随机掩膜层替换为张量填充层;所述张量填充层用于将输入至所述张量填充层的张量的维度增大到第一阈值;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的输出层之后存在随机掩膜层的情况下,将经过训练后的第二神经网络的输出层之后的随机掩膜层替 换为张量裁剪层;所述张量裁剪层用于将输入至所述张量裁剪层的张量的维度减小到第一目标值。
在一些实施例中,所述将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层,包括:
在经过训练后的第二神经网络的中间层存在随机掩膜层的情况下,将经过训练后的第二神经网络的中间层的随机掩膜层替换为张量裁剪级联张量填充层;所述张量裁剪级联张量填充层用于将输入至所述张量裁剪级联张量填充层的张量的维度先减小到第二目标值,再增大到原来的维度。
具体地,本公开实施例提供的上述电子设备,能够实现上述执行主体为电子设备的方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。
本公开实施例还提供一种神经网络操作方法,包括:
获取预测数据;
将所述预测数据输入至部署好的目标神经网络,得到所述目标神经网络输出的预测结果;其中,所述目标神经网络包括至少一个张量变换层,所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,所述目标神经网络为上述实施例中的任一项所述的第二神经网络。
本公开实施例提出的神经网络操作方法,仅需训练和部署一个神经网络适应不同输入输出维度要求,该方法训练复杂度低、存储开销低,易于部署和在线训练持续演进。
本公开实施例还提供一种电子设备,包括存储器,收发机,处理器,其中:
存储器,用于存储计算机程序;收发机,用于在所述处理器的控 制下收发数据;处理器,用于读取所述存储器中的计算机程序并执行以下操作:
获取预测数据;
将所述预测数据输入至部署好的目标神经网络,得到所述目标神经网络输出的预测结果;其中,所述目标神经网络包括至少一个张量变换层,所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
具体地,收发机,用于在处理器的控制下接收和发送数据。
总线架构可以包括任意数量的互联的总线和桥,具体由处理器代表的一个或多个处理器和存储器代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。收发机可以是多个元件,即包括发送机和接收机,提供用于在传输介质上与各种其他装置通信的单元,这些传输介质包括无线信道、有线信道、光缆等传输介质。处理器负责管理总线架构和通常的处理,存储器可以存储处理器在执行操作时所使用的数据。
处理器可以是中央处理器(CPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或复杂可编程逻辑器件(Complex Programmable Logic Device,CPLD),处理器也可以采用多核架构。
在一些实施例中,所述目标神经网络为上述实施例中的任一项所述的第二神经网络。
本公开实施例提出的电子设备,仅需训练和部署一个神经网络适应不同输入输出维度要求,该方法训练复杂度低、存储开销低,易于部署和在线训练持续演进。
图11是本公开实施例提供的一种神经网络操作装置的结构示意 图,如图11所示,本公开实施例提供一种神经网络操作装置,包括添加模块1101和训练模块1102,其中:
添加模块1101用于根据可变维度的类型在第一神经网络中添加随机掩膜层,得到第二神经网络;所述随机掩膜层用于对输入至所述随机掩膜层的张量进行随机掩膜处理;训练模块1102用于利用样本数据对所述第二神经网络进行训练。
在一些实施例中,所述可变维度类型包括以下类型中的一种或多种:
输入维度可变;
输出维度可变;
中间维度可变。
在一些实施例中,所述添加模块具体用于:
在所述可变维度的类型为输入维度可变的情况下,在所述第一神经网络的输入层之前添加随机掩膜层。
在一些实施例中,所述添加模块具体用于:
在所述可变维度的类型为输出维度可变的情况下,在所述第一神经网络的输出层之后添加随机掩膜层。
在一些实施例中,所述添加模块具体用于:
在所述可变维度的类型为中间维度可变的情况下,在所述第一神经网络的中间层添加随机掩膜层。
在一些实施例中,所述添加模块具体用于:
在只有一个中间维度可变的情况下,在相关联的中间层之前或之后添加一个随机掩膜层。
在一些实施例中,所述添加模块具体用于:
在有多个中间维度可变的情况下,在每一相关联的中间层之前或之后分别添加一个随机掩膜层。
在一些实施例中,所述训练模块具体用于:
在每一样本数据的输入数据的维度均为第一阈值的情况,直接利用所有的样本数据对所述第二神经网络进行训练;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述训练模块具体用于:
在存在至少一个第一样本数据的情况,先对所述第一样本数据进行增强处理,再利用所有的第一样本数据和所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述训练模块具体用于:
对所述第一样本数据的输入数据进行高位补零。
在一些实施例中,所述训练模块具体用于:
对所述第一样本数据的输入数据进行低位补零。
在一些实施例中,所述训练模块具体用于:
在存在至少一个第一样本数据的情况,先剔除所述第一样本数据,再利用所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述训练模块具体用于:
确定输入至所述随机掩膜层的张量以及随机掩膜张量;
利用所述随机掩膜张量对输入至所述随机掩膜层的张量进行随机掩膜处理。
在一些实施例中,所述对输入至所述随机掩膜层的张量进行随机掩膜处理的表达式如下:
Figure PCTCN2022126458-appb-000053
其中,
Figure PCTCN2022126458-appb-000054
表示随机掩膜层输出的张量,X表示输入至随机掩膜层的张量,
Figure PCTCN2022126458-appb-000055
表示张量逐位点乘运算,M表示随机掩膜张量。
在一些实施例中,所述随机掩膜张量为硬值掩膜张量。
在一些实施例中,所述随机掩膜张量为软值掩膜张量。
在一些实施例中,所述随机掩膜张量由硬值掩膜张量和软值掩膜张量组合而成。
在一些实施例中,还包括部署模块;
所述部署模块用于将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层;所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,所述部署模块具体用于:
在经过训练后的第二神经网络的输入层之前存在随机掩膜层的情况下,将经过训练后的第二神经网络的输入层之前的随机掩膜层替换为张量填充层;所述张量填充层用于将输入至所述张量填充层的张量的维度增大到第一阈值;所述第一阈值为所有样本数据的输入数据的维度的最大值。
在一些实施例中,所述部署模块具体用于:
在经过训练后的第二神经网络的输出层之后存在随机掩膜层的情况下,将经过训练后的第二神经网络的输出层之后的随机掩膜层替换为张量裁剪层;所述张量裁剪层用于将输入至所述张量裁剪层的张量的维度减小到第一目标值。
在一些实施例中,所述部署模块具体用于:
在经过训练后的第二神经网络的中间层存在随机掩膜层的情况下,将经过训练后的第二神经网络的中间层的随机掩膜层替换为张量裁剪级联张量填充层;所述张量裁剪级联张量填充层用于将输入至所述张量裁剪级联张量填充层的张量的维度先减小到第二目标值,再增大到原来的维度。
具体地,本公开实施例提供的上述神经网络操作装置,能够实现上述执行主体为电子设备的方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。
本公开实施例还提供一种神经网络操作装置,包括:
获取模块,用于获取预测数据;
处理模块,用于将所述预测数据输入至部署好的目标神经网络,得到所述目标神经网络输出的预测结果;其中,所述目标神经网络包括至少一个张量变换层,所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
在一些实施例中,所述目标神经网络为上述实施例中的任一项所述的第二神经网络。
本公开实施例提出的神经网络操作装置,仅需训练和部署一个神经网络适应不同输入输出维度要求,该方法训练复杂度低、存储开销低,易于部署和在线训练持续演进。
需要说明的是,本公开上述各实施例中对单元/模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处 理器(processor)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
在一些实施例中,还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序用于使计算机执行上述各方法实施例提供的神经网络操作方法的步骤。
具体地,本公开实施例提供的上述计算机可读存储介质,能够实现上述各方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。
需要说明的是:所述计算机可读存储介质可以是处理器能够存取的任何可用介质或数据存储设备,包括但不限于磁性存储器(例如软盘、硬盘、磁带、磁光盘(MO)等)、光学存储器(例如CD、DVD、BD、HVD等)、以及半导体存储器(例如ROM、EPROM、EEPROM、非易失性存储器(NAND FLASH)、固态硬盘(SSD))等。
另外需要说明的是:本公开实施例中术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,以便本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”所区别的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。
本公开实施例中术语“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
本公开实施例中术语“多个”是指两个或两个以上,其它量词与之 类似。
本公开实施例提供的技术方案可以适用于多种系统,尤其是5G系统。例如适用的系统可以是全球移动通讯(global system of mobile communication,GSM)系统、码分多址(code division multiple access,CDMA)系统、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)通用分组无线业务(general packet radio service,GPRS)系统、长期演进(long term evolution,LTE)系统、LTE频分双工(frequency division duplex,FDD)系统、LTE时分双工(time division duplex,TDD)系统、高级长期演进(long term evolution advanced,LTE-A)系统、通用移动系统(universal mobile telecommunication system,UMTS)、全球互联微波接入(worldwide interoperability for microwave access,WiMAX)系统、5G新空口(New Radio,NR)系统等。这多种系统中均包括终端设备和网络设备。系统中还可以包括核心网部分,例如演进的分组系统(Evloved Packet System,EPS)、5G系统(5GS)等。
本公开实施例涉及的终端设备,可以是指向用户提供语音和/或数据连通性的设备,具有无线连接功能的手持式设备、或连接到无线调制解调器的其他处理设备等。在不同的系统中,终端设备的名称可能也不相同,例如在5G系统中,终端设备可以称为用户设备(User Equipment,UE)。无线终端设备可以经无线接入网(Radio Access Network,RAN)与一个或多个核心网(Core Network,CN)进行通信,无线终端设备可以是移动终端设备,如移动电话(或称为“蜂窝”电话)和具有移动终端设备的计算机,例如,可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置,它们与无线接入网交换语言和/或数据。例如,个人通信业务(Personal Communication Service,PCS)电话、无绳电话、会话发起协议(Session Initiated Protocol,SIP)话机、无线本地环路(Wireless Local Loop,WLL)站、个人数字助 理(Personal Digital Assistant,PDA)等设备。无线终端设备也可以称为系统、订户单元(subscriber unit)、订户站(subscriber station),移动站(mobile station)、移动台(mobile)、远程站(remote station)、接入点(access point)、远程终端设备(remote terminal)、接入终端设备(access terminal)、用户终端设备(user terminal)、用户代理(user agent)、用户装置(user device),本公开实施例中并不限定。
本公开实施例涉及的网络设备,可以是基站,该基站可以包括多个为终端提供服务的小区。根据具体应用场合不同,基站又可以称为接入点,或者可以是接入网中在空中接口上通过一个或多个扇区与无线终端设备通信的设备,或者其它名称。网络设备可用于将收到的空中帧与网际协议(Internet Protocol,IP)分组进行相互更换,作为无线终端设备与接入网的其余部分之间的路由器,其中接入网的其余部分可包括网际协议(IP)通信网络。网络设备还可协调对空中接口的属性管理。例如,本公开实施例涉及的网络设备可以是全球移动通信系统(Global System for Mobile communications,GSM)或码分多址接入(Code Division Multiple Access,CDMA)中的网络设备(Base Transceiver Station,BTS),也可以是带宽码分多址接入(Wide-band Code Division Multiple Access,WCDMA)中的网络设备(NodeB),还可以是长期演进(long term evolution,LTE)系统中的演进型网络设备(evolutional Node B,eNB或e-NodeB)、5G网络架构(next generation system)中的5G基站(gNB),也可以是家庭演进基站(Home evolved Node B,HeNB)、中继节点(relay node)、家庭基站(femto)、微微基站(pico)等,本公开实施例中并不限定。在一些网络结构中,网络设备可以包括集中单元(centralized unit,CU)节点和分布单元(distributed unit,DU)节点,集中单元和分布单元也可以地理上分开布置。
网络设备与终端设备之间可以各自使用一或多根天线进行多输 入多输出(Multi Input Multi Output,MIMO)传输,MIMO传输可以是单用户MIMO(Single User MIMO,SU-MIMO)或多用户MIMO(Multiple User MIMO,MU-MIMO)。根据根天线组合的形态和数量,MIMO传输可以是2D-MIMO、3D-MIMO、FD-MIMO或massive-MIMO,也可以是分集传输或预编码传输或波束赋形传输等。
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机可执行指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机可执行指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些处理器可执行指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的处理器可读存储器中,使得存储在该处理器可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些处理器可执行指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指 令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本公开进行各种改动和变型而不脱离本公开的精神和范围。这样,倘若本公开的这些修改和变型属于本公开权利要求及其等同技术的范围之内,则本公开也意图包含这些改动和变型在内。

Claims (70)

  1. 一种神经网络操作方法,其特征在于,包括:
    根据可变维度的类型在第一神经网络中设置随机掩膜层,得到第二神经网络;所述随机掩膜层用于对输入至所述随机掩膜层的张量进行随机掩膜处理;
    利用样本数据对所述第二神经网络进行训练。
  2. 根据权利要求1所述的神经网络操作方法,其特征在于,所述可变维度类型包括以下类型中的一种或多种:
    输入维度可变;
    输出维度可变;
    中间维度可变。
  3. 根据权利要求2所述的神经网络操作方法,其特征在于,所述根据可变维度的类型在第一神经网络中设置随机掩膜层,包括:
    在所述可变维度的类型为输入维度可变的情况下,在所述第一神经网络的输入层之前设置随机掩膜层。
  4. 根据权利要求2所述的神经网络操作方法,其特征在于,所述根据可变维度的类型在第一神经网络中设置随机掩膜层,包括:
    在所述可变维度的类型为输出维度可变的情况下,在所述第一神经网络的输出层之后设置随机掩膜层。
  5. 根据权利要求2所述的神经网络操作方法,其特征在于,所述根据可变维度的类型在第一神经网络中设置随机掩膜层,包括:
    在所述可变维度的类型为中间维度可变的情况下,在所述第一神经网络的中间层设置随机掩膜层。
  6. 根据权利要求5所述的神经网络操作方法,其特征在于,所述在所述第一神经网络的中间层设置随机掩膜层,包括:
    在只有一个中间维度可变的情况下,在相关联的中间层之前或之后设置一个随机掩膜层。
  7. 根据权利要求5所述的神经网络操作方法,其特征在于,所述在所述神经网络的中间层设置随机掩膜层,包括:
    在有多个中间维度可变的情况下,在每一相关联的中间层之前或之后分别设置一个随机掩膜层。
  8. 根据权利要求1所述的神经网络操作方法,其特征在于,所述利用样本数据对所述第二神经网络进行训练,包括:
    在每一样本数据的输入数据的维度均为第一阈值的情况,直接利用所有的样本数据对所述第二神经网络进行训练;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  9. 根据权利要求1所述的神经网络操作方法,其特征在于,所述利用样本数据对所述第二神经网络进行训练,包括:
    在存在至少一个第一样本数据的情况,先对所述第一样本数据进行增强处理,再利用所有的第一样本数据和所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  10. 根据权利要求9所述的神经网络操作方法,其特征在于,所述对所述第一样本数据进行增强处理,包括:
    对所述第一样本数据的输入数据进行高位补零。
  11. 根据权利要求9所述的神经网络操作方法,其特征在于,所述对所述第一样本数据进行增强处理,包括:
    对所述第一样本数据的输入数据进行低位补零。
  12. 根据权利要求1所述的神经网络操作方法,其特征在于,所述利用样本数据对所述第二神经网络进行训练,包括:
    在存在至少一个第一样本数据的情况,先剔除所述第一样本数据,再利用所有的第二样本数据对所述第二神经网络进行训练;所述第一 样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  13. 根据权利要求1所述的神经网络操作方法,其特征在于,所述对输入至所述随机掩膜层的张量进行随机掩膜处理,包括:
    确定输入至所述随机掩膜层的张量以及随机掩膜张量;
    利用所述随机掩膜张量对输入至所述随机掩膜层的张量进行随机掩膜处理。
  14. 根据权利要求13所述的神经网络操作方法,其特征在于,所述对输入至所述随机掩膜层的张量进行随机掩膜处理的表达式如下:
    Figure PCTCN2022126458-appb-100001
    其中,
    Figure PCTCN2022126458-appb-100002
    表示随机掩膜层输出的张量,X表示输入至随机掩膜层的张量,
    Figure PCTCN2022126458-appb-100003
    表示张量逐位点乘运算,M表示随机掩膜张量。
  15. 根据权利要求13所述的神经网络操作方法,其特征在于,所述随机掩膜张量为硬值掩膜张量。
  16. 根据权利要求13所述的神经网络操作方法,其特征在于,所述随机掩膜张量为软值掩膜张量。
  17. 根据权利要求13所述的神经网络操作方法,其特征在于,所述随机掩膜张量由硬值掩膜张量和软值掩膜张量组合而成。
  18. 根据权利要求1所述的神经网络操作方法,其特征在于,所述利用样本数据对所述第二神经网络进行训练之后,还包括:
    将经过训练后的第二神经网络中的随机掩膜层更新为张量变换层;所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
  19. 根据权利要求18所述的神经网络操作方法,其特征在于,所述将经过训练后的第二神经网络中的随机掩膜层更新为张量变换 层,包括:
    在经过训练后的第二神经网络的输入层之前存在随机掩膜层的情况下,将经过训练后的第二神经网络的输入层之前的随机掩膜层更新为张量填充层;所述张量填充层用于将输入至所述张量填充层的张量的维度增大到第一阈值;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  20. 根据权利要求18所述的神经网络操作方法,其特征在于,所述将经过训练后的第二神经网络中的随机掩膜层更新为张量变换层,包括:
    在经过训练后的第二神经网络的输出层之后存在随机掩膜层的情况下,将经过训练后的第二神经网络的输出层之后的随机掩膜层更新为张量裁剪层;所述张量裁剪层用于将输入至所述张量裁剪层的张量的维度减小到第一目标值。
  21. 根据权利要求18所述的神经网络操作方法,其特征在于,所述将经过训练后的第二神经网络中的随机掩膜层更新为张量变换层,包括:
    在经过训练后的第二神经网络的中间层存在随机掩膜层的情况下,将经过训练后的第二神经网络的中间层的随机掩膜层更新为张量裁剪级联张量填充层;所述张量裁剪级联张量填充层用于将输入至所述张量裁剪级联张量填充层的张量的维度先减小到第二目标值,再增大到原来的维度。
  22. 一种电子设备,其特征在于,包括存储器,收发机,处理器;
    存储器,用于存储计算机程序;收发机,用于在所述处理器的控制下收发数据;处理器,用于读取所述存储器中的计算机程序并执行以下操作:
    根据可变维度的类型在第一神经网络中设置随机掩膜层,得到第二神经网络;所述随机掩膜层用于对输入至所述随机掩膜层的张量进 行随机掩膜处理;
    利用样本数据对所述第二神经网络进行训练。
  23. 根据权利要求22所述的电子设备,其特征在于,所述可变维度类型包括以下类型中的一种或多种:
    输入维度可变;
    输出维度可变;
    中间维度可变。
  24. 根据权利要求23所述电子设备,其特征在于,所述根据可变维度的类型在第一神经网络中设置随机掩膜层,包括:
    在所述可变维度的类型为输入维度可变的情况下,在所述第一神经网络的输入层之前设置随机掩膜层。
  25. 根据权利要求23所述电子设备,其特征在于,所述根据可变维度的类型在第一神经网络中设置随机掩膜层,包括:
    在所述可变维度的类型为输出维度可变的情况下,在所述第一神经网络的输出层之后设置随机掩膜层。
  26. 根据权利要求23所述电子设备,其特征在于,所述根据可变维度的类型在第一神经网络中设置随机掩膜层,包括:
    在所述可变维度的类型为中间维度可变的情况下,在所述第一神经网络的中间层设置随机掩膜层。
  27. 根据权利要求26所述的电子设备,其特征在于,所述在所述第一神经网络的中间层设置随机掩膜层,包括:
    在只有一个中间维度可变的情况下,在相关联的中间层之前或之后设置一个随机掩膜层。
  28. 根据权利要求26所述的电子设备,其特征在于,所述在所述神经网络的中间层设置随机掩膜层,包括:
    在有多个中间维度可变的情况下,在每一相关联的中间层之前或之后分别设置一个随机掩膜层。
  29. 根据权利要求22所述的电子设备,其特征在于,所述利用样本数据对所述第二神经网络进行训练,包括:
    在每一样本数据的输入数据的维度均为第一阈值的情况,直接利用所有的样本数据对所述第二神经网络进行训练;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  30. 根据权利要求22所述的电子设备,其特征在于,所述利用样本数据对所述第二神经网络进行训练,包括:
    在存在至少一个第一样本数据的情况,先对所述第一样本数据进行增强处理,再利用所有的第一样本数据和所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  31. 根据权利要求30所述的电子设备,其特征在于,所述对所述第一样本数据进行增强处理,包括:
    对所述第一样本数据的输入数据进行高位补零。
  32. 根据权利要求30所述的电子设备,其特征在于,所述对所述第一样本数据进行增强处理,包括:
    对所述第一样本数据的输入数据进行低位补零。
  33. 根据权利要求22所述的电子设备,其特征在于,所述利用样本数据对所述第二神经网络进行训练,包括:
    在存在至少一个第一样本数据的情况,先剔除所述第一样本数据,再利用所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  34. 根据权利要求22所述的电子设备,其特征在于,所述对输 入至所述随机掩膜层的张量进行随机掩膜处理,包括:
    确定输入至所述随机掩膜层的张量以及随机掩膜张量;
    利用所述随机掩膜张量对输入至所述随机掩膜层的张量进行随机掩膜处理。
  35. 根据权利要求34所述的电子设备,其特征在于,所述对输入至所述随机掩膜层的张量进行随机掩膜处理的表达式如下:
    Figure PCTCN2022126458-appb-100004
    其中,
    Figure PCTCN2022126458-appb-100005
    表示随机掩膜层输出的张量,X表示输入至随机掩膜层的张量,
    Figure PCTCN2022126458-appb-100006
    表示张量逐位点乘运算,M表示随机掩膜张量。
  36. 根据权利要求34所述的电子设备,其特征在于,所述随机掩膜张量为硬值掩膜张量。
  37. 根据权利要求34所述的电子设备,其特征在于,所述随机掩膜张量为软值掩膜张量。
  38. 根据权利要求34所述的电子设备,其特征在于,所述随机掩膜张量由硬值掩膜张量和软值掩膜张量组合而成。
  39. 根据权利要求22所述的电子设备,其特征在于,所述利用样本数据对所述第二神经网络进行训练之后,还包括:
    将经过训练后的第二神经网络中的随机掩膜层更新为张量变换层;所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
  40. 根据权利要求39所述的电子设备,其特征在于,所述将经过训练后的第二神经网络中的随机掩膜层更新为张量变换层,包括:
    在经过训练后的第二神经网络的输入层之前存在随机掩膜层的情况下,将经过训练后的第二神经网络的输入层之前的随机掩膜层更新为张量填充层;所述张量填充层用于将输入至所述张量填充层的张量的维度增大到第一阈值;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  41. 根据权利要求39所述的电子设备,其特征在于,所述将经过训练后的第二神经网络中的随机掩膜层更新为张量变换层,包括:
    在经过训练后的第二神经网络的输出层之后存在随机掩膜层的情况下,将经过训练后的第二神经网络的输出层之后的随机掩膜层更新为张量裁剪层;所述张量裁剪层用于将输入至所述张量裁剪层的张量的维度减小到第一目标值。
  42. 根据权利要求39所述的电子设备,其特征在于,所述将经过训练后的第二神经网络中的随机掩膜层更新为张量变换层,包括:
    在经过训练后的第二神经网络的中间层存在随机掩膜层的情况下,将经过训练后的第二神经网络的中间层的随机掩膜层更新为张量裁剪级联张量填充层;所述张量裁剪级联张量填充层用于将输入至所述张量裁剪级联张量填充层的张量的维度先减小到第二目标值,再增大到原来的维度。
  43. 一种神经网络操作方法,其特征在于,包括:
    获取预测数据;
    将所述预测数据输入至部署好的目标神经网络,得到所述目标神经网络输出的预测结果;其中,所述目标神经网络包括至少一个张量变换层,所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
  44. 根据权利要求43所述的神经网络操作方法,其特征在于,所述目标神经网络为权利要求1至21中的任一项所述的第二神经网络。
  45. 一种电子设备,其特征在于,包括存储器,收发机,处理器;
    存储器,用于存储计算机程序;收发机,用于在所述处理器的控制下收发数据;处理器,用于读取所述存储器中的计算机程序并执行以下操作:
    获取预测数据;
    将所述预测数据输入至部署好的目标神经网络,得到所述目标神经网络输出的预测结果;其中,所述目标神经网络包括至少一个张量变换层,所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
  46. 根据权利要求45所述的电子设备,其特征在于,所述目标神经网络为权利要求1至21中的任一项所述的第二神经网络。
  47. 一种神经网络操作装置,其特征在于,包括:
    添加模块,用于根据可变维度的类型在第一神经网络中设置随机掩膜层,得到第二神经网络;所述随机掩膜层用于对输入至所述随机掩膜层的张量进行随机掩膜处理;
    训练模块,用于利用样本数据对所述第二神经网络进行训练。
  48. 根据权利要求47所述的神经网络操作装置,其特征在于,所述可变维度类型包括以下类型中的一种或多种:
    输入维度可变;
    输出维度可变;
    中间维度可变。
  49. 根据权利要求48所述的神经网络操作装置,其特征在于,所述添加模块具体用于:
    在所述可变维度的类型为输入维度可变的情况下,在所述第一神经网络的输入层之前添加随机掩膜层。
  50. 根据权利要求48所述的神经网络操作装置,其特征在于,所述添加模块具体用于:
    在所述可变维度的类型为输出维度可变的情况下,在所述第一神经网络的输出层之后添加随机掩膜层。
  51. 根据权利要求48所述的神经网络操作装置,其特征在于,所述添加模块具体用于:
    在所述可变维度的类型为中间维度可变的情况下,在所述第一神 经网络的中间层添加随机掩膜层。
  52. 根据权利要求51所述的神经网络操作装置,其特征在于,所述添加模块具体用于:
    在只有一个中间维度可变的情况下,在相关联的中间层之前或之后添加一个随机掩膜层。
  53. 根据权利要求51所述的神经网络操作装置,其特征在于,所述添加模块具体用于:
    在有多个中间维度可变的情况下,在每一相关联的中间层之前或之后分别添加一个随机掩膜层。
  54. 根据权利要求47所述的神经网络操作装置,其特征在于,所述训练模块具体用于:
    在每一样本数据的输入数据的维度均为第一阈值的情况,直接利用所有的样本数据对所述第二神经网络进行训练;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  55. 根据权利要求47所述的神经网络操作装置,其特征在于,所述训练模块具体用于:
    在存在至少一个第一样本数据的情况,先对所述第一样本数据进行增强处理,再利用所有的第一样本数据和所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  56. 根据权利要求55所述的神经网络操作装置,其特征在于,所述训练模块具体用于:
    对所述第一样本数据的输入数据进行高位补零。
  57. 根据权利要求55所述的神经网络操作装置,其特征在于,所述训练模块具体用于:
    对所述第一样本数据的输入数据进行低位补零。
  58. 根据权利要求47所述的神经网络操作装置,其特征在于,所述训练模块具体用于:
    在存在至少一个第一样本数据的情况,先剔除所述第一样本数据,再利用所有的第二样本数据对所述第二神经网络进行训练;所述第一样本数据为输入数据的维度不为第一阈值的样本数据;所述第二样本数据为输入数据的维度为所述第一阈值的样本数据;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  59. 根据权利要求47所述的神经网络操作装置,其特征在于,所述训练模块具体用于:
    确定输入至所述随机掩膜层的张量以及随机掩膜张量;
    利用所述随机掩膜张量对输入至所述随机掩膜层的张量进行随机掩膜处理。
  60. 根据权利要求59所述的神经网络操作装置,其特征在于,所述对输入至所述随机掩膜层的张量进行随机掩膜处理的表达式如下:
    Figure PCTCN2022126458-appb-100007
    其中,
    Figure PCTCN2022126458-appb-100008
    表示随机掩膜层输出的张量,X表示输入至随机掩膜层的张量,
    Figure PCTCN2022126458-appb-100009
    表示张量逐位点乘运算,M表示随机掩膜张量。
  61. 根据权利要求59所述的神经网络操作装置,其特征在于,所述随机掩膜张量为硬值掩膜张量。
  62. 根据权利要求59所述的神经网络操作装置,其特征在于,所述随机掩膜张量为软值掩膜张量。
  63. 根据权利要求59所述的神经网络操作装置,其特征在于,所述随机掩膜张量由硬值掩膜张量和软值掩膜张量组合而成。
  64. 根据权利要求47所述的神经网络操作装置,其特征在于,还包括部署模块;
    所述部署模块用于将经过训练后的第二神经网络中的随机掩膜层替换为张量变换层;所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
  65. 根据权利要求64所述的神经网络操作装置,其特征在于,所述部署模块具体用于:
    在经过训练后的第二神经网络的输入层之前存在随机掩膜层的情况下,将经过训练后的第二神经网络的输入层之前的随机掩膜层替换为张量填充层;所述张量填充层用于将输入至所述张量填充层的张量的维度增大到第一阈值;所述第一阈值为所有样本数据的输入数据的维度的最大值。
  66. 根据权利要求64所述的神经网络操作装置,其特征在于,所述部署模块具体用于:
    在经过训练后的第二神经网络的输出层之后存在随机掩膜层的情况下,将经过训练后的第二神经网络的输出层之后的随机掩膜层替换为张量裁剪层;所述张量裁剪层用于将输入至所述张量裁剪层的张量的维度减小到第一目标值。
  67. 根据权利要求64所述的神经网络操作装置,其特征在于,所述部署模块具体用于:
    在经过训练后的第二神经网络的中间层存在随机掩膜层的情况下,将经过训练后的第二神经网络的中间层的随机掩膜层替换为张量裁剪级联张量填充层;所述张量裁剪级联张量填充层用于将输入至所述张量裁剪级联张量填充层的张量的维度先减小到第二目标值,再增大到原来的维度。
  68. 一种神经网络操作装置,其特征在于,包括:
    获取模块,用于获取预测数据;
    处理模块,用于将所述预测数据输入至部署好的目标神经网络,得到所述目标神经网络输出的预测结果;其中,所述目标神经网络包 括至少一个张量变换层,所述张量变换层用于对输入至所述张量变换层的张量进行维度变换。
  69. 根据权利要求68所述的神经网络操作装置,其特征在于,所述目标神经网络为权利要求47至67中的任一项所述的第二神经网络。
  70. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序用于使计算机执行权利要求1至21中的任一项所述的神经网络操作方法,或者权利要求43至44中的任一项所述的神经网络操作方法。
PCT/CN2022/126458 2021-12-23 2022-10-20 神经网络操作方法、装置及存储介质 WO2023116155A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202111593613.7 2021-12-23
CN202111593613 2021-12-23
CN202210039452.5 2022-01-13
CN202210039452.5A CN116366401A (zh) 2021-12-23 2022-01-13 神经网络操作方法、装置及存储介质

Publications (1)

Publication Number Publication Date
WO2023116155A1 true WO2023116155A1 (zh) 2023-06-29

Family

ID=86901215

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/126458 WO2023116155A1 (zh) 2021-12-23 2022-10-20 神经网络操作方法、装置及存储介质

Country Status (2)

Country Link
TW (1) TW202326523A (zh)
WO (1) WO2023116155A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948794A (zh) * 2019-02-28 2019-06-28 清华大学 神经网络结构化剪枝方法、剪枝装置和电子设备
CN111724327A (zh) * 2020-06-29 2020-09-29 成都数之联科技有限公司 图像修复模型训练方法及系统及图像修复方法
US20210110813A1 (en) * 2019-10-11 2021-04-15 Pindrop Security, Inc. Z-vectors: speaker embeddings from raw audio using sincnet, extended cnn architecture and in-network augmentation techniques
US20210287092A1 (en) * 2020-03-12 2021-09-16 Montage Technology Co., Ltd. Method and device for pruning convolutional layer in neural network
US20210383234A1 (en) * 2020-06-08 2021-12-09 Robert Bosch Gmbh System and method for multiscale deep equilibrium models

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109948794A (zh) * 2019-02-28 2019-06-28 清华大学 神经网络结构化剪枝方法、剪枝装置和电子设备
US20210110813A1 (en) * 2019-10-11 2021-04-15 Pindrop Security, Inc. Z-vectors: speaker embeddings from raw audio using sincnet, extended cnn architecture and in-network augmentation techniques
US20210287092A1 (en) * 2020-03-12 2021-09-16 Montage Technology Co., Ltd. Method and device for pruning convolutional layer in neural network
US20210383234A1 (en) * 2020-06-08 2021-12-09 Robert Bosch Gmbh System and method for multiscale deep equilibrium models
CN111724327A (zh) * 2020-06-29 2020-09-29 成都数之联科技有限公司 图像修复模型训练方法及系统及图像修复方法

Also Published As

Publication number Publication date
TW202326523A (zh) 2023-07-01

Similar Documents

Publication Publication Date Title
US20230019669A1 (en) Systems and methods for enhanced feedback for cascaded federated machine learning
US20220247469A1 (en) Method and device for transmitting channel state information
US10419161B2 (en) Method and communications device for transmitting information
WO2023116155A1 (zh) 神经网络操作方法、装置及存储介质
WO2022089522A1 (zh) 一种数据传输的方法和装置
CN116366401A (zh) 神经网络操作方法、装置及存储介质
WO2023202385A1 (zh) 信息传输方法、装置及存储介质
WO2024032701A1 (zh) 信道状态信息处理方法及装置
US20240146582A1 (en) Information encoding control method and related apparatus
WO2023060503A1 (zh) 信息处理方法、装置、设备、介质、芯片、产品及程序
WO2023116407A1 (zh) 信息处理方法、装置、终端及网络设备
WO2024055910A1 (zh) 图样映射优化方法及装置
WO2023006096A1 (zh) 一种通信方法及装置
WO2024077621A1 (zh) 信道信息反馈的方法、发端设备和收端设备
WO2024027683A1 (zh) 模型匹配方法、装置、通信设备及可读存储介质
WO2024065800A1 (zh) 信道状态信息的反馈方法和装置
WO2024008004A1 (zh) 一种通信方法及装置
WO2024026792A1 (zh) 通信方法、装置、设备、存储介质、芯片及程序产品
WO2023198018A1 (zh) 一种上行信号发送、接收方法及装置
WO2023115254A1 (zh) 处理数据的方法及装置
CN108599829B (zh) 一种实用化的干扰对齐与删除方法、终端设备
WO2024012303A1 (zh) 一种ai网络模型交互方法、装置和通信设备
WO2023036323A1 (zh) 一种通信方法及装置
WO2024108356A1 (zh) Csi反馈的方法、发端设备和收端设备
WO2023011626A1 (zh) 资源指示方法、终端、网络侧设备、装置和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22909473

Country of ref document: EP

Kind code of ref document: A1