# Taylor Bird Swarm Algorithm Based on Deep Belief Network for Heart Disease Diagnosis
## 3 Proposed Taylor-BSA-DBN for Medical Data Classification
### Classification of Medical Data with Proposed Taylor-BSA-Based DBN
#### 3.3.2 Architecture of Deep Belief Network  
The DBN [33] is a subset of Deep Neural Network (DNN) and comprises different layers of Multilayer Perceptrons (MLPs) and Restricted Boltzmann Machines (RBMs). RBMs comprise of visible and hidden units that are associated with weights. The basic structural design of the DBN is illustrated in Figure 2.  
Training of Deep Belief Network  
This section elaborates on the training process of the proposed Taylor-BSA-DBN classifier. A RBM has unsupervised learning based on the gradient descent method, whereas MLP performs a supervised learning method using the standard backpropagation algorithm. Therefore, the training of DBN is based on a gradient descent-backpropagation algorithm. Here, the most appropriate weights are chosen optimally for the update. The training procedure of the proposed DBN classifier is described below,  
1. Training of RBM Layers A training sample \(N\) is given as the input to the first layer of RBM. It computes the probability distribution of the data and encodes it into the weight parameters. The steps involved in the training process of RBM are illustrated below. 1. The input training sample is read and the weight vector is produced randomly. 2. The probability function of each hidden neuron in the first RBM is calculated. 3. The positive gradient is computed using a visible vector and the probability of the hidden layer. 4. The probability of each visible neuron is obtained by reconstructing the visible layer from the hidden layer. 5. The probability of reconstruction of hidden neurons is obtained by resampling the hidden states. 6. The negative gradient is computed. 7. Weights are updated by subtracting the negative gradient from the positive gradient. 8. Weights are updated for the next iteration, using the steepest or gradient descent algorithm. 9. Energy is calculated for a joint configuration of the neurons in the visible and the hidden layers. 2. Training of MLP The training procedure in MLP is based on a backpropagation approach by feeding the training data, which are the hidden output of the second RBM layer through the network. Analyzing the data, the network is adjusted iteratively until the optimal weights are chosen. Moreover, Taylor-BSA is employed to compute the optimal weights, which are determined using the error function. The training procedure is summarized below.  
1. Randomly initialize the weights.  
Figure 2: Architectural view diagram of DBN classifier.  
Read the input sample from the result of the preceding layer.
3. Obtain the average error, based on the difference between the obtained output and the desired output.
4. Calculate the weight updates in the hidden and the visible layers.
5. Obtain the new weights from the hidden and the visible layers by applying gradient descent.
6. Identify the new weights using the updated equation of Taylor-BSA.
7. Estimate the error function using gradient descent and Taylor-BSA.
8. Choose the minimum error and repeat the steps.