# Prediction of Emotional Empathy in Intelligent Agents to Facilitate Precise Social Interaction
## 3 Materials and Methods
### Mathematical Model of One-Dimensional Convolutional Neural Network  
As expressed previously, an ODCNN is utilized in this work to select features. Considering a training dataset's matrix \(\mathrm{y}=[\mathrm{y}_{1},\mathrm{y}_{2},\ldots,\mathrm{y}_{m}]^{\prime}\), where the length of the training dataset is represented by \(\mathrm{m}\), and every \(\mathrm{y}_{i}\) vector is shown in the k-dimensional vector-space. We can likewise represent \(\mathrm{X}=[\mathrm{X}_{1},\mathrm{X}_{2},\ldots,\mathrm{X}_{m}]^{\prime}\), which is the actual input. The target vector (TV) is related to \(\mathrm{Y}\). The ODCNN comprises Q-layers, with every layer (\(\mathrm{q}=1,\ldots,\mathrm{Q}\)) made out of \(\mathrm{n}\mathrm{q}\), including features, and carries out the subsampling and convolution functions. The subsampling factor (SSF) is supposed to be consistently equivalent to two (SSF = 2). The above Figure 5 represents an overall ODCNN structure. The below section describes the mathematical formulation of forwarding propagation (FP). Supposing that during FP, for current layer \(\mathrm{q}\), the input features of the q-layer is the acquisition of the last yield (after the sub-sampling) of the prior features (\(\mathrm{q}-1\)) convolved with the respective kernels and proceeded through a nonlinear activation function (AF) as given below in Equations (1) and (2):  
\[b_{j}^{q}=a_{j}^{q}+\sum\
olimits_{l\,=\,1}^{m^{q-1}}con1D\ (s_{j,l}^{q},\ w_{l}^{q-1})\ ( \mathrm{j}\ =\ 1,\ldots,n^{q}) \tag{1}\]  
\[=\mathrm{f}(b_{j}^{q}) \tag{2}\]  
For q-layer, the input to the jth feature is represented by \(b_{j}^{q}\), and this feature's bias is represented by \(a_{j}^{q}\), and \(w_{j}^{q}\) is the yield, on the prior layer (\(\mathrm{q}-1\)), \(w_{l}^{q-1}\) is the yield of the lth  
Figure 5: One-dimensional convolutional neural network structure. feature, \(s_{j,l}^{q}\) is the kernel weight-vector between the lth feature on the (q \(-\) 1) layer and the jth feature on the qth layer, and the AF is represented by f(\(\cdot\)). Ordinarily, the sigmoid AF is utilized, and the below Equation (3) communicates that:  
\[f(y)\ =\ \frac{1}{1+e^{-y}} \tag{3}\]  
Concerning the vector's dimension on each piece of the ODCNN, if it is supposed that c\({}^{\text{q}}\) is the dimension of each feature's yield on the q-layer and g\({}^{\text{q}}\) is the corresponding kernel's length, the last yield of the next coming layer's features q + 1 (q + 1 \(\leq\) Q) is expressed by Equation (4):  
\[c^{q+1}=\frac{c^{q}\ -g^{q}+1}{2} \tag{4}\]  
In the last layer, the feature's outputs are stacked in one h-vector, and the feature of the ODCNN with the size m is equivalent to cQ \(\times\) nQ. This layer's neurons are completely connected to the resulting layer. In most cases, we have to tackle regression problems. Each y-input has one x-output, and only a single neuron shapes the yield layer, and its yield x = w\({}^{\text{q}+\ 1}\) is generated as given below in Equation (5):  
\[x\ =\ w^{q+1}\ =\ f(a^{Q+1}+\sum_{j=\ 1}^{m}\left(\,s_{1,j}^{Q+1}\ X\ h\right)) \tag{5}\]  
The below section provides details about Back-Propagation (BP). ODCNN training is required to calculate the output layer's error at layer I(x) and the 'gradient' \(\partial\text{I}/\partial\text{x}\). The aim of computing this error is to perform weight estimation for error minimization while carrying out the learning process. Herein, according to each weight, it is required to compute the error-derivative denoted by Equation (6):  
\[\frac{\partial\text{I}}{\partial s_{j,l}^{q}}=\Delta\ s_{j,l}^{q} \tag{6}\]  
Applying the chain rule to the below-  
At the current layer, the derivative \(\frac{\partial\mathrm{I}}{\partial b_{j}^{\mathrm{f}}}\) can be determined by calculating the derivative of AF f (\(b_{j}^{\mathrm{q}}\)).