# GCN-Informer: A Novel Framework for Mid-Term Photovoltaic Power Forecasting
## 2 Methodology
### Gcn  
GCN, at its core, functions as a feature extractor, with the fundamental idea of updating its own nodes by aggregating the features of neighboring nodes. Traditional CNNs struggle to capture its spatial features, which are inherently irregular, and GCN proves to be an effective tool for this purpose. By constructing the adjacency matrix and degree matrix, coupled with the graph's inherent feature matrix, it becomes possible to extract the influence of other nodes on the target node. Taking this graph as an example, GCN can capture the mutual influence between adjacent nodes, a task that CNN networks find challenging to accomplish. The feature vector at layer \(l\) associated with node i in the graph convolution network is represented by \(x_{i}^{l}\). We apply a nonlinear transformation to the eigenvector \(x_{j}^{l}\) of all nodes \(j\) in the neighborhood node \(i\), and activate \(x_{i}^{l+1}\) in the next layer. Therefore, the eigenvector \(x_{i}^{l+1}\) at the vertex \(i\) of the graph convolution network is represented:  
\[x_{i}^{l+1}=f(x_{i}^{l},\{x_{i}^{l}:j\sim i\}) \tag{7}\]  
where \(\{j\sim i\}\) represents the set of adjacent nodes centered on node \(i\). In this article, node feature \(x\) and edge feature \(y\) are defined:  
\[x_{i}^{l+1}=x_{i}^{l}+\text{Re}\,LU(BN(W_{1}^{l}x_{i}^{l}+\sum_{j\sim i}\frac{ \sigma(e_{ij}^{l})}{\sum_{j^{\prime}\sim i}\sigma(e_{ij^{\prime}}^{l})+\epsilon }\odot W_{2}^{l}x_{j}^{l})) \tag{8}\]  
\[e_{ij}^{l+1}=e_{ij}^{l}+\text{Re}\,LU\Big{(}BN\Big{(}W_{3}^{l}e_{ij}^{l}+W_{4} ^{l}x_{i}^{l}+W_{5}^{l}x_{i}^{l}\Big{)}\Big{)} \tag{9}\]  
where \(W\in R^{h\times h}\), \(\sigma\) is the sigmoid function, \(\epsilon\) is a very small value, Re\(LU\) is the activation function, and \(BN\) represents batch normalization. The final updating rule of the GCN is as follows:  
\[H^{(l+1)}=\sigma\Big{(}\tilde{D}^{-\frac{1}{2}}Attention(Q,K)\tilde{D}^{-\frac {1}{2}}H^{(l)}W^{(l)}\Big{)} \tag{10}\]  
where \(H^{(l+1)}\) represents the feature matrix of the next layer's nodes. \(\sigma\) denotes the activation function. \(H^{(l)}\) stands for the feature matrix of the current layer's nodes. \(W^{(l)}\) signifies the weight matrix of the current layer. Up to this point, each node in GCN is associated with a query vector and key vectors related to other nodes. Edges represent the strength of connections between nodes. The strength of these connections is computed by the dot product of query and key, and it can reflect the degree of interaction between nodes. This information can be utilized to construct a graph in which the edge weights are determined by attention scores. After passing the dynamic adjacency matrix and node features as input to the GCN layer, the GCN layer will use this adjacency matrix to perform graph convolution operations, aggregating information from neighboring nodes. Since the adjacency matrix is constructed based on attention scores, the GCN layer considers the importance of different neighboring nodes when aggregating information. After processing by the GCN layer, each node will obtain an updated feature vector. These feature vectors not only contain the node's own information but also incorporate information from neighboring nodes, taking into account the importance of different neighbors. This information may include direct causal relationships (for example, increased irradiance leads to increased photovoltaic power generation) or more complex indirect relationships (such as a certain combination of temperature and humidity that may cause changes in photovoltaic power generation). During training, we update the model's parameters through the backpropagation algorithm and gradient descent optimizer. This includes the parameters in the Informer model (such as the linear transformation weights for query and key vectors) and the parameters in the GCN layer (such as the weights and biases of the convolution kernels).