## 3 Methodology
### Main Training Process  
Algorithm 1 summarizes the modeling process for 2D and 3D CSNGAN-ASPP as follows:  
```
Input: original training dataset \((A,B)\) including real image \(A\) and conditioning data \(B\), batch size \(M\), initial guesses \(D_{\theta}\), \(G_{\theta}\), learning rates \(\eta_{D}\), \(\eta_{G}\), latent vectors \(z\), and total training iterations \(n\).
1. Divide the original training dataset into training dataset and testing dataset.
2. Initialize the discriminator \(D\) and generator \(G\) as \(D_{\theta}\) and \(G_{\theta}\) at first.
3. For\(i\) in range (\(n\)):
4. Sample a batch of \(\{B_{1},\dots,B_{M}\}\) and \(z\) to obtain \(\{A^{\prime}_{1},\dots,A^{\prime}_{M}\}\), \(A^{\prime}_{i}=\widetilde{G}_{\theta}(z,B_{i})\).
5. Calculate the loss function \(\mathcal{L}(D)|D_{\theta}\big{(}A^{\prime}_{i},B_{i}\big{)}\), \(D_{\theta}(A_{i},B_{i})\).
6. Perform backpropagation through \(\mathcal{L}(D)\) and update \(D_{\theta}\) through \(\eta_{D}\) according to stochastic gradient descent.
7. Prepare \(\{B_{1},\dots,B_{M}\}\) and \(z\) to obtain \(\{A^{\prime}_{1},\dots,A^{\prime}_{M}\}\), \(A^{\prime}_{i}=G_{\theta}(z,B_{i})\).
8. Calculate the loss function \(\mathcal{L}(G)_{prior}\left\{\widetilde{D}_{\theta}\big{(}A^{\prime}_{i},B_{ i}\big{)}\right\}\) and \(\mathcal{L}_{cont}\big{(}A_{i},A^{\prime}_{i}\big{)}\).
9. Perform backpropagation through \(\mathcal{L}(G)_{total}\) and update \(G_{\theta}\) through \(\eta_{G}\) according to stochastic gradient descent.
10. End.
11. Evaluate network simulation performance by using testing datasets.
12. If simulation performance is not good:
13. Skip to step 2 and retrain CSNGAN-ASPP.
14. Else:
15. Save \(G\), \(D\) and reuse network parameters to perform stochastic reconstruction. Output: Multiple 2D/3D reconstructions with conditioning data constraints.
```  
**Algorithm 1**Conditioning reconstruction of geological reservoir models based on CSNGAN-ASPP  
It mainly includes the following five steps:  
(1) Dataset preparation: Split the original training images into pairs of real images \(A\) and conditioning data \(B\) as the overall dataset, which is randomly divided into training dataset and testing dataset in a proportional manner.  
(2) Network initialization: Initialize the generator and discriminator networks as \(G_{\theta}\) and \(D_{\theta}\), respectively.  
(3) Discriminator training: Keep the generator network parameters fixed, input random noise \(z\) and conditioning data \(B\) into the generator \(\widetilde{G}_{\theta}\) to obtain the generated images \(A^{\prime}\), and then input \(A\) and \(A^{\prime}\) into the discriminator \(D_{\theta}\) to optimize the discriminator network parameters by Equation (9).  
(4) Generator training: Fix the discriminator network parameters, input random noise \(z\) and conditioning data \(B\) into the generator \(G_{\theta}\) to obtain the reconstructed images \(A^{\prime}\). Optimize the generator network parameters by calculating the adversarial loss and conditional loss by Equation (10).  
(5) Simulation performance evaluation: Evaluate the reconstruction performance. If it is satisfactory, save the corresponding network parameters for subsequent conditional reconstruction of different types of reservoir geological models. Otherwise, return to step (2), reset the network parameter values, and retrain the CSNGAN-ASPP model.