A Temporal Pool Learning Algorithm Based on Location Awareness

Hierarchical Temporal Memory is a new type of artificial neural network model, which imitates the structure and information processing flow of the human brain. Hierarchical Temporal Memory has strong adaptability and fast learning ability and becomes a hot spot in current research. Hierarchical Temporal Memory obtains and saves the temporal characteristics of input sequences by the temporal pool learning algorithm. However, the current algorithm has some problems such as low learning efficiency and poor learning effect when learning time series data. In this paper, a temporal pool learning algorithm based on location awareness is proposed. +e cell selection rules based on location awareness and the dendritic updating rules based on adjacent inputs are designed to improve the learning efficiency and effect of the algorithm. +rough the algorithm prototype, three different datasets are used to test and analyze the algorithm performance. +e experimental results verify that the algorithm can quickly obtain the complete characteristics of the input sequence. No matter whether there are similar segments in the sequence, the proposed algorithm has higher prediction recall and precision than the existing algorithms.


Introduction
Hierarchical Temporal Memory (HTM) is a new neural network model that simulates the organization and structure of cortical cells and the way the human brain processes information. HTM uses a large amount of sequence data for training [1]. By extracting and storing the patterns, HTM can predict the subsequent occurrence of the current input or detect whether the current input is abnormal. erefore, HTM is widely applied in the analysis and processing of time series data. e basic unit of HTM is the cell. A number of cells constitute the minicolumn, and a large number of minicolumns form the network space of HTM. Spatial pool learning algorithm (SPL) and temporal pool learning algorithm (TPL) are two important learning steps of HTM. SPL establishes the mapping relationship between the input and the minicolumn set to form the sparse distributed representation (SDR) of inputs. TPL constructs or adjusts the corresponding dendrite branches among the cells to form a temporal correlation of inputs [2].
In the process of human learning, the human brain remembers many things. When given clues, the human brain can retrieve relevant knowledge with high efficiency. HTM works by imitating the way the human brain processes information. Using the memorized patterns, HTM can also efficiently obtain the complete pattern information by the clues. With SPL, the input can be quickly located and represented in HTM. TPL uses different combinations of active cells to express the context of input and constructs the temporal relationship between inputs in different environments. When an input enters HTM, HTM can quickly retrieve all follow-ups by activating all cells on the active minicolumn. With the continuous confirmation of the following inputs, HTM can identify and confirm the patterns containing sequential inputs. e retrieval efficiency of this method is much higher than that of the traditional comparison algorithm. Based on this, the trained HTM can be regarded as a warehouse of rules, which can detect whether the test sequence is abnormal. In this model, if the learning sequences are the rules, it is worth discussing how to get all features of the rules quickly and ensure that the trained HTM has high prediction recall and precision.
First, TPL uses Hebbian rules to adjust the dendritic branches of cells to establish the temporal association between adjacent inputs. When the number of connected synapses in the dendrite branch of the cell accumulates to a certain threshold, TPL completes the extraction and memory of sequence features. TPL needs multiple iterations to memorize the sequence features, which affects the learning efficiency of TPL. Secondly, TPL gives priority to enhance the sequence features that have been learned rather than the current position sequence features, which affects the learning effect of TPL. In particular, when there are many continuous same inputs in the sequence, TPL is easy to fall into the same input cycle training and unable to obtain all features of the pattern, which affects the learning effect of TPL. erefore, it is necessary to design a new algorithm to improve the learning efficiency and effect of TPL.
In this paper, a temporal pool learning algorithm based on location awareness (TPL_LA) is proposed. e generation rules of learning cells and active cells based on location awareness and the adjustment rules of dendrite branches associated with adjacent inputs are designed. ree datasets are used to test the performance of TPL_LA and TPL. e main innovations of this paper are as follows.
(1) Using the multiple cells contained in the minicolumn, the generated learning cells and active cells can accurately express the position information of the input. In this way, the algorithm can give priority to learning the current sequence features, reduce the possibility of self-cycle prediction when learning continuous same inputs, and improve the learning effect of TPL. (2) According to the generated learning cell set and active cell set, the algorithm adjusts the updating rules of dendritic branches associated with adjacent inputs, and a new setting strategy of synaptic value is designed to improve the learning efficiency of TPL. (3) According to the generated learning cell set, the algorithm reduces the scope of active cells to predict the follow-up more accurately, which reduces the impact of historical memory on learning (4) In the open-source framework of HTM, the prototype of TPL_LA is implemented, and different types of data sets are used to test and analyze it. e results verify that TPL_LA could effectively improve the learning efficiency and effect compared with TPL. e remainder of this paper is structured as follows: the related works for HTM are discussed in Section 2. en, in Section 3, the efficient temporal pool learning algorithm based on location awareness is discussed. Finally, the experiments and analysis are carried out in Section 4. And the last section concludes our study.

Related Works
HTM is a new artificial neural network model based on Jeff Hawkins' memory prediction framework [3], and its main workflow is shown in Figure 1. e basic network space of HTM can be described as a region composed of multiple minicolumns. Regions and regions can have hierarchical relationships. ere are many cells on a minicolumn. e cells on each minicolumn share a proximal dendrite to receive input stimuli. Every cell may have many branches of distal dendrites, which can build relationships with other cells [1]. e encoder converts the input into a binary vector of equal length, and the number of components with 1 in the vector is equal. e vector can activate a small number of minicolumns to express the input content through SPL. TPL selects some cells on these activated minicolumns to express the input location information and establishes dendrite branches on these cells to construct the correlation between inputs. e sequence can be learned through the SPL and TPL to form memory in the network space of HTM. When the input sequence is consistent with the memorized pattern, the HTM can predict the next content based on the memory [4]. Two core algorithms, SPL and TPL, are used to construct the space-invariant and time-invariant features of input sequences, which are the key technologies for HTM to distinguish similar patterns.
For SPL, Ahmad and Hawkins give the characteristic description of sparse matrix and the expression form of information in the spatial pool [5], which provides theoretical guidance for the following research. Lattner Stefan uses the vector to study the spatial pool and proposes a formula for calculating the overlapping values and the corresponding learning rules [6]. Byrne describes the structure of HTM formally by using matrixes [7], which provides a mathematical basis for the derivation of rules. Leake et al. study and discuss the influence of initialization parameters on SPL [8]. Mnatzaganian et al. give a comprehensive mathematical framework of the spatial pool [9] so that the follow-up scholars can understand the core characteristics of SPL and improve the algorithm from a mathematical point of view. Li et al. propose an improved algorithm for spatial pool learning, which can make the training process of the spatial pool more efficient and stable [10]. In recent years, increasing scholars have begun to study the hardware implementation of the spatial pool to give full play to the advantages of HTM architecture [11]. Deliang Fan et al. propose that the computing blocks for HTM can be mapped using low-voltage, magneto-metallic spin-neurons combined with an emerging resistive crossbar network [12]. Krestinskaya et al. develop circuits and systems to achieve the optimized design of an HTM SP, an HTM TM, and a memristive analog pattern matcher for pattern recognition applications [13]. SPL abstracts the input features through a hierarchical structure [14], which makes HTM have wideranging applications in recognition and classification, such as data classification [15], face recognition [16], speech recognition [17], biometric recognition [18], detection of multiple objects located in clutter color images [19], handwriting recognition [20], action recognition [21], gait recognition and understanding [22], and natural language processing [23].
For TPL, Hawkins and Ahmad give the formal expression of learning rules by matrixes [2], which gives a mathematical description of the rules related to active cells, learning cells, predicting cells, and synaptic renewal. is provides a theoretical basis for the subsequent study of the temporal pool learning algorithm. Younes Bouhadjar et al. reformulate the model in terms of a network of spiking neurons with continuous-time dynamics [24], in which they discuss how neuronal parameters such as cell-intrinsic time constants and synaptic weights constrain the sequenceprocessing speed. El-Ganainy et al. propose an improved Hierarchical Temporal Memory that can consider long-term dependence [25]. Suzugamine et al. propose a self-structured cortical learning algorithm that dynamically adjusts the numbers of columns and cells according to the input data [26]. In this model, the backtracking algorithm proposed by the author makes the prediction of the temporal pool more stable. In recent years, some scholars start to implement TPL on hardware [27]. Many scholars combine SPL with TPL and apply HTM to many fields with time series data, such as anomaly detection of time series data [28], heart attack detection [29], medical data flow prediction [25], hydrological intelligent monitoring [30], abnormal ECG detection [31], and abnormal detection in crowd management [32]. However, when the sequence data is learned as rules, TPL in the above research still has some limitations. For example, it needs multiple iterations to memorize the sequence features, it gives priority to enhancing the memory of a historical pattern when learning a sequence, and it is easy to fall into the same input cycle training when learning the sequence with many continuous same inputs. When TPL obtains all features of sequences, these limitations will lead to low learning efficiency and poor learning effect.

The Temporal Pool Learning Algorithm Based on Location Awareness
In TPL_LA, the learning process of TPL is reconstructed. e active cell and learning cell selection rules based on location awareness are proposed to make TPL_LA more focused on the current sequence features, which improves the learning effect of the algorithm. e dendrite updating rules associated with adjacent inputs are proposed to improve the learning efficiency of TPL_LA. e algorithm reduces the scope of active cells to predict the follow-up more accurately, which reduces the impact of historical memory on learning. e learning process of TPL_LA is shown in Figure 2.
ij is a binary matrix of M × N constructed by the following equation: contains the cells whose dendrite branches need to be added or modified in the training process at time t. When _ cell t ij � 1, it means that the cell participates in the learning process of the current input. (8) I P: initial synaptic permanence. I P is a scalar with a value range of [0.0, 1.0], indicating the permanence of the first connection between two cells.

Analysis of the Temporal Pool Learning Algorithm.
Each input in the sequence continuously activates the microcolumns to express itself through SPL. TPL activates cells in these minicolumns to express the context of current input and uses active cells to predict the follow-up content.
TPL selects a small number of cells from active cells as learning cells to reduce the number of dendritic branches on cells. By adjusting the permanence of dendritic branches owned by these learning cells, TPL constructs the association between the input before and after and learns the sequence features. Active cell generation rule, learning cell generation rule, and dendritic branch synaptic adjustment method are important factors affecting the performance of TPL. Next, from the two aspects of learning efficiency and learning effect, this paper analyzes the implementation details existing in TPL, such as the selection rules of learning cells and active cells and the updating rules of dendritic branches.

Learning Efficiency.
In HTM, cells maintain a large number of dendritic branches, which record the relationship between cells. With these dendrite branches, HTM can save the sequence relationship between inputs so that the TPL can predict the future according to the current input. When a cell creates a new dendritic branch, its synapses are usually not connected. After TPL learns the input many times, the Hebbian rule makes the permanence of the dendrite branch increase or decrease. e cell can become the prediction cell of the associated active cell, and TPL completes the memory of the sequence only when the connected synapses in the dendrite branch reach the threshold. erefore, the sequence needs to be learned repeatedly before being memorized by HTM. Secondly, in the minicolumn activated at time t, TPL uses the following equation to generate active cells: If there are no predictive cells on an activated minicolumn at time t, TPL selects all cells on the minicolumn as active cells. TPL selects one of the cells as the learning cell to avoid creating too many dendritic branches in the learning process. TPL uses the following equation to select the learning cell on this minicolumn, which is called the best matching cell. 1 ‖ 1 ) determines whether cell i,j contains a dendritic branch that overlaps with the last active cells the most among all cells on j minicolumn. e minreshold is the minimum threshold of overlap values of dendrite branches, which is used to avoid some invalid dendritic branches from participating in the calculation.
TPL selects a dendrite branch on the learning cell and enhances its synaptic value to strengthen its association with active cells at time t−1. e selected dendrite branch _ D k ij should satisfy the following formula: In this case, with the unpredicted activated minicolumn, the adjusted dendrite branches have the following two situations: (1) e dendrite branch constructs the association between _ cell t and _ Cell t− 1 . TPL adjusts the synaptic permanence to enhance the association between the current input and the previous input.
(2) e dendrite branch does not construct the association between _ cell t and _ Cell t− 1 . TPL adjusts the synaptic permanence to enhance the characteristics of a historical subsequence. e use of equation (4) increases the probability of Case 2, which makes TPL give priority to learning the features of repeated subsequences. When TPL cannot find the learning cell with equation (4), TPL will randomly select one with the least utilization rate as the learning cell on the unpredicted activated minicolumn. TPL constructs a new dendrite branch on the cell and establishes the association with the learning cells at time t−1. In this way, TPL can learn and memorize the current new sequence feature and add it to the last learning content. erefore, TPL needs to learn a sequence repeatedly before it can memorize and store all characteristics, even if TPL directly sets the initial synapse permanence of the newly created dendritic branch to the connected state.

Learning
Effect. TPL gives priority to learning the features of repeated subsequences rather than those of the current input sequence. erefore, after a round of training of the input sequence, TPL can only memorize and store the repeated segments. ese memories are fragmentary. Compared with the complete sequence, there are many breakpoints in memory. Although more iterative training can repair these memory breakpoints, it also needs more time. By repairing memory breakpoints, fragment memories can string into a longer memory, which can be called the memory axis. However, some sequence fragments will be memorized again in the new context and form memory branches on the memory axis. e following experimental results can verify this conclusion.
Besides, there may be continuous same inputs in the sequence. Although the contents of these inputs are the same, their meanings are different due to their different positions. TPL selects different learning cells from the activated minicolumns to represent the different contexts of input. e cells associated with learning cells also come from these minicolumns. When TPL learns the continuous same inputs, it is easy to make the input cycle predict itself. In this case, TPL will no longer learn the same new input, which will affect the training effect.
As shown in Figure 3, HTM has learned b for P times, and each b has different learning cells due to its different positions. When TPL learns the subsequent b, the active cells of the input may be a subset of the predicted cells, i.e., A t � A t°Πt . is leads to the fact that the modified dendrite branches only strengthen the memory of history, and TPL no longer learns new repetitive content. erefore, TPL cannot effectively learn repeated inputs, and HTM may only form one or more memory segments of the sequence.
When TPL learns a sequence, the memory generated by HTM usually has memory breakpoints and memory branches, which will affect the prediction effect. Memory breakpoints indicate that TPL cannot form a complete memory of a sequence, and they will reduce the recall of predictions. Memory branches will reduce the precision of prediction.

Cell Selection Rules Based on Location Awareness.
In TPL_LA, the cell selection rules based on location awareness are designed. e rules reduce the range of active cells and no longer use the best matching cells. In this way, TPL_LA can distinguish the same input in different positions and give priority to learning the features of the current sequence.
When there are predictive cells on the activated minicolumns at time t, these cells contain active dendritic branches. Adjusting these dendrite branches will learn the sequence characteristics of the current position. TPL_LA uses the following equation to set the cell as a learning cell.
When there are not predictive cells on the activated minicolumns at time t, these cells do not contain active dendritic branches. TPL_LA uses the following equation to set the cell as a learning cell, where min used(cell i,j ) determines whether cell i,j is the least used cell on j minicolumn.
TPL_LA adds dendrite branches to the learning cell to construct the association with _ Cell t− 1 to learn the sequence characteristics of the current position.
Finally, based on the selected learning cells, TPL_LA uses the following equation to create active cells.
Different from the way TPL generates the learning cells and active cells, the algorithm no longer selects the best matching cells but randomly selects the cells with the least frequency as the learning cells with the unpredicted activated Scientific Programming minicolumns. erefore, TPL_LA can accurately express the context of the current input and learn the sequence features of the current position. Active cells usually express multiple contexts of input. e algorithm generates the active cells according to the learning cells, so it can accurately express the current context of the input. Such active cells reduce the prediction of historical content, which makes TPL learn the sequence characteristics of the current position and reduces the occurrence of memory breakpoints and memory branches. Besides, when TPL_LA learns the same continuous inputs, such active cells can also reduce the cycle prediction of the input and improve the learning effect of TPL_LA. e purpose of the proposed algorithm is to obtain the complete features of the rule. Every input owns different cell combinations to express the context through location awareness. To some extent, this increases the number of dendritic branches on the cell. is strategy will take up more storage space but improve the accuracy of prediction.

Dendrite Updating Rules Associated with Adjacent Inputs.
In TPL_LA, the updating rules of dendritic branches associated with adjacent inputs are designed, which makes TPL_LA quickly complete the learning of sequence features.
By adjusting the active dendrite branches of learning cells generated by equation (6), TPL_LA can learn the sequence features of the current position. TPL_LA uses the following equation to select the dendrite branches to be adjusted. e a_T is the activation threshold of dendritic branches.
Reinforcing the above segments is to decrease all permanence values by a small value p− and increase the permanence values corresponding to active presynaptic cells by a larger value p+ [2].
By adding the active dendrite branches to the learning cells generated by equation (7), TPL_LA can establish the association between the current learning cell and _ Cell t and learn the sequence features of the current position. e algorithm adds a new dendrite branch D new ij according to the following equation. I_P is usually greater than the connectivity threshold of synapses.
According to the above rules, either the selected active dendritic branches or the newly added dendritic branches construct the association between learning cells at the time before and after. All of these make learning aim at the current sequence and reduce the interference of historical memory on current learning. When the synapse permanence is greater than or equal to the connectivity threshold, the synapse is connected. erefore, using a bigger I_ P, TPL_LA can quickly construct the temporal association of the sequence, extract the features of the memory sequence, and improve the learning efficiency. TPL_LA modifies the rules of TPL. By sensing the position information of the input in the sequence, TPL_LA selects different learning cells to distinguish the same input. By reducing the range of active cells and no longer using the best matching cells as learning cells, TPL_LA only learns the sequence features at the current position. In this way, the memory of HTM rarely produces memory breakpoints and memory branches, and the algorithm can memorize all features of the sequence. erefore, the learning effect of TPL_LA is highly improved. By increasing the synaptic permanence in the new dendrite branch of the learning cell, TPL_LA can learn the features of the sequences faster. erefore, the algorithm not only guarantees the learning effect but also has high learning efficiency.

Experiments and Analysis
In the open-source framework of HTM, the prototype of TPL_LA is implemented. Different types of datasets are used to test and analyze it compared to TPL.

Datasets and Evaluation Indicators.
In this paper, three datasets are used to test and analyze TPL_LA and TPL. Fifty digits after the π decimal point are used to construct the first dataset representing a random sequence. A sequence such as "211111...... 11113" is used as the second dataset to represent a sequence with continuously repeated inputs, whose length is set to 50. e third dataset is the statistical data of New York taxi passengers. From July 1, 2014, to January 31, 2015, the number of passengers per 30 minutes of New York taxi is used to construct the input sequence, with a total of 10320 data.
ese three datasets are used to train the two algorithms, respectively, and the corresponding datasets are used for prediction tests. e test results are used to evaluate the learning effect of whether the two algorithms can obtain all features of the sequence. ree evaluation indicators, i.e., mean recall (MR), mean precision (MP), and F1, are used to evaluate the two algorithms. e recall t describes whether the input is within the prediction range at time t. e precision t describes the proportion of the input in the prediction range at time t. e evaluation indicators are calculated using the following equations: Abbbbbb…bbbbbbb……bbbbbbc Learned sequence P Figure 3: An example of repeated inputs in a sequence. 6 Scientific Programming L is the length of a sequence. When the values of MR and MP are both large, it shows that the algorithm has a high degree of restoration for the input sequence. e larger the value of F1, the better the learning effect of the algorithm.

e Testing with Random Inputs.
e sequence with random inputs is constructed using dataset 1. Figure 4 is a graphical representation of each input in dataset 1.
Dataset 1 has a small input range, so the prototype system uses Table 1 to set the relevant parameters.

e Comparison of Testing Results.
When learning a sequence, TPL_LA needs larger initial value synapses. erefore, I_P is set to the connectivity threshold of 0.8 and TPL_LA trains the sequence only once. TPL is tested in two cases. (1) TPL sets I_P to the connective threshold of 0.8 and trains the sequence once. (2) TPL sets I_P to the disconnected value of 0.7 and trains the sequence one and more times. Table 2 shows the testing results.
(1) Get W t of current input from spatial pool: (5) for i � 0 to M − 1 do (6) if π t−1 ij �� 1 then (7) set the current cell to cell t i,j (8) if (learn) then (9) reinforce the segment of the cell; (10) endif (11) else (12) select the less used cell to cell t i,j (13) if (learn) (14) create connected segment between cell t i,j and cell t− 1 (15) endif (16) endif (17) endfor (18) else (19) if π t−1 ij �� 1 then (20) if (learn) punish the segment of the cell endif   1  3  5  7  9  11  13  15  17  19  21  23  25  27  29  31  33  35  37  39  41  43  45  47  49   Input sequence  10  9  8  7  6  5  4  3  2 1 0 Scientific Programming rough F1, it can be seen that TPL_LA is better than TPL. From the perspective of MR or MP, the results of the TPL_LA training sequence once are better than those of TPL in various situations. TPL_LA gives a distinct context to the input in different positions, so the recall and precision of the prediction are both the highest. In the learning process of TPL with connected I_P, repeated content is easy to form memory breakpoints. In addition, without repeated iterative learning, these breakpoints are difficult to repair, so the recall and precision of the prediction cannot reach the high point, which reduces the value of F1. In the learning process of TPL with unconnected I_P, nonrepetitive content is easy to form memory breakpoints. Repeated iterative learning can repair these memory breakpoints and produce some memory branches. erefore, the learning result makes the recall of prediction very high but reduces the precision of prediction, which slightly reduces the value of F1. Although the TPL can also achieve a high approval of recall or precision through iterative learning, it needs more learning time. erefore, TPL_LA has better learning efficiency and learning effect when learning a random sequence.

e Prediction State of Every
Step. To better analyze the results in Table 2, the prediction states of each step when the two algorithms process dataset 1 are listed in Figure 5.
As can be seen from Figure 5(a), when TPL sets I_P disconnected and learns the sequence once, HTM only remembers the repeat patterns. Some patterns do not repeat in the dataset, which lets the synaptic value between the inputs of these patterns not reach the connectivity state, so HTM does not memorize these patterns. Compared with the complete sequence, there are many breakpoints in memory, so the recall and precision of prediction are very low. It can be seen from Figure 5(b) that when TPL sets I_P disconnected and learns the sequence 100 times, the memory in HTM can restore the complete sequence. rough iterative learning, TPL strengthens the disconnected synapses between inputs to the connected state, so these nonrepetitive patterns are also memorized. At the same time, the repeated patterns in different positions are given different contexts, so some memory branches are formed in HTM. erefore, the recall of prediction is very high, and the precision of prediction is not high. It can be seen from Figure 5(c) that when TPL sets I_P connected and learns the sequence once, HTM memorizes long sequence fragments. However, memory breakpoints are formed at the position of each repetitive subsequence. e memory breakpoint will make the subsequent input have no context, which causes multiple following predictions. As a result, the recall and precision of prediction are not very high. It can be seen from Figure 5(d) that when TPL_LA learns the sequence once, the memory in HTM can restore the complete sequence. e algorithm gives a distinct context to the input in different positions, so the memory in HTM has few memory breakpoints and memory branches. erefore, the recall and precision of the prediction are both the highest.

e Testing with Repeated Inputs.
e sequence with continuously repeated inputs is constructed using dataset 2.
ere are only three input types in the sequence, so the algorithms still use the parameters in Table 1.

e Comparison of Testing Results.
For the sequence with continuously repeated inputs, the test is still carried out with the plan designed in Section 4.2.1. Table 3 shows the testing results.
rough F1, it can be seen that TPL_LA is better than TPL. From the perspective of MR or MP, the results of the TPL_LA training sequence once are better than those of TPL in various situations. TPL_LA also gives a distinct context to the input in different positions, so the recall and precision of the prediction are both the highest. In the learning process of TPL with connected I_P, continuous repeated content can be seen as the repeated iterative learning, which can repair the memory breakpoints. However, the continuous repeated content makes the active cell set the same as the predicted cell set, which prevents the algorithm from memorizing longer sequences. erefore, the recall and precision of the prediction cannot reach a high point, which reduces the value of F1. In the learning process of TPL with unconnected I_P, repeated iterative learning can repair more memory breakpoints. However, because the active cell set is the same as the predicted cell set, the algorithm cannot memorize longer sequences. erefore, the learning result makes the recall and precision of the prediction cannot reach the high point, which reduces the value of F1. erefore, TPL_LA has better learning efficiency and learning effect when learning a sequence with continuously repeated inputs.

e Prediction State of Every
Step. To better analyze the results in Table 3, the prediction states of each step when the two algorithms process dataset 2 are shown in Figure 5.
As can be seen from Figure 6(a), when TPL sets I_P disconnected and learns the sequence once, HTM only remembers a segment of the sequence. e existing algorithms will give priority to strengthening the repeated patterns. When the previous patterns are memorized, the algorithm will extend the memory content and increase the length of the memory axis. Since HTM only learns part of the sequence, the recall and precision of prediction are not high. As can be seen from Figure 6(b), when TPL sets I_P disconnected and learns the sequence 100 times, the memory in HTM still cannot restore the complete sequence. rough iterative learning, when the memorized sequence reaches a certain length, the active cells and prediction cells will be the same, which leads to the algorithm not learning new repeated content. At the same time, the repeated pattern, especially the "13," owns different contexts, so some memory branches are formed in HTM. erefore, the recall of prediction is not improved much, and the precision of prediction is decreased. As can be seen from Figure 6(c), when TPL sets I_P connected and learns the sequence once, HTM still only remembers a segment of the sequence. e reason is also that when the repeat sequence is memorized to a certain length, the active cells and the prediction cells will be the same, resulting in the fact that the algorithm could not learn new content. e algorithm learns the sequence "13" only once, so the pattern has only one context. Compared with the results of Figure 6(c), the recall and the precision of the prediction are not much different. As can be seen from Figure 6(d), when TPL_LA learns the sequence once, the memory in HTM can restore the complete sequence. e algorithm gives different contexts to the input in distinct positions, so the memory in HTM has few memory breakpoints and memory branches. erefore, the recall and precision of the prediction are both the highest.

e Testing of the Taxi Passenger Flow of New York.
e real data sequence is constructed by dataset 3. Because the dataset is much larger than the first two datasets, TPL_LA and TPL use Table 4 to set the parameters.
In this testing, TPL_LA set I_P to 0.8. TPL is tested in two cases. (1) TPL sets the I_P to 0.8. (2) TPL sets I_P to 0.7. Each algorithm only learns the data set once under the corresponding configuration. e dataset has 10320 data and 8090 different numbers. is dataset may be seen as the first level dataset, which  includes less repeated subsequence. Table 5 shows the testing results on the first level dataset.
To further study the performance of the algorithm, each data in the original dataset is divided by 10. In this way, the number of repeats in the sequence can be increased by increasing the unit of measurement of the data. is dataset may be seen as the second level dataset, which has 10320 data and 2470 different numbers. Table 6 shows the testing results on the second level dataset.
Go further, each data in the original dataset is divided by 100. is dataset may be seen as the third level dataset, which has 10320 data and 287 different numbers. e data set contains more repetitive subsequences. Table 7 shows the testing results on the third level dataset.
From the indicators in Tables 5-7, it can be seen that TPL_LA always has the highest MR and MP. TPL_LA gives different contexts to the input in different positions and can enable HTM to remember all features of the sequence by learning them once. e memory in HTM can completely restore the content of the sequence, no matter how many repetitive patterns are included in the sequence. TPL_LA has good learning efficiency and learning effect. If only learning the sequence once, TPL with connected I_P can get a good learning effect on the sequence without repeated content, but the learning effect will decline when there are repeated contents in the sequence. In this setting, repeated content is easy to form memory breakpoints. On the other hand, if only learning the sequence once, TPL with disconnected I_P can hardly remember the characteristics of the sequence without repeated contents. In this setting, the synapses between data cannot reach the connected state, and the temporal relationship between data cannot be formed in HTM. Only  when there are repeated contents in the sequence or HTM learns the sequence more times can the algorithm extract and memorize the features of the sequence.

Conclusions
rough the analysis of TPL, the authors explain the reasons for the low learning efficiency and poor learning effect of TPL and propose an efficient temporal pool learning algorithm based on location awareness. After one training of TPL_LA, the sequence can be effectively memorized by HTM, which shows that the algorithm has good learning efficiency and learning effect.
In the following research, the authors intend to add more input feature information to the TPL_LA and modify the learning mechanism of the proposed algorithm, which could enhance the smoothness of the memory, make the predictive generalization higher, and improve the utilization rate of the network space of the HTM. In this way, the proposed algorithm can be better used in the intelligent network in the future.

Data Availability
e artificial data used to support the findings of this study are included within the article. e time-period statistics of New York taxi passengers can be found at https://www1.nyc. gov/site/tlc/about/tlc-trip-record-data.page.

Conflicts of Interest
e authors declare that they have no conflicts of interest.