## 3 Proposed Mechanism
### Grid Code Learning and ItsRecalling  
Here we hypothesized two states for a place neuron. One is the hyperpolarized state, in which a place neuron is always ready to learn the input grid neuron's activation values. A place neuron comes in the hyperpolarized state only when the sensory input to the neuron matches with its sensory template, as shown in Figure 10 Another is the pseudo-polarized state in which the place neuron recalls their sensory template and matches it with the input sensory values. The pseudo-polarized state comes to the place neuron only when the input grid code matches the learned grid code of the place neuron. The pseudo-polarized state of a place neuron states the location of an agent in an environment. Since similar grid activations can occur in many places in the environment, it is highly prone to error. Sometimes the grid neuron's activation is not enough to tell the location, and this thing is shown in Figure 4 with example. Therefore, a place neuron needs to learn grid activations along with interference patterns of grid rings of different grid neurons. The interference pattern is a set of distances between the reference points of each grid neuron. The interference pattern is always unique in an environment, which is why it locates any area correctly in an environment, and the grid code states the exact location within the inferred area. The interference of grid rings is shown below in Figure 11. In the figure, the blue-colored dots are representing the current reference points of their respective grid neurons. The orange-colored dot is representing the center of the firing field (grid ring) of a place neuron. The place neuron is present in the interference region of the grid rings. The yellow-colored dot represents the agent's current location with regard to the interfered region of rings. The learning is necessary along with the grid point distances quadrant and the quadrant angles of every grid. Therefore, along with the reference points concerning learned place location, their orientation axis can also be recalled correctly, and that would help in further navigation after localization. A place neuron can only be pseudo active when the agent enters the vicinity of a place neuron. The level of activation depends on the distance of the agent from the location of the neuron. Each place neuron calculates (for pseudo-activation) the match between their learned interference pattern with the agent's current interference pattern as per Equation (6). The place neuron having the highest match will be the winner, and this winner place neuron recalls the distances of reference points and their activation values. The recalled values allow us to find their location with respect to all reference points of all grid neurons and then map the agent in the interference pattern to obtain their distance from the agent. Afterward, the place neuron will become pseudo active as per the Equation (7). \[ \begin{array}{c}winner=Max\left(m^{k}\right)\\ m^{k}=\sum\limits_{\forall\ i,j\ \in\ Grid\ Neuron}\frac{d_{i,j}}{n^{2}-n(1+2p)} \\ d_{i,j}=\left\{\begin{array}{c}0,\ \left|LD_{i,j}\
eq CD_{i,j}\\ (1-\left|Lact_{i}-Cact_{i}\right|)+\left(1-\left|Lact_{j}-Cact_{i}\right| \right),\ \left|Otherwise\right.\end{array}\right.\end{array}  \tag{6}\]  
Figure 11: Grid code learning. Figure 10: Cognitive mapping of sensory information. where, \(LD\) (\(i\),\(j\)) is the learned distance between the \(i\)th and \(j\)th grid neuron's reference points. The CD is the current distance between the \(i\)th and the \(j\)th grid neuron's reference point. \(\textit{Lact}_{i}\) is the activation of an \(i\)th grid neuron while learning the place. '\(p\)' is the number of grid neurons having activation is zero while learning. \(m^{k}\) is the match score of a \(k\)th place neuron \(d_{i,j}\) is the distance between the current and the learned interference pattern correspond to \(i\)th and \(j\)th grid neuron.