METHOD AND DEVICE FOR DISTRIBUTED LEARNING
Patent Information
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2022-04-14
- Publication Date
- 2026-06-24
Description
TECHNICAL FIELD
[0001] This application relates to the communication field, and in particular, to a distributed learning method and apparatus.BACKGROUND
[0002] In recent years, the artificial intelligence (artificial intelligence, AI) technology has made significant progress in fields such as machine vision and natural language processing, and can be applied to various devices, but also has high requirements on capabilities of the devices. A neural network (neural network, NN) model is used as an example. To implement training and inference on the NN model, a device needs to have powerful computing power, which is a great challenge for some devices.
[0003] To lower the requirements on the capabilities of the devices, the NN model may be segmented at an intermediate node at a specific layer or some specific layers of the NN model, and a plurality of obtained NN submodels are deployed on a plurality of devices for training and inference. Currently, operations, such as channel coding, need to be performed on intermediate layer information (a tensor or a vector) of forward propagation and intermediate layer gradient information of back propagation, and transmission is performed between the devices through channels. In this case, encoding and decoding processes occupy a large quantity of resources, resulting in a waste of resources. In addition, currently there is no technical solution that can improve performance of distributed learning.
[0004] SEBASTIAN DÖRNER ET AL: "Deep Learning-Based Communication Over the Air" describes a point-to-point communications system having a physical layer processing carried out by deep neural networks.SUMMARY
[0005] The scope of the invention is set out in the appended claims. This application provides a distributed learning method and apparatus, to combine wireless communication with distributed learning, which can save resources and improve performance of distributed learning in a wireless environment.BRIEF DESCRIPTION OF DRAWINGS
[0006] FIG. 1 is a schematic diagram of an architecture of a communication system according to an embodiment of this application; FIG. 2 is a schematic diagram of a fully-connected neural network according to an embodiment of this application; FIG. 3 is a schematic diagram of gradient descent according to an embodiment of this application; FIG. 4 is a schematic diagram of neural network training according to an embodiment of this application; FIG. 5 is a schematic diagram of a type of neural network segmentation according to an embodiment of this application; FIG. 6 is a schematic diagram of another type of neural network segmentation according to an embodiment of this application; FIG. 7 is a schematic diagram of still another type of neural network segmentation according to an embodiment of this application; FIG. 8 is a schematic diagram of interaction of a distributed learning method according to an embodiment of this application; FIG. 9A and FIG. 9B are a schematic diagram of application of a distributed learning method according to an embodiment of this application; FIG. 10A and FIG. 10B are a schematic diagram of application of another distributed learning method according to an embodiment of this application; FIG. 11A and FIG. 11B are a schematic diagram of application of still another distributed learning method according to an embodiment of this application; FIG. 12(a), FIG. 12(b), and FIG. 12(c) are a schematic diagram of interaction of another distributed learning method according to an embodiment of this application; FIG. 13 is a schematic diagram of a structure of a distributed learning apparatus according to an embodiment of this application; and FIG. 14 is a schematic diagram of a structure of another distributed learning apparatus according to an embodiment of this application. DESCRIPTION OF EMBODIMENTS
[0007] The following describes technical solutions of this application with reference to the accompanying drawings.
[0008] The technical solutions in embodiments of this application may be applied to various communication systems, for example, a Wireless Fidelity (wireless fidelity, Wi-Fi) system, a vehicle to everything (vehicle to everything, V2X) communication system, a device-to-device (device-to-device, D2D) communication system, an Internet of vehicles communication system, a short-distance wireless communication system, a satellite communication system, a NarrowBand-Internet of Things (NarrowBand-Internet of Things, NB-IoT) system, a long-term evolution (long-term evolution, LTE) system, a fifth generation (5th generation, 5G) mobile communication system such as a new radio (new radio, NR) system, and a future communication system such as a sixth generation (6th generation, 6G) mobile communication system. The technical solutions in embodiments of this application may be applied to the following application scenarios: enhanced mobile broadband (enhanced mobile broadband, eMBB), URLLC (ultra-reliable low-latency communication, URLLC), and enhanced machine-type communication (enhanced machine-type communication, eMTC).
[0009] All aspects, embodiments, or features are presented in this application by describing a system that may include a plurality of devices, components, modules, and the like. It should be appreciated and understood that, each system may include another device, component, module, and the like, and / or may not include all devices, components, modules, and the like discussed with reference to the accompanying drawings. In addition, a combination of these solutions may be used.
[0010] In addition, in embodiments of this application, terms such as "example" and "for example" represent giving an example, an illustration, or a description. Any embodiment or design scheme described as an "example" in this application should not be explained as being more preferred or having more advantages than another embodiment or design scheme. Exactly, the use of the term "example" is intended to present a concept in a specific manner.
[0011] The network architecture and the service scenario described in embodiments of this application are intended to describe the technical solutions in embodiments of this application more clearly, but constitute no limitation on the technical solutions provided in embodiments of this application. A person of ordinary skill in the art may learn that the technical solutions provided in embodiments of this application are also applicable to a similar technical problem as the network architecture evolves and a new service scenario emerges.
[0012] For ease of understanding embodiments of this application, the following describes in detail a communication system applicable to embodiments of this application by using a communication system shown in FIG. 1 as an example. For example, FIG. 1 is a schematic diagram of an architecture of a communication system to which a distributed learning method according to an embodiment of this application is applicable.
[0013] The communication system includes a first node and a second node. The first node may be a terminal device, and the second node may be a network device. Alternatively, the first node may be a network device, and the second node may be a terminal device. Alternatively, the first node may be a terminal device, and the second node may be a terminal device. As shown in FIG. 1, the communication system includes a terminal device, and there may be one or more terminal devices. The communication system may further include a network device.
[0014] The network device is a device that is located on a network side of the communication system and that has wireless sending and receiving functions, or a chip or a chip system that may be arranged in the device. The network device includes, but is not limited to, an access point (access point, AP) in a wireless fidelity (wireless fidelity, Wi-Fi) system such as a home gateway, a router, a server, a switch, or a bridge, an evolved NodeB (evolved NodeB, eNB), a radio network controller (radio network controller, RNC), a home base station (such as a home evolved NodeB or a home NodeB, HNB), a radio relay node, a radio backhaul node, or a transmission point (transmission and reception point, TRP, or transmission point, TP), or may be a gNB or a transmission point (TRP or TP) in 5G, for example, an NR system, or one antenna panel or a group of (including a plurality of antenna panels) antenna panels of a base station in a 5G system, or may be a network node forming a gNB or a transmission point, for example, a baseband unit (BBU), a distributed unit (distributed unit, DU), a road side unit (road side unit, RSU) having a base station function or the like. The network device may alternatively be a radio controller in a cloud radio access network (cloud radio access network, CRAN) scenario, or a network device in a future evolved public land mobile network (public land mobile network, PLMN), or a wearable device or an in-vehicle device, and further include a device that functions as a base station in device-to-device (device-to-device, D2D), vehicle-to-everything (vehicle-to-everything, V2X), machine-to-machine (machine, M2M) communication, or Internet of Things (Internet of Things) communication.
[0015] The terminal device is a terminal that accesses the communication system and that has wireless sending and receiving functions, or a chip or a chip system that may be arranged in the terminal. The terminal device may also be referred to as user equipment (User Equipment, UE), a user apparatus, an access terminal, a subscriber unit, a subscriber station, a mobile console, a mobile station (mobile station, MS), a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a terminal unit, a terminal station, a terminal apparatus, a wireless communication device, a user agent, or a user apparatus. For example, the terminal device in embodiments of this application may be a mobile phone (mobile phone), a wireless data card, a personal digital assistant (personal digital assistant, PDA) computer, a laptop computer (laptop computer), a tablet computer (Pad), a computer with wireless sending and receiving functions, a machine-type communication (machine-type communication, MTC) terminal, a virtual reality (virtual reality, VR) terminal device, an augmented reality (augmented reality, AR) terminal device, an Internet of Things (Internet of Things, IoT) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned driving (self-driving), a wireless terminal in remote medical (remote medical), a wireless terminal in a smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in a smart city (smart city), a wireless terminal (such as a game console, a smart television, a smart speaker, a smart refrigerator, and a fitness apparatus) in a smart home (smart home), an in-vehicle terminal, or an RSU having a terminal function. The access terminal may be a cellular phone (cellular phone), a cordless phone, a Session Initiation Protocol (session initiation protocol, SIP) phone, a wireless local loop (wireless local loop, WLL) station, a personal digital assistant (personal digital assistant, PDA), a handheld device (handset) with a wireless communication function, a computing device, another processing device connected to a wireless modem, a wearable device, or the like. For another example, the terminal device in embodiments of this application may be an express delivery terminal (for example, a device that can monitor a location of a vehicle carrying goods or a device that can monitor a temperature and humidity of goods) in smart logistics, a wireless terminal (for example, a wearable device that can collect related data of livestock and poultry) in smart agriculture, a wireless terminal (for example, a smart elevator, a fire monitoring device, and a smart meter) in a smart building, a wireless terminal (for example, a wearable device that can monitor a physiological status of a person or an animal) in smart medical, a wireless terminal (such as a smart bus, a smart vehicle, a shared bicycle, a charging pile monitoring device, a smart traffic light, smart monitoring devices, and smart parking devices) in intelligent transportation, or a wireless terminal (such as a vending machine, a self-service checkout machine, and an unmanned convenience store) in smart retail. For another example, the terminal device in this application may be an in-vehicle module, an in-vehicle module, an in-vehicle component, an in-vehicle chip, or an in-vehicle unit that is built in a vehicle as one or more components or units. The vehicle may implement, through the in-vehicle module, the in-vehicle module, the in-vehicle component, the in-vehicle chip, or the in-vehicle unit, the distributed learning method provided in this application.
[0016] It should be noted that the distributed learning method provided in embodiments of this application may be applied to between any two nodes shown in FIG. 1, for example, between terminal devices and between a terminal device and a network device. For specific implementation, refer to the following method embodiments. Details are not described herein again.
[0017] It should be noted that the solutions in embodiments of this application may be further applied to another communication system, and a corresponding name may also be replaced with a name of a corresponding function in the another communication system.
[0018] It should be understood that FIG. 1 is merely a simplified schematic diagram of an example for ease of understanding. The communication system may further include another device that is not shown in FIG. 1.
[0019] In addition, a person of ordinary skill in the art may learn that, with evolution of a network architecture and emergence of a new service scenario, the technical solutions provided in embodiments of this application are also applicable to a similar technical problem.
[0020] To make embodiments of this application clearer, the following describes some content and concepts related to embodiments of this application together.1. Neural network
[0021] A neural network is an algorithm network that can perform learning, summarization, and conclusion, and may be built in a computing node in a form of neural network software or hardware, for example, a training program or an executable script of a neural network. Generally, a deep neural network (deep neural networks, DNN) model is used as an example. A DNN model includes a plurality of layers of neurons (operators). Each layer has a plurality of inputs and a plurality of outputs. The input or output is a multi-dimensional array, also referred to as a tensor (tensor). Each layer has one or more weighted values, referred to as weights. An output result of a specific layer, also referred to as an eigenvalue, is equal to a result of a mathematical operation, such as multiplication, of an input and a weight of the layer, and usually relates to a matrix multiplication operation.
[0022] A fully-connected neural network is a neural network, and the fully-connected neural network is also referred to as a multi-layer perceptron (multi-layer perceptron, MLP). One MLP includes one input layer, one output layer, and a plurality of hidden layers (also referred to as intermediate layers), and each layer includes a plurality of neurons. Neurons included in two adjacent layers of neurons are connected pairwise, as shown in FIG. 2.
[0023] For two adjacent layers of neurons, an output h of a neuron at a lower layer is a weighted sum of all neurons x at an upper layer connected to the neuron at the lower layer and passes through an activation function. The matrix may be represented as the following formula: h=f(w×x+b), where w is a weight matrix, b is a bias vector, and f() is an activation function. Then, the output y of the neural network may be recursively expressed as y=f t (w t ×f t-1 (...)+b t ), where t is a quantity of layers of neurons included in the fully-connected neural network.2. Neural network training
[0024] A neural network may be understood as a mapping relationship between an input data set and an output data set. Generally, the neural network may be randomly initialized, and a process of obtaining the mapping relationship based on random w and random b by using existing data may be referred to as neural network training.
[0025] For example, a training manner includes evaluating output data of the neural network by using a loss function (loss function), to obtain and backpropagate error information. As shown in FIG. 3, a weight matrix w and a bias vector b may be iteratively optimized through the gradient descent method, and optimal w and optimal b may be obtained when a value of the loss function reaches a minimum value.
[0026] For example, a gradient descent process may be expressed as a formula (1): θ ′ ← θ − η × ∂ L ∂ θ or θ ′ = θ − η × ∂ L ∂ θ .
[0027] A parameter (for example, the weight w and the bias b) may be optimized by using the foregoing formula (1). In the foregoing formula (1), θ' is a value (which may also be referred to as an updated value) of a parameter before the optimization, θ is a value of the parameter before the optimization, L is a loss function, η is a learning rate and may be for controlling a stride of gradient descent, and the mathematical symbol ← indicates to assign a right side to a left side.
[0028] With reference to FIG. 4, in a backpropagation process, a chain rule for obtaining a partial derivative may be used, to be specific, a gradient of a parameter of a neuron at a previous layer (layer j) may be calculated through recursion from a gradient of a parameter of a neuron (layer i) at a next layer as the following formula (2): ∂ L ∂ w i j 2 = ∂ L ∂ s i × ∂ s i ∂ w ij 2 .
[0029] In the foregoing formula (2), L is a loss function, w ij is a weight of a connection between a neuron i and a neuron j, s i is a weighted sum of inputs on the neuron i, that is, s i = w ij1 × s j1 + w ij2 × s j2 + w ij3 × s j3 + w ij4 × s j4 , ∂ L ∂ s i is a gradient ∂ L ∂ s i transferred from a next layer (layer i) of the layer j to the layer j, and ∂ L ∂ s i may be referred to as an intermediate layer gradient, that is, the layer i may be considered as an intermediate layer.3. Neural network segmentation
[0030] Neural network segmentation: A neural network is segmented into a plurality of sub-neural networks at a specific intermediate layer based on computing powers and communication capabilities of nodes, and the sub-neural networks are deployed on a plurality of nodes respectively.
[0031] With reference to FIG. 5, a first data model and a second data model are obtained after a data model is segmented at the intermediate layer. In a forward process of training or inference, the first node processes input data by using the first data model to obtain intermediate data, and transmits the intermediate data to the second node through a channel. Then, the second node processes the intermediate data by using the second data model to obtain output data. In a reverse process of training, the second node determines error information of the second data model based on the output data, updates a parameter of the second data model, and sends the error information of the second data model to the first node. The first node determines error information of the first data model based on the error information of the second data model, and updates a parameter of the first data model.4. Parameter of the first data model, parameter of the second data model, parameter of a first channel, and information about the first channel
[0032] Parameter of the first data model: A parameter θ 1 of the first data model may be a weight and / or a bias corresponding to the first data model.
[0033] Parameter of the second data model: A parameter θ 2 of the second data model may be a weight and / or a bias corresponding to the second data model.
[0034] In this embodiment of this application, the first channel may include a controllable part, and may further include an uncontrollable part. The controllable part may include a controllable environment, and the uncontrollable part may include an uncontrollable environment between two nodes. Alternatively, the first channel may include a trainable channel affected by a controllable part, and may further include a direct channel formed by an uncontrollable part.
[0035] Controllable environment: A controllable unit is deployed in an environment to adjust a radio channel environment.
[0036] For example, the controllable unit may include an active device such as a relay, a distributed antenna, or an active intelligent reflective surface. Alternatively, the controllable unit may include a passive device such as a passive intelligent reflective surface.
[0037] With reference to FIG. 6 or FIG. 7, the first channel may include a second channel and may further include a third channel. In embodiments of this application, the controllable part or the trainable channel affected by the controllable part is referred to as a second channel, and the uncontrollable part or the channel formed by the uncontrollable part is referred to as a third channel.
[0038] FIG. 6 is a schematic diagram of application of a distributed learning method according to an embodiment of this application. FIG. 7 is a schematic diagram of application of another distributed learning method according to an embodiment of this application. As shown in FIG. 6 or FIG. 7, the first node includes the first data model, the second node includes the second data model, and the first node communicates with the second node through the first channel. FIG. 6 mainly differs from FIG. 7 in that display forms of the first channel are different.
[0039] For example, the first channel includes the controllable part and the uncontrollable part, or the first channel includes the trainable channel affected by the controllable part and the channel formed by the uncontrollable part. With reference to FIG. 6 and FIG. 7, the first channel between the first node and the second node may be represented as g 1 × Φ × g 2 + h or h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n , where g 1 , g 2 and h are related information of the uncontrollable part or related information of the channel formed by the uncontrollable part, g 1 is a channel from the first node to the controllable part (or referred to as the trainable channel affected by the controllable environment or the controllable part), g 2 is a channel from the second node to the controllable part (or referred to as the trainable channel affected by the controllable environment or the controllable part), and h is a direct channel from the first node to the second node. N is a dimension, for example, a quantity of controllable units, of the first channel (for example, the controllable environment or the controllable part) serving as the intermediate layer. Φ is a parameter of the controllable part or a parameter of the trainable channel affected by the controllable part, and Φ may be a response of the controllable part (or referred to as the trainable channel affected by the controllable environment or the controllable part). For example, Φ may include an amplitude, a phase effect, and the like.
[0040] For example, the n th< element of the response Φ of the controllable part may be expressed as a formula (3): ϕ n = β n × e jψ n , where
[0041] β n is an amplitude of the response, e is a natural constant, e is approximately equal to 2.71828, ψ n is a phase of the response, j is an imaginary unit, and j 2< = -1.
[0042] In embodiments of this application, the parameter of the first channel may include one or more of the following: g 1 , g 2 , h, and Φ. The parameter of the second channel may include Φ. The information about the first channel may include information obtained based on one or more of g 1 , g 2 , h, and Φ. Information about the third channel may include information obtained based on one or more of g 1 , g 2 , and h.
[0043] In the conventional technology, communication transmission is designed for lossless transmission. To ensure error-free transmission of information, in a forward process and a reverse process, channel encoding needs to be performed on information transmitted between the first node and the second node, and received information needs to be decoded.
[0044] It is found by the applicant through researches that, a characteristic of over-parameterization (that is, a quantity of parameters is greater than a quantity of training samples) of the neural network and a training method, represented by random gradient descent, of the neural network enable the neural network to have a good error tolerance capability. Therefore, in a distributed learning process, a requirement for lossless transmission of information is low. However, encoding and decoding processes occupy a large quantity of resources, resulting in a waste of resources. A design of decoupling learning of the neural network from communication causes redundancy of radio resource utilization. In addition, this solution cannot improve performance of distributed learning.
[0045] This application proposes to combine a channel with distributed learning and perform joint training on the channel and the neural network by taking the channel as a part of the neural network, so that resources can be saved, and performance of distributed learning can be improved.
[0046] The distributed learning method provided in embodiments of this application may be applied to a plurality of waveform systems such as a single carrier, a discrete Fourier transform spread orthogonal frequency division multiplexing (discrete Fourier transform spread OFDM, DFT-s-OFDM) system, a cyclic prefix orthogonal frequency division multiplexing (cyclic prefix OFDM, SC-OFDM) system, and an orthogonal time-frequency space (orthogonal time-frequency space, OTFS) system. Radio channel responses of the systems may be modeled as linear systems. A main difference between the systems is that resource definitions are different. For example, the single carrier defines a symbol in time domain, and the OTFS and like may be considered as performing further linear transformations on the symbol.
[0047] The distributed learning method provided in embodiments of this application is applicable to a scenario with one or more antennas, and mapping (that is, precoding) between a neuron and an antenna is also a linear transformation.
[0048] The distributed learning method provided in embodiments of this application is applicable to a single AI task and a multi-task or multi-view scenario. In the multi-task scenario, there may be a plurality of second data models, configured for a plurality of inference tasks. The plurality of second data models are separately updated. The first data model and the controllable environment need to be updated by integrating (for example, weighting) intermediate layer error information of the plurality of second data models. In the multi-view scenario, there may be a plurality of first data models, configured to process data of different views for subsequent inference of the second data model. The update of the controllable environment is related to transmission manners of intermediate layer inference outputs of the plurality of first data models. For example, when orthogonal / non-orthogonal multiple access is used, the plurality of first data models may be separately updated. The distributed learning method provided in embodiments of this application is described by using an example in which the distributed learning method is applied to a single AI task.
[0049] The technical solutions of this solution may be applied to a multi-hop network scenario, that is, a case in which a neural network is segmented into three or more.
[0050] The following describes in detail the distributed learning method provided in embodiments of this application with reference to FIG. 8 to FIG. 12A and FIG. 12B. FIG. 9A to FIG. 11B are schematic diagrams of application of a distributed learning method according to an embodiment of this application. When the methods shown in FIG. 8, FIG. 12(a), FIG. 12(b), and FIG. 12(c) are described, content in FIG. 9A to FIG. 11B is described as examples.
[0051] For example, FIG. 8 is a schematic diagram of interaction of a distributed learning method according to an embodiment of this application. An OFDM system is used as an example for description. The distributed learning method may be applied to communication between any two nodes shown in FIG. 1.
[0052] As shown in FIG. 8, the distributed learning method includes the following steps.
[0053] S801. A first node processes first data by using a first data model to obtain first intermediate data.
[0054] For example, the first node includes the first data model, and the first data model is built in the first node.
[0055] For example, the first data model may be neural network software. The first data model may be built in the first node in a form of neural network software or hardware, for example, a training program or an executable script of a neural network.
[0056] Optionally, the first data may be data in a training sample or data during inference. S801 may be applied to a training process or an inference process.
[0057] With reference to FIG. 6 or FIG. 7, the first node processes first data x based on the first data model to output first intermediate data z.
[0058] With reference to step (a) in FIG. 9A to FIG. 11B, the first data is x, and the first node processes x by using the first data model whose parameter is θ 1 , to obtain z = f θ1 (x), where f θ1 ( ) is a neural network model whose parameter is θ 1 .
[0059] S802. The first node sends the first intermediate data to the second node through a first channel. Correspondingly, the second node receives second intermediate data from the first node through the first channel.
[0060] For example, the second intermediate data is a result of transmitting the first intermediate data to the second node through the first channel.
[0061] With reference to FIG. 6 or FIG. 7, the first node sends the first intermediate data z through the first channel, and after the first intermediate data z passes through the first channel, second intermediate data c is output, and the second node receives the second intermediate data c.
[0062] In some embodiments, the second node receives the first intermediate data (for example, z = f θ1 (x)) from the first node through the first channel (for example, g 2 × Φ × g 1 + h) to obtain the second intermediate data c = (g 2 × Φ × g 1 + h) × f θ1 (x) + k, where k is noise. For meanings of other symbols, refer to the foregoing descriptions of the parameter of the first channel. Details are not described herein again.
[0063] With reference to step (b) in FIG. 9A to FIG. 11B, the second node receives the first intermediate data (for example, z = f θ1 (x)) from the first node through the first channel (for example, h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n ) to obtain the second intermediate data c = h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n × f θ 1 x + k , where k is noise, and N is a dimension of the first channel (for example, a controllable environment of the channel, a controllable part of the channel, or a trainable channel affected by the controllable part of the channel) serving as an intermediate layer. For meanings of other symbols, refer to the foregoing descriptions of the parameter of the first channel. Details are not described herein again.
[0064] For example, the first channel is updated based on the error information of the second intermediate data, the information about the first channel, and the first intermediate data.
[0065] The error information of the second intermediate data includes a gradient of the second intermediate data or a normalized value of the gradient of the second intermediate data.
[0066] Optionally, the information about the first channel may include one or more of the following: g 1 , g 2 , h, and Φ.
[0067] For a specific implementation of updating the first channel, refer to S1202a and S1202b shown in FIG. 12(a), FIG. 12(b), and FIG. 12(c). Details are not described herein again.
[0068] In this embodiment of this application, a channel (that is, the first channel) between the first node and the second node is trained, and the channel is used as an intermediate layer (for example, a residual layer) of a data model to participate in training and inference, so that a function, such as filtering or feature extraction, required by a DNN can be implemented in a wireless transmission process, which can improve performance of distributed learning. In addition, wireless transmission is enabled to directly serve for distributed learning, which can reduce processing complexity and further save resources.
[0069] Optionally, a value of the parameter of the first data model is a value obtained after previous training. A value of the parameter of the first channel is a value obtained after previous training.
[0070] That is, in a forward training process or an inference process, the value of the parameter of the first data model may be a value updated after previous training or an initial value (for example, the first data model is not trained), and the value of the parameter of the first channel may be a value updated after previous training or an initial value (for example, the first channel is not trained).
[0071] In some embodiments, in S802, that the first node sends the first intermediate data to the second node through a first channel may include: The first node modulates the first intermediate data into a symbol, and sends the symbol to the second node through the first channel.
[0072] For example, the first node may map the first intermediate data to an air interface resource and send the first intermediate data to the second node. In this way, channel encoding and decoding are not required in a data transmission process, and resources can be saved.
[0073] For example, a quantity of modulated symbols is the same as a dimension of the intermediate layer of the data model.
[0074] For example, a value of the symbol and a value of the intermediate layer may satisfy the following formula: s=z or s=W×z, that is, a specific linear transformation is satisfied between the value of the symbol and the value of the intermediate layer, where s is the value of the symbol, z is the value of the intermediate layer, and W is a linear transformation matrix. This may correspond to a case in which the data model is a complex data model, that is, the neural network is a complex neural network. The following uses s=z as an example for description.
[0075] With reference to FIG. 6 or FIG. 7, if the dimension of the intermediate layer of the data model is 4, the quantity of symbols is also 4.
[0076] For another example, the quantity of modulated symbols is a half of the dimension of the intermediate layer of the data model. In other words, outputs of two neurons form a complex symbol, or a specific linear transformation can be satisfied between the value of the symbol and the value of the intermediate layer.
[0077] For example, the following formula may be satisfied between the value of the symbol and the value of the intermediate layer: s i = z i1 + 1 × j × z i2 , where s i is a value of a symbol i, i 1 and i 2 represent the i 1 th< element and the i 2 th< element in the intermediate layer, j is a constant, and j 2< = -1.
[0078] In some embodiments, that the second node receives second intermediate data from the first node through the first channel in S802 may include: The second node performs dimension matching on a symbol of the received second intermediate data.
[0079] In this way, the second node does not need to perform decoding in a process of receiving data, which can save resources.
[0080] Optionally, the second node may perform dimension matching depending on whether the data model is a complex data model.
[0081] For example, a quantity of demodulated symbols is the same as a dimension of the intermediate layer of the data model. This corresponds to a case in which the data model is a complex data model.
[0082] For another example, one complex symbol of the second intermediate data is expanded into two real numbers. This corresponds to a case in which the data model is a real data model.
[0083] It should be noted that a specific implementation in which the second node performs dimension matching depending on whether the data model is a complex data model is similar to a corresponding implementation in which the first node modulates the first intermediate data into a symbol and sends the symbol to the second node through the first channel, and details are not described herein again.
[0084] It should be noted that the second node performs dimension matching on a symbol of the received second intermediate data may be performed before a second data model of the second node processes the second intermediate data, for example, performed before S803.
[0085] S803. The second node processes the second intermediate data by using the second data model to obtain output data.
[0086] For example, the second node includes the second data model. Similar to the first data model, the second data model may be built in the second node.
[0087] For example, the second data model may be neural network software and built in the second node in a form of neural network software or hardware, for example, a training program or an executable script of a neural network.
[0088] In some embodiments, the second node processes the second intermediate data c = (g 2 × Φ × g 1 + h) × f θ1 (x) + k by using the second data model whose parameter is θ 2 to obtain the output data y = f θ2 ((g 2 × Φ × g 1 + h) × f θ1 (x) + k), where f θ2 () is a neural network model whose parameter is θ 2 , and k is noise. For meanings of other symbols, refer to the foregoing descriptions of the parameter of the first channel. Details are not described herein again.
[0089] With reference to step (c) in FIG. 9A to FIG. 11B, using an antenna of the second node as an example, the second node processes the second intermediate data c = h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n × f θ 1 x + k by using the second data model whose parameter is θ 2 , and the obtained output data may be y = f θ 2 h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n × f θ 1 x + k , where N is a dimension of the first channel (for example, a controllable environment of the channel, a controllable part of the channel, or a trainable channel affected by the controllable part of the channel) serving as an intermediate layer, where N is an integer greater than 0.
[0090] In some embodiments, M antennas of the second node process the second intermediate data c m = h m + ∑ n = 1 N g 2 , n , m × g 1 , n × ϕ n × f θ 1 x + k m by using the second data model whose parameter is θ 2 , and the obtained output data may be y = f θ2 (c 1 , c 2 , ... , c m , ... , c M ), where N is a dimension of the channel (for example, a controllable environment of the channel, a controllable part of the channel, or a trainable channel affected by the controllable part of the channel) serving as an intermediate layer, where N is an integer greater than 0, and M is a quantity of antennas included in the second node, where m is an integer greater than or equal to 1.
[0091] Optionally, a value of the parameter θ 2 of the second data model of the second node may be a value updated after previous training.
[0092] That is, in a forward training process or an inference process, the value of the parameter of the second data model may be a value updated after previous training or an initial value (for example, the second data model is not trained).
[0093] By using the foregoing distributed learning method, a channel is combined with a data model, the first channel for transmitting data between the first node and the second node is used as an intermediate layer of the data model, and the first channel is trained. The first channel is optimized based on the error information of the second intermediate data, the information about the first channel, and the first intermediate data, which can improve performance of distributed learning. In addition, wireless transmission is enabled to directly serve for distributed learning, to implement integration of communication and computing, which can reduce processing complexity and further save resources.
[0094] It should be noted that S801 to S803 may be a forward training process or an inference process. Optionally, in an inference process, the second node may feed back the obtained output data to the first node.
[0095] Optionally, the second node may determine a loss function based on an output result.
[0096] For example, the loss function may be expressed as the following formula: L = error(y, y label ), where y label is a label corresponding to first data x, y is an output result, error is a loss function, and error is related to a task of a distributed DNN. For example, in correspondence with a classification task, error may be cross-entropy; and in correspondence with a regression task, error may be a mean square error.
[0097] In a possible design manner, the distributed learning method provided in embodiments of this application may further include a reverse training process, as shown in FIG. 12(a), FIG. 12(b), and FIG. 12(c), including S1201, S1202a, S1202b, and S1203 to S1207. The distributed learning method shown in FIG. 12(a), FIG. 12(b), and FIG. 12(c) may be used in combination with the distributed learning method shown in FIG. 8.
[0098] S1201. A second node update a second data model based on output data to obtain a new second data model.
[0099] In some embodiments, S1201 may include the following step 1 and step 2.
[0100] Step 1: The second node obtains an updated value of a parameter of the second data model.
[0101] Optionally, the second node may obtain the updated value of the parameter of the second data model by using error information of the parameter of the second data model. For example, the error information may include a gradient or a normalized value of the gradient.
[0102] For example, the error information of the parameter of the second data model may be determined by the second node based on the second intermediate data and a loss function.
[0103] With reference to step (d) in FIG. 9A to FIG. 11B, using an example in which the error information is a gradient, the second node may determine, based on the second intermediate data (for example, c = h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n × f θ 1 x + k and a loss function L, that the gradient of the parameter θ 2 of the second data model is ∂ L ∂ θ 2 = ∂ L ∂ y × ∂ y ∂ θ 2 = ∂ L ∂ y × f θ 2 ′ h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n × f θ 1 x + k = ∂ L ∂ y × f θ 2 ′ c , and then, the updated value of the parameter θ 2 is θ 2 ′ = θ 2 − η × ∂ L ∂ θ 2 = θ 2 − η × ∂ L ∂ y × ∂ y ∂ θ 2 = θ 2 − η × ∂ L ∂ y × f θ 2 ′ c , where L is a loss function, y is output data, η is a learning rate, θ 2 ' is the updated value of the parameter θ 2 , and θ 2 is a current value of the parameter of the second data model. For example, θ 2 may be a value obtained after previous training.
[0104] Step 2: The second node updates the second data model based on the updated value of the parameter of the second data model.
[0105] For example, the second node may update the second data model by using θ 2 '. For example, the value of the parameter of the second data model is set to θ 2 − η × ∂ L ∂ y × ∂ y ∂ θ 2 .
[0106] S1202a and S1202b are steps of updating the first channel. Optionally, the first channel may be updated by the first node (S1202a) or the second node (S1202b).
[0107] S1202a. The first node obtains a new first channel based on error information of the second intermediate data, information about the first channel, and first intermediate data.
[0108] Optionally, the first channel includes a second channel and a third channel. S1202a may include: The first node may update the second channel based on the error information of the second intermediate data, information about the third channel, and the first intermediate data.
[0109] S1202b. The second node obtains a new first channel based on error information of second intermediate data, information about the first channel, and first intermediate data
[0110] Optionally, the first channel includes a second channel and a third channel. S1202b may include: The second node may update the second channel based on the error information of the second intermediate data, information about the third channel, and the first intermediate data.
[0111] Optionally, the first channel may be updated by the first node or the second node.
[0112] For a specific implementation of the information about the first channel, refer to the foregoing description of the information about the first channel with reference to FIG. 6 and FIG. 7. Details are not described herein again.
[0113] In a possible design manner, the distributed learning method provided in this embodiment of this application may further include: The second node sends the error information of the second intermediate data and the information about the third channel to the first node. Correspondingly, the first node obtains the error information of the second intermediate data and the information about the third channel to the first node.
[0114] In some embodiments, that the second node sends the error information of the second intermediate data and the information about the third channel to the first node may include S1204 shown in (a) in FIG. 12: The second node sends first information to the first node. Correspondingly, that the first node obtains the error information of the second intermediate data and the information about the third channel to the first node may include: The first node receives the first information sent by the second node.
[0115] Optionally, the first information may be determined by the second node based on the error information of the second intermediate data and the information about the third channel.
[0116] For example, with reference to step (e) in FIG. 9A to FIG. 11B, the second node determines, based on the output data y, a loss function, and the second intermediate data c, that the error information of the second intermediate data is ∂ L ∂ y × ∂ y ∂ c .
[0117] For example, with reference to step (f) in FIG. 9A and FIG. 9B, it is assumed that the error information of the second intermediate data is ∂ L ∂ y × ∂ y ∂ c , the information about the third channel is g 2,n × g 1,n , and the first information determined by the second node based on the error information of the second intermediate data and the information about the third channel is ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n . Referring to step (g) in FIG. FIG. 9A and FIG. 9B, the second node sends the first information ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n to the first node.
[0118] Optionally, the first node may receive, through a fourth channel, the first information sent by the second node. Correspondingly, the second node may send the first information to the first node through the fourth channel.
[0119] For example, the fourth channel may be a channel between the first node and the second node in a reverse training process. For example, the fourth channel may be a control channel.
[0120] That is, a channel between the first node and the second node in a reverse training process may be different from a channel between the first node and the second node in a forward training process, for example, in terms of frequency points or transmission mechanisms.
[0121] Optionally, the channel between the first node and the second node in the reverse training process may be the same as the channel between the first node and the second node in the forward training process.
[0122] For example, the first information may be transmitted on a conventional data / control channel, or may be transmitted on another physical / logical channel dedicated to DNN training. A transmission process may include operations of reducing a data amount such as sparseness, quantization, and / or entropy coding, or may include operations of reducing a transmission error such as channel coding.
[0123] Optionally, the second node may separately send the error information of the second intermediate data and the information about the third channel to the first node. For example, the second node sends the error information of the second intermediate data to the first node, and the second node sends the information about the third channel to the first node. A sequence is not limited. Correspondingly, the first node receives the error information of the second intermediate data from the second node, and the first node receives the information of the third channel from the second node.
[0124] In this embodiment of this application, when the channel between the first node and the second node in the reverse training process is different from the channel between the first node and the second node in the forward training process, the channel between the first node and the second node in the forward training process is referred to as the first channel, and the channel between the first node and the second node in the reverse training process is referred to as the fourth channel. When the channel between the first node and the second node in the reverse training process is the same as the channel between the first node and the second node in the forward training process, the channel between the first node and the second node in both the forward process and the reverse process is referred to as the first channel.
[0125] In some other embodiments, that the second node sends the error information of the second intermediate data and the information about the third channel to the first node may include S1205 shown in FIG. 12(b): The second node sends a fourth signal to the first node through the first channel.
[0126] Correspondingly, in S1205, the first node receives a third signal from the second node through the first channel.
[0127] Optionally, the fourth signal includes a signal generated by mapping the error information of the second intermediate data to an air interface resource.
[0128] For example, the second node sends the fourth signal including the error information ∂ L ∂ y × ∂ y ∂ c of the second intermediate data, and sets a parameter ϕ of the controllable part.
[0129] For example, the second node may repeatedly send the fourth signal, and adjust the parameter ϕ of the controllable part each time the fourth signal is sent.
[0130] For example, with reference to step (x) in FIG. 10A and FIG. 10B, when sending the fourth signal including ∂ L ∂ y × ∂ y ∂ c for the first time, the second node sets ϕ 1 to ϕ N to [0, 0, ... , 0] respectively. Then, when the fourth signal is sent for the second time to the (N+1) th< time, values of ϕ 1 to ϕ N are sequentially adjusted. For example, ϕ 1 to ϕ N are set to 0 , … , 1 ︸ n , … , 0 respectively, that is, one parameter in ϕ 1 to ϕ N is set to 1, and others are set to 0. For example, when the fourth signal is sent for the second time, ϕ 1 to ϕ N are set to 1 ︸ 1 , … , 0 , … , 0 respectively, that is, ϕ 1 = 1 is set, and ϕ 2 to ϕ N are all set to 0. Similarly, when the fourth signal is sent for the (N+1) th< time, ϕ 1 to ϕ N are set to 0 , … , 0 , … , 1 ︸ N respectively.
[0131] It should be noted that a sequence of adjusting the parameter ϕ of the controllable part is not limited in this embodiment of this application, where the foregoing is merely an example drafted in this application for ease of description, provided that the first node can obtain the error information of the first intermediate data based on the third signal.
[0132] Correspondingly, in some other embodiments, that the first node obtains the error information of the second intermediate data and the information about the third channel may include: The first node receives a third signal from the second node through the first channel, and the first node obtains the first information based on the third signal.
[0133] Optionally, the third signal is a signal obtained after the fourth signal is transmitted to the first node through the first channel.
[0134] For example, with reference to step (x) in FIG. 10A and FIG. 10B, the third signal received by the first node may include ∂ L ∂ y × ∂ y ∂ c × h or ∂ L ∂ y × ∂ y ∂ c × h + g 2 , n × g 1 , n .
[0135] Optionally, the first information may be determined by the first node based on the error information of the second intermediate data and the information about the third channel.
[0136] For example, with reference to step (x) in FIG. 10A and FIG. 10B, the first node may obtain the first information ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n based on ∂ L ∂ y × ∂ y ∂ c × h and ∂ L ∂ y × ∂ y ∂ c × h + g 2 , n × g 1 , n .
[0137] In this way, based on channel reciprocity, by using the propagation characteristic of a signal on an air interface resource, the first information (that is, the error information of the second intermediate data and the information about the third channel) is obtained through over-the-air computation, to avoid channel estimation, which can reduce pilot overheads.
[0138] In a possible design manner, the distributed learning method provided in this embodiment of this application may further include S1206 shown in FIG. 12(c): The first node sends a fifth signal to the second node through the first channel. Correspondingly, the second node receives a sixth signal from the first node through the first channel.
[0139] Optionally, the fifth signal includes a signal generated by mapping third intermediate data to an air interface resource, and the third intermediate data is for updating the first channel.
[0140] For example, the third intermediate data may be a result of processing the first data by the first node. The first node sends a fifth signal including the third intermediate data f θ1 (x), and sets a parameter ϕ of the controllable part.
[0141] For example, the first node may repeatedly send the fifth signal, and adjust the parameter ϕ of the controllable part each time the fifth signal is sent.
[0142] For example, with reference to step (y) in FIG. 11A and FIG. 11B, when sending the fifth signal including f θ1 (x) for the first time, the first node sets ϕ 1 to ϕ N to [0, 0, ..., 0] respectively. Then, when the fourth signal is sent for the second time to the (N+1) th< time, values of ϕ 1 to ϕ N are sequentially adjusted. For example, ϕ 1 to ϕ N are set to [0, ..., 1, ..., 0] respectively, that is, one parameter in ϕ 1 to ϕ N is set to 1, and others are set to 0. For example, when the fourth signal is sent for the second time, ϕ 1 to ϕ N are set to 1 ︸ 1 , … , 0 , … , 0 respectively, that is, ϕ 1 = 1 is set, and ϕ 2 to ϕ N are all set to 0. Similarly, when the fourth signal is sent for the (N+1) th< time, ϕ 1 to ϕ N are set to 0 , … , 0 , … , 1 ︸ N respectively.
[0143] It should be noted that a sequence of adjusting the parameter ϕ of the controllable part is not limited in this embodiment of this application, where the foregoing is merely an example drafted in this application for ease of description.
[0144] Optionally, the sixth signal is a signal obtained after the fifth signal is transmitted to the second node through the first channel.
[0145] Optionally, the first node may obtain third information based on the sixth signal.
[0146] For example, the third information may be determined based on the third intermediate data and the information about the third channel.
[0147] For example, with reference to step (y) in FIG. 11A and FIG. 11B, the sixth signal received by the second node may include h × f θ1 (x) or (h + g 2,n × g 1,n ) × f θ1 (x). The second node may obtain the third information g 2,n × g 1,n × f θ1 (x) based on h × f θ1 (x) and (h + g 2,n × g 1,n ) × f θ1 (x).
[0148] In this way, based on channel reciprocity, by using the propagation characteristic of a signal on an air interface resource, the information about the third channel and the third intermediate data are obtained through over-the-air computation, to avoid channel estimation, which can reduce pilot overheads.
[0149] In some embodiments, the first node or the second node may obtain a new first channel based on the first information and the first intermediate data.
[0150] The following specifically describes updating the first channel (obtaining a new first channel) with reference to Example 1 to Example 4.
[0151] Example 1: A manner of updating the first channel may include the following step 1.1 to step 1.3.
[0152] Step 1.1. The first node determines error information of a parameter of the first channel based on the first information and the first intermediate data.
[0153] Optionally, the error information of the parameter of the first channel may include a gradient of the parameter of the first channel or a normalized value of the gradient of the parameter of the first channel.
[0154] For example, the parameter of the first channel may be a parameter ϕ of a controllable part of the first channel. For a specific implementation of the parameter ϕ of the controllable part, refer to the foregoing description of the parameter of the first channel. Details are not described herein again.
[0155] Optionally, the first node may determine error information of a parameter of the second channel based on the first information and the first intermediate data.
[0156] With reference to step (h) in FIG. 9A and FIG. 9B or FIG. 10A and FIG. 10B, the first node may determine, based on the first information ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n and the first intermediate data f θ1 (x), that a gradient of the parameter of the second channel is ∂ L ∂ ϕ n = ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ , where the symbol * is a conjugation operation.
[0157] Step 1.2. The first node determines an updated value of the parameter of the second channel based on the error information of the parameter of the second channel.
[0158] With reference to step (i) in FIG. 9A and FIG. 9B or FIG. 10A and FIG. 10B, the first node may update the parameter of the second channel by using the gradient ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ of the parameter ϕ of the second channel. The updated value ϕ n ′ of the parameter of the second channel may be represented by the following formula ϕ n ′ = ϕ n − η × ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ , or ϕ n ′ may be represented by the following formula ϕ n ′ ← ϕ n − η × ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ , where ϕ n ′ represents the updated value of the parameter of the second channel, and ϕ n represents a current value of the parameter of the second channel. For example, ϕ n may be a value obtained after previous training.
[0159] Step 1.3. The first node updates the second channel based on the updated value of the parameter of the second channel.
[0160] With reference to step (j) in FIG. 9A and FIG. 9B or FIG. 10A and FIG. 10B, the first node may update the parameter ϕ n , β n , and ψ n of the second channel by using ϕ n − η ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ , to obtain a new first channel.
[0161] Optionally, the first node may be configured to adjust the parameter of the second channel.
[0162] For example, the first node has a function of adjusting the parameter of the second channel. For example, the first node includes a controller. The controller may be configured to adjust the parameter of the controllable part.
[0163] In some embodiments, after performing the foregoing step 1.1, the first node may perform the following step 2.1, to enable the second node to update the first channel.
[0164] Example 2: A manner of updating the first channel may include the foregoing step 1.1 and the following step 2.1 to step 2.3. Step 1.1 may be performed first, and then step 2.1 to step 2.3 are performed.
[0165] Step 2.1. The first node sends the error information of the parameter of the second channel to the second node. Correspondingly, the second node receives the error information of the parameter of the second channel from the first node.
[0166] For a specific implementation of the error information of the parameter of the second channel, refer to the foregoing step 1.1. Details are not described herein again.
[0167] With reference to step (k) in FIG. 9A and FIG. 9B, the first node sends ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ to the second node.
[0168] Optionally, the first node sends the error information of the parameter of the second channel to the second node through the fourth channel. Correspondingly, the second node receives the error information of the parameter of the second channel from the first node through the fourth channel.
[0169] Step 2.2. The second node determines an updated value of the parameter of the second channel based on the error information of the parameter of the second channel.
[0170] It should be noted that an implementation of step 2.2 is similar to that of the foregoing step 1.2, and a main difference is that the first node is replaced with the second node, and details are not described herein again.
[0171] Step 2.3. The second node updates the second channel based on the updated value of the parameter of the second channel.
[0172] With reference to step (1) in FIG. 9A and FIG. 9B, the second node may update the parameter ϕ n , β n , and ψ n of the second channel by using ϕ n − η × ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ , to obtain a new first channel.
[0173] For example, the second node has a function of adjusting the parameter of the second channel. For example, the second node includes a controller. The controller may be configured to adjust the parameter of the controllable part.
[0174] In this way, when the first node does not have a function of adjusting the parameter of the second channel, and the second node has a function of adjusting the parameter of the second channel, the first node may send the error information of the parameter of the second channel to the second node, to enable the second node to update the first channel.
[0175] In some embodiments, after performing the foregoing step 1.2, the first node may perform the following step 3.1 without performing step 1.3, to enable the second node to update the second channel.
[0176] Example 3: A manner of updating the second channel may include the foregoing step 1.1 and step 1.2 and the following step 3.1 and step 3.2.
[0177] Step 3.1. The first node sends the updated value of the parameter of the second channel to the second node. Correspondingly, the second node receives the updated value of the parameter of the second channel from the first node.
[0178] With reference to step (k) in FIG. 9A and FIG. 9B, the first node may send the updated value ϕ n − η × ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ of the parameter of the second channel to the second node.
[0179] Step 3.2. The second node updates the second channel based on the updated value of the parameter of the second channel.
[0180] It should be noted that, for an implementation of step 3.2, reference may be made to step 2.3. Details are not described herein again.
[0181] For example, the second node has a function of adjusting the parameter of the second channel. For example, the second node includes a controller. The controller may be configured to adjust the parameter of the controllable part.
[0182] In this way, when the first node does not have a function of adjusting the parameter of the second channel, and the second node has a function of adjusting the parameter of the second channel, the first node may send the updated value of the parameter of the second channel to the second node, to enable the second node to update the first channel.
[0183] Example 4: A manner of updating the first channel may include the following step 4.1 to step 4.3.
[0184] Step 4.1: The second node determines error information of a parameter of the second channel based on the error information of the second intermediate data, the information about the third channel, and the first intermediate data.
[0185] For example, the second node may update the second channel based on third information and the error information of the second intermediate data.
[0186] Optionally, the error information of the parameter of the second channel may include a gradient of the parameter of the second channel or a normalized value of the gradient of the parameter of the second channel.
[0187] For example, the parameter of the second channel may be a parameter ϕ of a controllable part of the first channel. For a specific implementation of the parameter ϕ of the controllable part, refer to the foregoing description of the parameter of the first channel. Details are not described herein again.
[0188] Optionally, the second node may determine the error information of the parameter of the second channel based on the error information of the second intermediate data, the information about the third channel, and the first intermediate data.
[0189] For example, the second node may determine the error information of the parameter of the second channel based on the third information and the error information of the second intermediate data.
[0190] With reference to step (u) in FIG. 11A and FIG. 11B, the second node determines, based on the third information g 2,n × g 1,n × f θ1 (x) and the error information ∂ L ∂ y × ∂ y ∂ c of the second intermediate data, that the gradient of the parameter ϕ of the second channel is ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ .
[0191] Step 4.2. The second node determines an updated value of the parameter of the second channel based on the error information of the parameter of the second channel.
[0192] With reference to step (v) in FIG. 11A and FIG. 11B, the second node may update the parameter of the second channel by using the gradient ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ of the parameter ϕ of the second channel. The updated value ϕ n ′ of the parameter of the second channel may be represented by the following formula ϕ n ′ = ϕ n − η × ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ , or ϕ n ′ may be represented by the following formula ϕ n ′ ← ϕ n − η × ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ .
[0193] Step 4.3. The second node updates the second channel based on the updated value of the parameter of the second channel.
[0194] With reference to step (w) in FIG. 11A and FIG. 11B, the second node may update the parameter ϕ n, β n , and ψ n of the second channel by using ϕ n − η × ∂ L ∂ y × ∂ y ∂ c × g 2 , n × g 1 , n × f θ 1 x ∗ , to obtain a new first channel.
[0195] For example, the second node has a function of adjusting the parameter of the second channel. For example, the second node includes a controller. The controller may be configured to adjust the parameter of the controllable part.
[0196] It should be noted that the manners of updating the first channel recorded in Example 1 to Example 4 may be further applied to a case in which both the first node and the second node have a function of adjusting a parameter of a channel.
[0197] In a possible design manner, the distributed learning method provided in this embodiment of this application may include: The first node sends a first signal to the second node through the first channel. Correspondingly, the second node receives a second signal from the first node through the first channel.
[0198] For example, the second signal is a signal obtained after the first signal is transmitted to the second node through the first channel.
[0199] Optionally, the first signal is for determining the information about the third channel.
[0200] For example, the first signal may be a pilot signal, and the first node may send a pilot and set a parameter ϕ of the controllable part.
[0201] For example, with reference to step (m) in FIG. 9A and FIG. 9B, the first node sends a pilot to the second node, and the first node sets ϕ 1 to ϕ 1 to [0, 0, ..., 0] respectively, and sets ϕ 1 to ϕ N to [0, ..., 1, ..., 0] respectively, that is, sets one parameter in ϕ 1 to ϕ N to 1, and sets others to 0. For example, when n=1, ϕ 1 to ϕ N are set to 1 ︸ 1 , … , 0 , … , 0 respectively, that is, ϕ 1 = 1 is set, and ϕ 2 to ϕ N are all set to 0.
[0202] Optionally, the second node may obtain the information about the first channel based on the second signal.
[0203] In this way, the second node may perform channel estimation to obtain information about a channel, and may update the channel or the first data model, to improve performance of distributed learning.
[0204] For example, with reference to step (n) in FIG. 9A and FIG. 9B, it is assumed that the first node sets ϕ 1 to ϕ N to [0, 0, ..., 0] respectively, and sends a pilot signal to the second node. Based on an expression h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n of a channel, the second node may obtain information h about the first channel (for example, the third channel).
[0205] The first node sets ϕ 1 to ϕ N to 0 , … , 1 ︸ n , … , 0 respectively, that is, sets one parameter in ϕ 1 to ϕ N to 1, and sets others to 0. Based on an expression h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n of a channel, the second node may obtain information h + g 2,n × g 1,n about the first channel (for example, the third channel). For example, when n=1, ϕ 1 to ϕ N are set to 1 ︸ 1 , … , 0 , … , 0 respectively, that is, ϕ 1 = 1 is set, and ϕ 2 to ϕ N are all set to 0, so that the information h + g 2,1 × g 1,1 about the first channel (for example, the third channel) can be obtained.
[0206] Based on the obtained information h about the first channel (for example, the third channel) and the obtained information h + g 2,n × g 1,n about the first channel (for example, the third channel), the second node may obtain information g 2,n × g 1,n about the first channel (for example, the third channel).
[0207] For example, in step (j) in FIG. 9A and FIG. 9B and FIG. 7, the first node sets ϕ 1 to ϕ N respectively to values obtained after previous training, and the second node may obtain information h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n about the first channel.
[0208] It should be noted that the value of N may be equal to an actual quantity of controllable units, for example, a quantity of distributed antennas or a quantity of elements of an intelligent reflective surface. Alternatively, the value of N may be less than an actual quantity of controllable units. For example, for a super-large-scale antenna array or intelligent reflective surface array, a plurality of controllable units may be controlled as a group, to reduce overheads.
[0209] It should be noted that a sequence of step (m) to step (n) and that the second node sends the first information to the first node is not limited in this embodiment of this application. For example, step (m) to step (n) may be performed before the second node sends the first information to the first node. That is, after obtaining the information about the first channel (for example, the third channel) through estimation, the second node may send the first information to the first node, to update the first channel.
[0210] S1203. The first node updates the first data model based on the error information of the first intermediate data to obtain a new first data model.
[0211] In some embodiments, S1203 may include the following step 3 to step 5.
[0212] Step 3: The first node obtains the error information of the parameter of the first data model based on the error information of the first intermediate data.
[0213] With reference to step (o) in FIG. 9A to FIG. 11B, the first node may obtain a gradient ∂ L ∂ θ 1 = ∂ L ∂ y × ∂ y ∂ c × h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n ∗ × ∂ f θ 1 ∂ θ 1 = ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z × ∂ z ∂ θ 1 of the parameter θ 1 of the first data model based on the error information ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z of the first intermediate data.
[0214] Step 4: The first node obtains an updated value of the parameter of the first data model based on the error information of the parameter of the first data model.
[0215] With reference to step (o) in FIG. 9A to FIG. 11B, the first node may obtain the updated value θ 1 ′ = θ 1 − η × ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z × ∂ z ∂ θ 1 of the parameter θ 1 of the first data model based on the error information ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z × ∂ z ∂ θ 1 of the parameter of the first data model.
[0216] Step 5: The first node updates the first data model based on the updated value of the parameter of the first data model.
[0217] With reference to step (o) in FIG. 9A to FIG. 11B, the first node may update the first data model by using θ 1 '. For example, the value of the parameter of the first data model is set to θ 1 − η ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z × ∂ z ∂ θ 1 .
[0218] In a possible design manner, the distributed learning method provided in this embodiment of this application may further include S1207 shown in (a) in FIG. 12: The second node sends second information to the first node. Correspondingly, the first node receives the second information sent by the second node.
[0219] Optionally, the second information may be for obtaining the error information of the first intermediate data.
[0220] In some embodiments, the second information may include the error information of the first intermediate data. For example, the second information may include the error information ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z of the first intermediate data.
[0221] For example, with reference to step (p) in FIG. 9A and FIG. 9B, the second node sends the error information ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z of the first intermediate data to the first node.
[0222] Optionally, the second node may send the second information to the first node through the fourth channel. Correspondingly, the first node receives, through the fourth channel, the second information sent by the second node. In other words, the second node may send the second information to the first node through the control channel.
[0223] In some embodiments, before the second node sends the second information to the first node, the distributed learning method provided in this embodiment of this application may further include: The second node obtains the error information of the first intermediate data based on the error information of the second intermediate data and the information about the first channel.
[0224] For example, with reference to step (q) in FIG. 9A and FIG. 9B, the second node determines, based on the error information ∂ L ∂ y × ∂ y ∂ c of the second intermediate data and the information h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n about the first channel, that the error information of the first intermediate data is ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z , where ∂ c ∂ z is a function of the first channel, and for a linear complex channel ∂ c ∂ z = h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n ∗ , the symbol * is a conjugation operation.
[0225] That is, after obtaining the error information of the first intermediate data, the second node may send the second information including the error information of the first intermediate data to the first node, so that the first node may update the first data model, which improves performance of distributed learning.
[0226] In some other embodiments, the second information may include the error information of the second intermediate data and the information about the first channel, and the error information of the second intermediate data and the information about the first channel are for determining the error information of the first intermediate data.
[0227] That is, the second node may send the error information of the second intermediate data and the information about the first channel to the first node. Correspondingly, the first node receives the error information of the second intermediate data and the information about the first channel that are sent by the second node.
[0228] In a possible design manner, the distributed learning method provided in this embodiment of this application may further include: S1207 shown in FIG. 12(b) or FIG. 12(c): The second node sends a seventh signal to the first node. Correspondingly, the first node receives an eighth signal from the second node, and obtains the error information of the first intermediate data based on the eighth signal.
[0229] Optionally, the eighth signal is a signal obtained after a seventh signal is transmitted to the first node through the first channel, and the seventh signal includes a signal generated by mapping the error information of the second intermediate data to an air interface resource.
[0230] For example, the second node may send the error information of the second intermediate data, and set a parameter of the controllable part.
[0231] For example, the second node may form, based on dimension matching, the error information ∂ L ∂ y × ∂ y ∂ c of the second intermediate data into a modulated symbol, modulate the modulated symbol into a waveform for sending, and adjust a parameter ϕof the controllable part, so that the first node receives different over-the-air computation results.
[0232] For example, with reference to step (p) in FIG. 10A to FIG. 11B, the second node sends a conjugate ∂ L ∂ y × ∂ y ∂ c ∗ of the error information ∂ L ∂ y × ∂ y ∂ c of the second intermediate data, and sets ϕ 1 to ϕ N respectively to values obtained after previous training, so that the first node may obtain the second information ∂ L ∂ y × ∂ y ∂ c ∗ h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n . The error information of the first intermediate data obtained by the first node meets the following formula ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z ∗ = ∂ L ∂ y × ∂ y ∂ c ∗ h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n , which is equivalent to ∂ L ∂ y × ∂ y ∂ c × ∂ c ∂ z = ∂ L ∂ y × ∂ y ∂ c h + ∑ n = 1 N g 2 , n × g 1 , n × ϕ n ∗ .
[0233] In this way, over-the-air computation of the gradient of the intermediate layer of the neural network of the first node is implemented through a process of propagation of a signal in the air, which can reduce pilot overheads.
[0234] Optionally, the distributed learning method provided in this embodiment of this application may further include performing processing, such as normalization, amplitude limiting, sparseness, and / or power control, on the error information of the parameter of the first data model, the error information of the parameter of the channel, and the error information of the parameter of the second data model, to reduce a peak-to-average ratio of a transmit waveform, improve a signal-to-noise ratio, and so on.
[0235] It should be noted that a sequence of S1201 to S1208 is not limited in this embodiment of this application provided that reverse training can be implemented.
[0236] By using the foregoing distributed learning method, a channel between the first node and the second node is trained, the channel is used as an intermediate layer (for example, a residual layer) of a data model, and the first data model, the channel, and the second data model are trained and enabled to participate in inference, which can performance of distributed learning. In addition, wireless transmission is enabled to directly serve for distributed learning, which can reduce processing complexity and further save resources.
[0237] The distributed learning method provided in embodiments of this application is described in detail above with reference to FIG. 8 to FIG. 12(c). A distributed learning apparatus provided in embodiments of this application is described below in detail with reference to FIG. 13 to FIG. 14.
[0238] FIG. 13 is a schematic diagram of a structure of a distributed learning apparatus configured to perform a distributed learning method according to an embodiment of this application. A distributed learning apparatus 1300 may be a first node or a second node, or may be a chip or another component having a corresponding function used in the first node or the second node. As shown in FIG. 13, the distributed learning apparatus 1300 may include a processor 1301 and a transceiver 1303, and may further include a memory 1302. The processor 1301 is coupled to the memory 1302 and the transceiver 1303. For example, the processor 1301 may be connected to the memory 1302 and the transceiver 1303 by a communication bus. Alternatively, the processor 1301 may be used independently.
[0239] The following describes in detail components of the distributed learning apparatus 1300 with reference to FIG. 13.
[0240] The processor 1301 is a control center of the distributed learning apparatus 1300, and may be one processor, or may be a general term of a plurality of processing elements.
[0241] The processor 1301 may perform various functions of the distributed learning apparatus 1300 by running or executing a software program stored in the memory 1302 and invoking data stored in the memory 1302.
[0242] In a specific implementation, in an embodiment, the processor 1301 may include one or more CPUs, for example, a CPU 0 and a CPU 1 shown in FIG. 13.
[0243] In a specific implementation, in an embodiment, the distributed learning apparatus 1300 may include a plurality of processors, for example, a processor 1301 and a processor 1304 shown in FIG. 13. Each of the processors may be a single-core processor (single-CPU) or may be a multi-core processor (multi-CPU). The processor herein may be one or more communication devices, circuits, and / or processing cores configured to process data (for example, computer program instructions).
[0244] The memory 1302 may be integrated with the processor 1301, or may exist independently, and is coupled to the processor 1301 through an input / output port (not shown in FIG. 13) of the distributed learning apparatus 1300. This is not specifically limited in this embodiment of this application.
[0245] For example, the input port may be configured to implement receiving functions performed by the first node or the second node in any one of the foregoing method embodiments, and the output port may be configured to implement sending functions performed by the first node or the second node in any one of the foregoing method embodiments.
[0246] The memory 1302 is configured to store a software program for executing the solutions of this application, and the processor 1301 controls execution. For a specific implementation, refer to the foregoing method embodiments. Details are not described herein again.
[0247] The transceiver 1303 is configured to communicate with another apparatus. For example, when the distributed learning apparatus 1300 is the first node, the transceiver 1303 may be configured to communicate with the second node. For another example, when the distributed learning apparatus 1300 is the second node, the transceiver 1303 may be configured to communicate with the first node. In addition, the transceiver 1303 may include a receiver and a transmitter (not separately shown in FIG. 13). The receiver is configured to implement a receiving function, and the transmitter is configured to implement a sending function. The transceiver 1303 may be integrated with the processor 1301, or may exist independently, and is coupled to the processor 1301 through an input / output port (not shown in FIG. 13) of the distributed learning apparatus 1300. This is not specifically limited in this embodiment of this application.
[0248] It should be noted that a structure of the distributed learning apparatus 1300 shown in FIG. 13 does not constitute a limitation on the distributed learning apparatus. An actual distributed learning apparatus may include more or fewer components than those shown in the figure, or some components may be combined, or a different component arrangement may be used.
[0249] Actions of the first node in the foregoing steps S801, S802, S1202a, S1203, and S1206 may be performed by the processor 1301 in the distributed learning apparatus 1300 shown in FIG. 13 by invoking application program code stored in the memory 1302, to indicate the first node to perform the actions.
[0250] Actions of the second node in the foregoing steps S803, S1201, S1202b, S1204, S1205, S1207, and S1208 may be performed by the processor 1301 in the distributed learning apparatus 1300 shown in FIG. 13 by invoking application program code stored in the memory 1302, to indicate the second node to perform the actions. This is not limited in this embodiment.
[0251] FIG. 14 is a schematic diagram of a structure of another distributed learning apparatus according to an embodiment of this application. For ease of description, FIG. 14 shows only main components of the distributed learning apparatus.
[0252] The distributed learning apparatus 1400 includes a transceiver module 1401 and a processing module 1402. The distributed learning apparatus 1400 may be the first node or the second node in the foregoing method embodiments. The transceiver module 1401 may also be referred to as a transceiver unit, and is configured to implement sending and receiving functions performed by the first node or the second node in any one of the foregoing method embodiments.
[0253] It should be noted that the transceiver module 1401 may include a receiving module and a sending module (not shown in FIG. 14). The receiving module is configured to receive data and / or signaling from a first node. The sending module is configured to send data and / or signaling to the first node. A specific implementation of the transceiver module is not specifically limited in this application. The transceiver module may include a transceiver circuit, a transceiver machine, a transceiver, or a communication interface.
[0254] The processing module 1402 may be configured to implement a processing function performed by the first node or the second node in any one of the foregoing method embodiments. The processing module 1402 may be a processor.
[0255] In this embodiment, the distributed learning apparatus 1400 is presented in a form of dividing function modules in an integrated manner. The "module" herein may be a specific ASIC, a circuit, a processor that executes one or more software or firmware programs, a memory, an integrated logic circuit, and / or another component that can provide the foregoing functions. In an embodiment, a person skilled in the art may figure out that the distributed learning apparatus 1400 may be in a form of the distributed learning apparatus 1300 shown in FIG. 13.
[0256] For example, the processor 1301 in the distributed learning apparatus 1300 shown in FIG. 13 may invoke computer-executable instructions stored in the memory 1302, so that the distributed learning method in the foregoing method embodiment is performed.
[0257] Specifically, functions / implementation processes of the transceiver module 1401 and the processing module 1402 in FIG. 14 may be implemented by the processor 1301 in the distributed learning apparatus 1300 shown in FIG. 13 by invoking computer-executable instructions stored in the memory 1302. Alternatively, functions / implementation processes of the processing module 1402 in FIG. 14 may be implemented by the processor 1301 in the distributed learning apparatus 1300 shown in FIG. 13 by invoking computer-executable instructions stored in the memory 1302, and functions / implementation processes of the transceiver module 1401 in FIG. 14 may be implemented by the transceiver 1303 in the distributed learning apparatus 1300 shown in FIG. 13.
[0258] Because the distributed learning apparatus 1400 provided in this embodiment may perform the foregoing distributed learning method, for technical effects that can be obtained by the distributed learning apparatus 1400, refer to the foregoing method embodiments. Details are not described herein again.
[0259] In a possible design solution, the distributed learning apparatus 1400 shown in FIG. 14 may be used in the communication system shown in FIG. 1, and perform functions of the first node in the distributed learning method shown in FIG. 8 and / or FIG. 12(a), FIG. 12(b), and FIG. 12(c).
[0260] The processing module 1402 is configured to process first data by using the first data model to obtain first intermediate data.
[0261] The transceiver module 1401 is configured to send the first intermediate data to a second node through a first channel, where the first channel is updated based on error information of second intermediate data, information about the first channel, and the first intermediate data, the second intermediate data is a result of transmitting the first intermediate data to the second node through the first channel, and the first channel is a channel between the distributed learning apparatus and the second node.
[0262] Optionally, the distributed learning apparatus 1400 may further include a storage module (not shown in FIG. 14), and the storage module stores a program or instructions. When the processing module 1402 executes the program or the instructions, the distributed learning apparatus 1400 is enabled to perform functions of the first node in the distributed learning method shown in FIG. 3.
[0263] It should be noted that the distributed learning apparatus 1400 may be a first node, or may be, for example, a chip (system) or another component or assembly that may be arranged in the first node. This is not limited in this application.
[0264] In addition, for technical effects of the distributed learning apparatus 1400, refer to the technical effects of the distributed learning methods shown in FIG. 8, FIG. 12(a), FIG. 12(b), and FIG. 12(c). Details are not described herein again.
[0265] In another possible design solution, the distributed learning apparatus 1400 shown in FIG. 14 may be used in the communication system shown in FIG. 1, and perform functions of the second node in the distributed learning method shown in FIG. 8 and / or FIG. 12(a), FIG. 12(b), and FIG. 12(c).
[0266] The transceiver module 1401 is configured to receive second intermediate data through a first channel, where the second intermediate data is a result of transmitting first intermediate data sent by a first node to the distributed learning apparatus through the first channel, the first channel is updated based on error information of the second intermediate data, information about the first channel, and the first intermediate data, and the first channel is a channel between the first node and the distributed learning apparatus.
[0267] The processing module 1402 is configured to process the second intermediate data by using the second data model to obtain output data.
[0268] Optionally, the distributed learning apparatus 1400 may further include a storage module (not shown in FIG. 14), and the storage module stores a program or instructions. When the processing module 1402 executes the program or the instructions, the distributed learning apparatus 1400 is enabled to perform functions of the second node in the distributed learning method shown in FIG. 8, FIG. 12(a), FIG. 12(b), and FIG. 12(c).
[0269] It should be noted that the distributed learning apparatus 1400 may be a second node, or may be, for example, a chip (system) or another component or assembly that may be arranged in the second node. This is not limited in this application.
[0270] In addition, for technical effects of the distributed learning apparatus 1400, refer to the technical effects of the distributed learning methods shown in FIG. 8, FIG. 12(a), FIG. 12(b), and FIG. 12(c). Details are not described herein again.
[0271] An embodiment of this application provides a communication system. The communication system includes a first node and a second node.
[0272] The first node is configured to perform actions of the first node in the foregoing method embodiments. For specific execution methods and processes, refer to the foregoing method embodiments. Details are not described herein again.
[0273] The second node is configured to perform actions of the second node in the foregoing method embodiments. For specific execution methods and processes, refer to the foregoing method embodiments. Details are not described herein again.
[0274] An embodiment of this application provides a chip system. The chip system includes a processor and an input / output port. The processor may be configured to implement processing functions included in the distributed learning method provided in embodiments of this application, and the input / output port may be configured to perform sending and receiving functions included in the distributed learning method provided in embodiments of this application.
[0275] For example, the input port may be configured to implement receiving functions included in the distributed learning method provided in embodiments of this application, and the output port may be configured to implement sending functions included the distributed learning method provided in embodiments of this application.
[0276] In a possible design, the chip system further includes a memory, and the memory is configured to store program instructions and data for implementing the functions included in the distributed learning method provided in embodiments of this application.
[0277] The chip system may include a chip, or may include a chip and another discrete component.
[0278] An embodiment of this application provides a computer-readable storage medium. The computer-readable storage medium includes a computer program or instructions. When the computer program or the instructions are run on a computer, the distributed learning method provided in embodiments of this application is performed.
[0279] An embodiment of this application provides a computer program product. The computer program product includes a computer program or instructions. When the computer program or the instructions are run on a computer, the distributed learning method provided in embodiments of this application is performed.
[0280] It should be understood that the processor in embodiments of this application may be a central processing unit (central processing unit, CPU). Alternatively, the processor may be another general-purpose processor, a digital signal processor (digital signal processor, DSP), an application-specific integrated circuit (application-specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA) or another programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. The general purpose processor may be a microprocessor, or the processor may be any conventional processor or the like.
[0281] It may be further understood that the memory in embodiments of this application may be a volatile memory or a nonvolatile memory, or may include a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (read-only memory, ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasable PROM, EPROM), an electrically erasable programmable read-only memory (electrically EPROM, EEPROM), or a flash memory. The volatile memory may be a random access memory (random access memory, RAM), and is used as an external cache. By way of illustrative rather than limitative descriptions, random access memories (random access memories, RAMs) in many forms may be used, for example, a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic random access memory, DRAM), a synchronous dynamic random access memory (synchronous DRAM, SDRAM), a double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), an enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), a synchlink dynamic random access memory (synchlink DRAM, SLDRAM), and a direct rambus random access memory (direct rambus RAM, DR RAM).
[0282] The foregoing embodiments may be fully or partly implemented through software, hardware (such as a circuit), firmware, or any combination thereof. When software is used to implement embodiments, all or some of the foregoing embodiments may be implemented in a form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or the computer programs are loaded or executed on a computer, the procedure or functions according to embodiments of this application are all or partially generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or other programmable apparatuses. The computer instructions may be stored on a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible to a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), a semiconductor medium, or the like. The semiconductor medium may be a solid state drive.
[0283] It should be understood that the term "and / or" in this specification describes only an association relationship between associated objects and represents that three relationships may exist. For example, A and / or B may represent the following three cases: Only A exists, both A and B exist, and only B exists. A and B may be singular or plural. In addition, the character " / " in this specification usually indicates an "or" relationship between the associated objects, but may also indicate an "and / or" relationship. For details, refer to the context for understanding.
[0284] In this application, at least one means one or more, and a plurality of means two or more. At least one of the following items (pieces) or a similar expression thereof refers to any combination of these items, including any combination of singular items (pieces) or plural items (pieces). For example, at least one of a, b, or c may indicate: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c may be singular or plural.
[0285] It should be understood that sequence numbers of the foregoing processes do not mean execution sequences in various embodiments of this application. The execution sequences of the processes should be determined based on functions and internal logic of the processes, and should not be construed as any limitation on the implementation processes of embodiments of this application.
[0286] A person of ordinary skill in the art may be aware that, in combination with the examples described in embodiments disclosed in this specification, units and algorithm steps can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed by hardware or software depends on particular applications and design constraints of the technical solutions. A person skilled in the art may use different methods to implement the described functions of each particular application, but it should not be considered that the implementation goes beyond the scope of the appended claims.
[0287] It may be clearly understood by a person skilled in the art that, for convenient and brief description, for a detailed working process of the foregoing system, apparatus, and units, refer to a corresponding process in the foregoing method embodiments, and details are not described herein again.
[0288] In the several embodiments provided, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other manners. For example, the described apparatus embodiment is merely an example. For example, division into the units is merely logical function division and may be other division during actual implementation. For example, a plurality of units or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical, or other forms.
[0289] The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of the embodiments.
[0290] In addition, functional units in embodiments of this application may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit.
[0291] When the functions are implemented in the form of a software functional unit and sold or used as an independent product, the functions may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the conventional technology, or some of the technical solutions may be implemented in a form of a software product. The computer software product is stored in a storage medium, and includes several instructions for indicating a computer device (which may be a personal computer, a server, a second node, or the like) to perform all or some of the steps in the methods described in embodiments of this application. The foregoing storage medium includes any medium that can store program code, for example, a USB flash drive, a removable hard disk, a read-only memory (read-only memory, ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disc.
[0292] The foregoing descriptions are merely specific implementations of this application, but are not intended to limit the protection scope of the appended claims. Any variation or replacement readily figured out by a person skilled in the art within the technical scope disclosed in this application shall fall within the protection scope of the appended claims. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.
Claims
1. A distributed learning method, applied to a first node, wherein the first node comprises a processor and a first data model, wherein the first data model is a neural network, and the method comprises: processing (S801) first data by using the first data model to obtain first intermediate data; and sending (S802) the first intermediate data to a second node through a first channel, wherein the first channel is updated based (S1202a) on error information of second intermediate data, information about the first channel, and the first intermediate data, the second intermediate data is a result of transmitting the first intermediate data to the second node through the first channel, and the first channel is a first wireless communication channel between the first node and the second node, wherein the first channel comprises a second channel and a third channel, wherein the second channel is a second wireless communication channel and the third channel is a third wireless communication channel, and the method further comprises: updating the second channel based on the error information of the second intermediate data, information about the third channel, and the first intermediate data, and wherein the updating the second channel based on the error information of the second intermediate data, information about the third channel, and the first intermediate data comprises: receiving (S1204) first information sent by the second node, wherein the first information is determined by the second node based on the error information of the second intermediate data and the information about the third channel, wherein error information includes a gradient or a normalized value of the gradient; and updating the second channel based on the first information and the first intermediate data.
2. The distributed learning method according to claim 1, wherein the updating the second channel based on the error information of the second intermediate data, information about the third channel, and the first intermediate data comprises: receiving a first signal from the second node through the first channel, wherein the first signal is a signal obtained after a second signal is transmitted to the first node through the first channel, and the second signal comprises a signal generated by mapping the error information of the second intermediate data to an air interface resource; obtaining first information based on the first signal, wherein the first information is determined based on the error information of the second intermediate data and the information about the third channel; and updating the second channel based on the first information and the first intermediate data.
3. The distributed learning method according to claim 2, wherein the method further comprises: sending a third signal to the second node through the first channel, wherein the third signal comprises a signal generated by mapping third intermediate data to an air interface resource, and the third intermediate data is for updating the first channel.
4. The distributed learning method according to any one of claims 1 to 3, wherein the method further comprises: updating the first data model based on error information of the first intermediate data to obtain a new first data model.
5. The distributed learning method according to claim 4, wherein the method further comprises: receiving second information sent by the second node, wherein the second information is for obtaining the error information of the first intermediate data; wherein the second information comprises the error information of the first intermediate data; or the second information comprises the error information of the second intermediate data and the information about the first channel, and the error information of the second intermediate data and the information about the first channel are for determining the error information of the first intermediate data.
6. A distributed learning method, applied to a second node, wherein the second node comprises a processor and a second data model, wherein the second data model is a neural network, and the method comprises: receiving (S802) second intermediate data through a first channel, wherein the second intermediate data is a result of transmitting first intermediate data sent by a first node to the second node through the first channel, the first channel is updated based on error information of the second intermediate data, information about the first channel, and the first intermediate data, and the first channel is a first wireless communication channel between the first node and the second node; and processing (S803) the second intermediate data by using the second data model to obtain output data, wherein the first channel comprises a second channel and a third channel, wherein the second channel is a second wireless communication channel and the third channel is a third wireless communication channel, and the method further comprises: sending the error information of the second intermediate data and information about the third channel to the first node, wherein error information includes a gradient or a normalized value of the gradient.
7. The distributed learning method according to claim 6, wherein the sending the error information of the second intermediate data and information about the third channel to the first node comprises: sending first information to the first node, wherein the first information is determined based on the error information of the second intermediate data and the information about the third channel; or sending a first signal to the first node through the first channel, wherein the first signal comprises a signal generated by mapping the error information of the second intermediate data to an air interface resource.
8. The distributed learning method according to any one of claims 6 to 7, wherein the method further comprises: receiving a second signal from the first node through the first channel, wherein the second signal is a signal obtained after a third signal is transmitted to the second node through the first channel, and the third signal is for determining the information about the first channel; and obtaining the information about the first channel based on the second signal.
9. The distributed learning method according to any one of claims 6 to 8, wherein the method further comprises: sending second information to the first node, wherein the second information is for obtaining error information of the first intermediate data; wherein the second information comprises the error information of the first intermediate data; or the second information comprises the error information of the second intermediate data and the information about the first channel, and the error information of the second intermediate data and the information about the first channel are for determining the error information of the first intermediate data.
10. The distributed learning method according to any one of claims 6 to 9, wherein the method further comprises: updating the second data model based on the output data to obtain a new second data model.
11. A distributed learning apparatus (1300, 1400), wherein the distributed learning apparatus comprises a processor (1301, 1304, 1402), wherein the processor is coupled to a memory (1302); the memory is configured to store a computer program; and the processor is configured to execute the computer program stored in the memory, to perform the distributed learning method according to any one of claims 1 to 10.
12. A computer-readable storage medium, wherein the computer-readable storage medium comprises a computer program or instructions, and when the computer program or the instructions are run on a processor of a computer, the method according to any one of claims 1 to 10 is performed.