## 3 Methodology
### Heterogeneous Graph Attention  
With the issue of graph structure generation addressed, methods of effectively training the graph network parameters and obtaining appropriate feature weights is crucial for enhancing the accuracy of wind power predictions. The graph attention mechanism can autonomously learn the relationships between nodes, assigning more attention to strongly correlated features, and has demonstrated strong performance in graph learning. However, conventional graph attention methods often overlook node or edge types and may fail to accurately identify intrinsic data relationships when the graph structure contains heterogeneous nodes and edges. In wind power forecasting, the types of associations among different features may vary from each other, and these relationships may change with the data. Therefore, this study introduces heterogeneous functions to the graph attention structure, enabling heterogeneous learning of wind power feature graphs. The specific principles of the learnable heterogeneous graph attention model are as follows:  
As shown in Figure 3a, a typical graph attention structure calculates the bidirectional weights between connected nodes i and j to obtain the corresponding graph attention coefficients \(\alpha_{\text{ij}}\) and \(\alpha_{\text{ji}}\), which is expressed in Equation (5). \[\alpha_{\text{ij}}=\frac{\exp\Big{(}\text{LeakyReLU}\Big{(}\overset{\to \text{T}}{\text{a}}\Big{[}\text{W}\overset{\to}{\text{h}}_{\text{i}}\Big{\|} \text{W}\overset{\to}{\text{h}}_{\text{j}}\Big{]}\Big{)}\Big{)}}{\sum\limits_{ \text{IN}_{\text{i}}}\exp\Big{(}\text{LeakyReLU}\Big{(}\overset{\to\text{T}}{ \text{a}}\Big{[}\overset{\to\text{T}}{\text{h}}_{\text{i}}\Big{\|}\text{W} \overset{\to}{\text{h}}_{\text{h}}\Big{]}\Big{)}\Big{)}} \tag{5}\]  
where LeakyReLU is an activation function, W is the weight matrix, \(\overset{\to\text{T}}{\text{a}}\) is an attention kernel that is a one dimension tensor with twice size of the output and used to generate the original attention rate from the concatenated tensor \(\left[\text{W}\overset{\to}{\text{h}}_{\text{i}}\Big{\|}\text{W}\overset{\to} {\text{h}}_{\text{j}}\right]\), \(\overset{\to}{\text{h}}\) represents a node feature vector, and N\({}_{\text{i}}\) is the number or nodes directly connected to node i. In this computation process, the types of edges among all connected nodes are assumed to be the same, which is suitable for cases where node feature associations are similar. However, in wind power forecasting, features include various types such as weather conditions and wind turbine characteristics, leading to complex relationships among features. Therefore, by introducing an edge-type function, we modify the aforementioned formula to Equation (6):  
\[\alpha_{\text{ij}}=\frac{\exp\biggl{(}\text{LeakyReLU}\biggl{(}\overset{ \rightarrow}{\text{a}}^{\text{T}}\biggl{[}\text{W}\overset{\rightarrow}{ \text{h}}_{\text{i}}\biggl{\|}\text{W}\overset{\rightarrow}{\text{h}}_{ \text{j}}\biggl{\|}\text{W}\overset{\rightarrow}{\text{E}}_{\text{\Psi}(( \text{ij}))}\biggr{]}\biggr{)}\biggr{)}}{\sum\limits_{\text{IN}_{\text{i}}}\exp \biggl{(}\text{LeakyReLU}\biggl{(}\overset{\rightarrow}{\text{a}}^{\text{T}} \biggl{[}\text{W}\overset{\rightarrow}{\text{h}}_{\text{i}}\biggl{\|}\text{W} \overset{\rightarrow}{\text{h}}_{\text{1}}\biggl{\|}\text{W}\overset{\text{E}} {\text{E}}_{\text{\Psi}((\text{ij}))}\biggr{]}\biggr{)}\biggr{)}\biggr{)}} \tag{6}\]  
where \(\text{W}\overset{\rightarrow}{\text{E}}\) is the weight matrix of various edge types, \(\text{\Psi}((\text{i},\text{j}))\) is the edge type function, and \(\text{E}_{\text{\Psi}((\text{ij}))}\) is the embedding of edge types. As shown in Figure 3b, the types of edges between different nodes may vary. For example, during the data learning process, edge-type parameters between wind speed and wind direction typically differ significantly from those between engine speed and current.