## 4 Major Components of Network Slicing System
### Advanced Deep Learning Module
3:Begin
4:for number of training iterations {
5:for j=1 to m {
6: Divide the data into minibatch \(\{z^{1},z^{2},z^{3},...,z^{n}\}\) of n noises sampled from noise prior \(P_{g}(z)\)
7: Divide the data into minibatch \(\{x^{1},x^{2},x^{3},...,x^{n}\}\) of n noises sampled from noise prior \(p_{data}(x)\)
8: Adjust the parameters \(\theta_{Dis}\) of the Dis module with the following averaged stochastic gradients \(\theta\longleftarrow\theta d+\eta\bigtriangledown\theta_{d}\frac{1}{\text{m} }\sum_{i=1}^{m}\big{[}\log D(x^{i})+\log(1-D(G(z^{1})))\big{]}\)
9:end of for loop
10: Divide the data into minibatch \(\{z^{1},z^{2},z^{3},....,z^{n}\}\) of n noises sampled from \(P_{g}(z)\)
11: Adjust the parameters \(\theta_{Gen}\) of the Gen module with the following averaged stochastic gradients \(\theta\longleftarrow\theta g-\eta\bigtriangledown\theta_{g}\frac{1}{\text{m} }\sum_{i=1}^{m}\big{[}\log(1-D(G(z^{1}))\big{]}\)
12:end of for loop
13: Terminate (conditions satisfied)
14:End
```  
**Algorithm 1** Pseudo-code for the generative adversarial network (GAN) model. In the second discriminator part, we have used the CNN model for the prediction of resource utilization that takes the input data or generated data from the generator module. CNN takes three-dimensional input for training purposes and also has fully connected (FC) layers for better prediction. This part estimates the probability of whether the input data are real or predicted from the previous module. Both the models (G, D) are trained on real and generated datasets by using stochastic gradient descent (SGD) model. The final output is the resource utilization statistics of the underlying VMs for each slice next time t, after that the predicted values will be used by the resource update manager of the IBN tool. Those predicted statistics are very useful for network slice acceptance, resources scale-up, failure recovery, and resource management. The training of the generator and discriminator is summarized in Algorithm 2, which is an iterative process by partitioning the data into mini-batches of size n. We have used a stochastic gradient descent method for generalizing the algorithm into mini-batches of size n. The generator module should minimize the adversarial loss as much as possible so that the discriminator module will not perform prediction correctly. The generator module is trained by giving input data in the LSTM unit and it generates similar kinds of data samples for the discriminator module. After that in the discriminator module, this generated data samples and original input data have been used to confuse the discriminator for predicting either the date is fake or original. The CNN model in the discriminator module classify and discriminate between two datasets and predict the resource utilization accurately. ```
1:Step 1: Initialize the learning rates for Generator Gen and Discriminator Dis. 2:adjust the parameters
3:set the weights \(W_{Gen}\) and \(W_{Dis}\)
4:While not satisfied do
5:Step 3: Update the Generator Gen Module:
6:Get n new data samples
7:Get updated weight \(W_{Gen}\) for Generator
8:Step 4: Update the Discriminator Dis Module:
9:Get n new data samples
10:Get updated weight \(W_{Dis}\) for Discriminator
11:Step 5: End While
```  
**Algorithm 2** Pseudo-code for the training of Generator and Discriminator. We have used an open-source dataset provided by the MATERIALS datacenter which contains performance metrics of 547, 520, and 527 data center virtual machines (VMs). MATERIALS is a well-known service provider and IT product manufacturing organization. The dataset was collected in three traces within a period of three months, so one trace for one month timestamp. More detail about dataset collection is in this paper [25].