<commit_before># MazeRunner
Neuroscience modeling of spatial memory using a 3d mouse maze simulation.

Note: this project is currently in an early development stage.

## 3d Maze

A maze has been built in Unreal Engine 4 (UE4).  UE4 offers many advantages in simulation capabilities as well as being able to be controlled directly through C++ source code.

Currently included:
* Wall collision detection 
* Ability to include different mazes. Could be expanded into the morris water maze, etc.
* Movement controls are working successfully
* Maze has been tested and gone through to the exit successfully

## Neural Computation

Grid and place cells, and oscillatory rhythms will be modeled. That area of modeling is an evolving area of science. Based on my latest readings I plan to include continuous attractor network (CAN) models and ramping membrane potential dynamics \[1\]\[2\]. For example, potentially work based off of models by Solanka, et al. or Si, et al. \[3\]\[4\]. A known issue with CAN models are the often lack of inclusion of mechanisms for phase procession relative to theta rhythms. A possible method to address that is to have a hybrid model with oscillatory interference \[5\]\[6\]. Oscillatory interference has had some challenges presented to it by studies on bats, mice, and others; using it or a different approach will need to be evaluated \[7\]\[8\]. The simulation can potentially include multiple models and compare and contrast them. It is a work in progress to determine which of the latest models will be initially included.

Similar methods to those of an existing Sheynikhovich, et al., 3d maze simulation will be included \[9\]. Recreation of observed mouse neural activity will be used in the maze tasks as a ground truth for training and testing models. A source of in vivo recorded activity will be the open access data from Dr. <NAME>'s lab that was obtained in spatial memory task experiments \[10\]. Another source of data can be from the Kavli Institute of Systems Neuroscience \[11\]. Theories of neural mechanisms can be explored through modifying neural properties. Eventual work can include addressing open questions existing in the current state of spatial memory models.

Presently functional:
* Saved images from the maze are processed by a Gabor filter using OpenCV. That will be visual stimulus input into neural networks of spatial memory cells to learn the maze.
* Differential equations solver is working with odeint, that can generate synapse signalling differential equations if needed. Plotting is operational with matplotlibcpp.
* Grid cell populations are generated as multidimentional struct arrays which contain pertinant variables (i.e., membrane voltage and neuron location).
Presently 6 populations of 5x5 neuron grid formations are included.
* Synaptic current for each neuron has been implemented through corresponding formulas. All-to-all connections within grid cell populations have been tested over several time 
steps and found to be computing successfully. Some simplifications were made (i.e., refractory period and dirac delta) but more complex methods can be
included in the implementation in the future.
* Efficient memory management is included through pointers avoiding hard copying values. E.g., voltages and synaptic currents.

## Methods to Work with the Code
./3d_simulated_maze/

Import the 3d maze folder into UE4 and it will compile the project for you.

./neural_engine/

The project is in C++ and created with Eclipse C++ edition. Import it with that IDE or one of your choice.
Dependencies needed for compiling: Boost, Odeint, OpenCV, Matplotlibcpp. Also plplot and python2.7 but those are planning to be removed.

## Video Samples:

<center>
<a href="https://gfycat.com/ThornyAcceptableIndianglassfish" target="_blank"><img src="http://i.imgur.com/nultxhH.png" alt="gameplay video image" width="360" height="240" border="10"></a>
<a href="https://gfycat.com/SnarlingIllinformedGibbon" target="_blank"><img src="http://i.imgur.com/ssjSamF.png" alt="gameplay video image" width="360" height="240" border="10"></a>
<a href="https://gfycat.com/InfantileVapidIvorygull" target="_blank"><img src="http://i.imgur.com/uNXdr0H.png" alt="gameplay video image" width="360" height="240" border="10"></a><commit_msg>fully connected synapses further tested.<commit_after># MazeRunner
Neuroscience modeling of spatial memory using a 3d mouse maze simulation.

Note: this project is currently in an early development stage.

## 3d Maze

A maze has been built in Unreal Engine 4 (UE4).  UE4 offers many advantages in simulation capabilities as well as being able to be controlled directly through C++ source code.

Currently included:
* Wall collision detection 
* Ability to include different mazes. Could be expanded into the morris water maze, etc.
* Movement controls are working successfully
* Maze has been tested and gone through to the exit successfully

## Neural Computation

Grid and place cells, and oscillatory rhythms will be modeled. That area of modeling is an evolving area of science. Based on my latest readings I plan to include continuous attractor network (CAN) models and ramping membrane potential dynamics \[1\]\[2\]. For example, potentially work based off of models by Solanka, et al. or Si, et al. \[3\]\[4\]. A known issue with CAN models are the often lack of inclusion of mechanisms for phase procession relative to theta rhythms. A possible method to address that is to have a hybrid model with oscillatory interference \[5\]\[6\]. Oscillatory interference has had some challenges presented to it by studies on bats, mice, and others; using it or a different approach will need to be evaluated \[7\]\[8\]. The simulation can potentially include multiple models and compare and contrast them. It is a work in progress to determine which of the latest models will be initially included.

Similar methods to those of an existing Sheynikhovich, et al., 3d maze simulation will be included \[9\]. Recreation of observed mouse neural activity will be used in the maze tasks as a ground truth for training and testing models. A source of in vivo recorded activity will be the open access data from Dr. <NAME>'s lab that was obtained in spatial memory task experiments \[10\]. Another source of data can be from the Kavli Institute of Systems Neuroscience \[11\]. Theories of neural mechanisms can be explored through modifying neural properties. Eventual work can include addressing open questions existing in the current state of spatial memory models.

Presently functional:
* Saved images from the maze are processed by a Gabor filter using OpenCV. That will be visual stimulus input into neural networks of spatial memory cells to learn the maze.
* Differential equations solver is working with odeint, that can generate synapse signalling differential equations if needed. Plotting is operational with matplotlibcpp. Exponential integrate-and-fire neuron current with refractory period has been tested.
* Grid cell populations are generated as multidimentional struct arrays which contain pertinant variables (i.e., membrane voltage and neuron location).
Presently 6 populations of 5x5 neuron grid formations are included.
* Synaptic current for each neuron has been implemented through corresponding formulas. All-to-all connections within grid cell populations have been tested over several time 
steps and found to be computing successfully. Some simplifications were made (i.e., refractory period and dirac delta) but more complex methods can be
included in the implementation in the future.
* Efficient memory management is included through pointers avoiding hard copying values. E.g., voltages and synaptic currents.

## Methods to Work with the Code
./3d_simulated_maze/

Import the 3d maze folder into UE4 and it will compile the project for you.

./neural_engine/

The project is in C++ and created with Eclipse C++ edition. Import it with that IDE or one of your choice.
Dependencies needed for compiling: Boost, Odeint, OpenCV, Matplotlibcpp. Also plplot and python2.7 but those are planning to be removed.

## Video Samples:

<center>
<a href="https://gfycat.com/ThornyAcceptableIndianglassfish" target="_blank"><img src="http://i.imgur.com/nultxhH.png" alt="gameplay video image" width="360" height="240" border="10"></a>
<a href="https://gfycat.com/SnarlingIllinformedGibbon" target="_blank"><img src="http://i.imgur.com/ssjSamF.png" alt="gameplay video image" width="360" height="240" border="10"></a>
<a href="https://gfycat.com/InfantileVapidIvorygull" target="_blank"><img src="http://i.imgur.com/uNXdr0H.png" alt="gameplay video image" width="360" height="240" border="10"></a>
{'fraction_non_alphanumeric': 0.06529486147833084, 'fraction_numerical': 0.011955397172088746, 'mean_word_length': 4.835010060362173, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1579079', 'n_tokens_mistral': 2259, 'n_tokens_neox': 2051, 'n_words': 1205}