# WGAN-Based Realization Process of Gravel Soil for Hydraulic Property Simulation
## 3 Model Training
### Loss Function of the WGAN with Gradient Penalty (GP)  
The improvements proposed by [12] and subsequent researchers address several key challenges in training Generative Adversarial Networks (GANs), aiming to stabilize and enhance the quality of generated images. A detailed explanation of each optimization strategy compared to the original GAN algorithm is provided below:  
Removal of the sigmoid activation function: Unlike traditional GANs, WGANs eliminate sigmoid activation at the discriminator's output layer. This change allows the discriminator to output unbounded real numbers, which are used to compute distances like Wasserstein or Earth-Mover's distance. Log-less loss function: Traditional GANs use logarithmic loss functions, such as binary cross-entropy. WGANs, on the other hand, use loss functions that do not involve logarithms. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **Block** & **Layer** & **Activation** & **Output Shape** & **Strides** & **Filling** & **Normal** \\ \hline \multirow{8}{*}{**DCGANs**} & \multicolumn{2}{c}{Latent vector} & - & \(200\times 1\) & - & - & - \\ \cline{2-6}  & \multirow{2}{*}{Block 1 (\(4\times 4\times 4\))} & Fully connected & ReLU & \(32.768\times 1\) & - & - & - \\  & & Reshape & & \(4\times 4\times 4\times 512\) & - & - & - \\  & & Convolutional \(4\times 4\times 4\) & ReLU & \(4\times 4\times 512\) & 1 & 0 & yes \\ \cline{2-6}  & \multirow{2}{*}{Block 2 (\(8\times 8\times 8\))} & \multirow{2}{*}{Densampling} & - & \(8\times 8\times 8\times 256\) & - & - & - \\  & & Convolutional \(4\times 4\times 4\) & ReLU & \(8\times 8\times 8\times 256\) & 2 & 1 & yes \\ \cline{2-6}  & \multirow{2}{*}{Block 3 (\(16\times 16\times 16\))} & \multirow{2}{*}{Densampling} & - & \(16\times 16\times 16\times 128\) & - & - & - \\  & & Convolutional \(4\times 4\times 4\) & ReLU & \(16\times 16\times 16\times 128\) & 2 & 1 & yes \\ \cline{2-6}  & \multirow{2}{*}{Block 4 (\(32\times 32\times 32\))} & \multirow{2}{*}{Densampling} & - & \(32\times 32\times 32\times 64\) & - & - & - \\  & & Convolutional \(4\times 4\times 4\) & ReLU & \(32\times 32\times 32\times 64\) & 2 & 1 & yes \\ \cline{2-6}  & \multirow{2}{*}{Block 5 (\(64\times 64\times 64\))} & \multirow{2}{*}{Densampling} & - & \(64\times 64\times 64\) & - & - & - \\  & & Convolutional \(1\times 1\times 1\) & Tanh & \(64\times 64\times 64\) & 2 & 1 & no \\ \hline \multirow{8}{*}{**DCGANs**} & \multicolumn{2}{c}{Input image} & - & \(64\times 64\times 64\) & - & - & - \\  & & Convolutional \(1\times 1\times 1\) & LReLU & \(64\times 64\times 64\times 1\) & 1 & 0 & no \\ \cline{2-6}  & \multirow{2}{*}{Block 5 (\(64\times 64\times 64\))} & \multirow{2}{*}{Convolution \(4\times 4\times 4\)} & \multirow{2}{*}{LReLU} & \(64\times 64\times 64\times 1\) & 2 & 1 & no \\ \cline{2-6}  & \multirow{2}{*}{Block 4 (\(32\times 32\times 32\))} & \multirow{2}{*}{Densampling} & - & \(32\times 32\times 32\times 64\) & - & - & - \\  & & Convolutional \(4\times 4\times 4\) & LReLU & \(32\times 32\times 32\times 64\) & 2 & 1 & yes \\ \cline{2-6}  & \multirow{2}{*}{Block 3 (\(16\times 16\times 16\))} & \multirow{2}{*}{Densampling} & - & \(16\times 16\times 16\times 128\) & - & - & - \\  & & Convolutional \(4\times 4\times 4\) & LReLU & \(16\times 16\times 16\times 128\) & 2 & 1 & yes \\ \cline{2-6}  & \multirow{2}{*}{Block 2 (\(8\times 8\times 8\))} & \multirow{2}{*}{Densampling} & - & \(8\times 8\times 8\times 256\) & - & - & - \\  & & Convolutional \(4\times 4\times 4\) & LReLU & \(8\times 8\times 8\times 256\) & 2 & 1 & yes \\ \cline{2-6}  & \multirow{2}{*}{Block 1 (\(4\times 4\times 4\))} & \multirow{2}{*}{Densampling} & - & \(4\times 4\times 4\times 512\) & - & - & - \\  & & Convolutional \(4\times 4\times 4\) & LReLU & \(4\times 4\times 512\) & 1 & 0 & no \\  & & Reshape & Flatten & \(32.768\times 1\) & - & - & - \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The architectures of the generator and the discriminator used in this study.