## 4 Methods and Results
### Neural Network Method
#### 4.2.2 Construction of Neural Network  
A BP neural network was built using the MATLAB software. A large sample size can assure that the neural network learns data features to the maximum extent and thus increases accuracy of the neural network. To construct the BP neural network, it usually needs data processing, data input, parameter setting and algorithm selection. The whole process is introduced as follows:  
1. Data normalization  
Figure 8: Neural network structure. Figure 7: TOC prediction results by \(\Delta\)log R method in LT1 well: **(a)** Ma \(5_{6-10}\) and **(b)** Ma 3. Since different logging data have different units that may influence training of the model, it is necessary to implement normalization of TOC data and logging data before the logging data are input into the model in order to improve accuracy of the model and shorten operation time. The normalization uses the range method and its formula is:  
\[X_{n}=\frac{X-X_{min}}{X_{max}-X_{min}} \tag{8}\]  
where \(X_{n}\) is the sample normalization result of logging curve, \(X\) is the original logging value, \(X_{min}\) is the minimum and \(X_{max}\) is the maximum. 2. Data input  
According to correlation analysis results, the normalized K, GR and DEN logging data were input into the neural network. To avoid overfitting and assure training quality, a cross-training verification mode was used in the training process of the neural network. Training set, verification set and test set were allocated randomly according to proportions of 70%, 15% and 15%, respectively. Data in the training set (110 groups) were used for the neural network to learn and identify data characteristics. Data in the verification set (24 groups) were used to test whether overfitting occurs (if the error between data used for learning that are output by the neural network and real results decreases, but the error between the current data group after neural network output and the real result is unchanged, overfitting occurs). Data in the test set (24 groups) were used to test unknown sample prediction capacity of the neural network. 3. Parameter setting of the hidden layer  
Increasing hidden layers can decrease the error of the neural network and increase the interpretation accuracy. Nevertheless, excessive hidden layers may cause more operations during data transmission in the neural network, so it takes more time for assignment of each layer. Moreover, increasing hidden layers is conducive to explore data characteristics more carefully. With limitations of sample size, some characteristics might exist in learning samples only and they are not applicable to whole data. Hence, overfitting occurs. The BP neural network still can approach any function by adjusting training times or number of nodes in the hidden layer even though it contains only one hidden layer. To decrease calculation while assuring accuracy of the neural network, the number of hidden layers was set 1 during construction of the BP neural network. Setting the number of nodes in the hidden layer is crucial to construction of the neural network. If the number of nodes is too high, it increases computational loads during data transmission in the neural network. If the number of nodes is too low, it is impossible to learn data features accurately so that the trained neural network cannot recognize the unlearned samples. To determine number of nodes in the hidden layer, several studies have been carried out and many empirical formulas have been proposed. According to the Kolmogorov theorem, when there's only one hidden layer, the number of nodes meets:  
\[N_{hid}=2N_{in}+1 \tag{9}\]  
where \(N_{hid}\) is the number of nodes in the hidden layer and \(N_{in}\) is the number of nodes in the input layer. The number of nodes in the hidden layer, proposed by [PERSON] et al. [25], meets:  
\[N_{hid}\leq N_{train}/\mathrm{R}\times(N_{in}+N_{out}) \tag{10}\]  
where \(N_{train}\) is number of training samples and \(N_{out}\) is number of nodes in the output layer, \(5\leq\mathrm{R}\leq 10\).