# A Data-Driven Approach for Generating Synthetic Load Profiles with GANs
## 2 Materials and Methods
### Model Definition
#### 2.6.2 Discriminator  
The discriminator is structured as a feature extractor and regressor that scores input load profiles on their realism. It starts by reshaping the 24-dimensional input vector into a 1D sequence suitable for convolution. The use of convolutional layers with increasing filter counts ensures that the discriminator captures increasingly abstract and broader temporal patterns in the profile while reducing dimensionality. This structure is effective in identifying inconsistencies in the generated sequences, especially since real-world load profiles often contain distinct morning, daytime, and evening patterns.  
The use of small convolution kernels again emphasizes local temporal relationships, important for capturing typical load profile characteristics, such as peak demand periods or low-activity hours. Dropout layers after each convolutional block add regularization, which is important when training with small datasets, preventing overfitting to specific daily shapes. After flattening, a single dense layer with no activation produces the Wasserstein score, which guides the generator via the WGAN-GP loss formulation. The structure of the discriminator is summarized in Figure 4.  
This architectural approach, combining upsampling and convolution in the generator with progressive convolution and compression in the discriminator, is well-suited for capturing the nuanced structures of daily load profiles. It allows the model to synthesize realistic time-series data with locally coherent patterns and supports robust discrimination even with limited training data.  
All models developed and evaluated in this study are implemented using TensorFlow, an open-source deep learning framework widely adopted for building and training neural networks. The modular architecture of TensorFlow allows for seamless construction of both the generator and discriminator networks using Conv1D, Dense, BatchNormalization, Dropout, and UpSampling1D layers. Custom training loops are employed to implement the WGAN-GP loss with gradient penalty, ensuring stable training. Additionally, TensorFlow's automatic differentiation engine is used to calculate the gradients required for both  
Figure 4: Summary of the discriminator structure.  
Figure 3: Summary of the generator’s structure.  
generator updates and gradient penalty terms. The proposed methodology is summarized in Algorithm 1.  
```
1:Input: A Dataset of load profiles
2:Output: A synthetic dataset of load profiles
3:Initiate Critic variables: number of critics
4:Build the Generator: \(G\)
5:Build the Discriminator (Critic): \(D\)
6:Define the Gradient Penalty function: \(GP\)
7:Train \(G\) model
8:Train \(D\) model
9:Train Conv1D-WGAN-GP:
10:for each epoch do:
11:for each number of critics do:
12:Sample random noise vector \(z\)\(\sim\)\(N(0,\ 1)\)
13:Sample a batch of real samples \(x\) from the training data
14:Generate fake samples \(G(z)\)
15:Compute the critic loss \(d_{loss}=D(fake)-D(real)+\lambda*GP(real,\ fake)\)
16:Update critic \(D\) using gradients of \(d_{loss}\)
17:endfor
18:Sample random noise vector \(z\)\(\sim\)\(N(0,\ 1)\)
19:Generate fake samples \(G(z)\)
20:Compute generator loss--\(g_{loss}=-D(G(z))\)
21:Update generator \(G\) using gradients of \(g_{loss}\)
22:endfor
23:Generate Synthetic Data:
24:Sample noise vectors \(z\)\(\sim\)\(N(0,\ 1)\)
25:Generate synthetic samples: \(G(z)\)
```  
**Algorithm 1** Conv1D-WGAN-GP