{"id":1010,"date":"2018-01-17T12:26:34","date_gmt":"2018-01-17T02:26:34","guid":{"rendered":"https:\/\/www.cognav.net\/?p=1010"},"modified":"2018-01-17T15:14:25","modified_gmt":"2018-01-17T05:14:25","slug":"how-to-implement-internal-dynamics-of-the-head-direction-network-in-brain-inspired-1d-slam","status":"publish","type":"post","link":"https:\/\/braininspirednavigation.com\/?p=1010","title":{"rendered":"How to implement internal dynamics of the head direction network in brain inspired 1D SLAM?"},"content":{"rendered":"<p>The excerpt note is from the Michael&#8217;s book. The example code is implemented by Fangwen, which can help us to understand the process and principle of the method.<\/p>\n<p><span style=\"color: #404040; font-family: Arial; background-color: white;\">Michael Milford.\u00a0<a href=\"http:\/\/www.springer.com\/gp\/book\/9783540775195\"><span style=\"color: #4a88c2;\"><strong>Robot Navigation from Nature: Simultaneous Localisation, Mapping, and Path Planning Based on Hippocampal Models<\/strong><\/span><\/a>. Springer-Verlag Berlin Heidelberg Press, pp. 68-69, 2008.<\/span><\/p>\n<p style=\"text-align: justify;\">To achieve <strong>stable activity profiles<\/strong> in the <strong>head direction network<\/strong>, a system of <strong>localised excitation<\/strong> and <strong>global inhibition<\/strong> is used. The internal dynamics of the head direction cells are shown in Fig. 7.8.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem1.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: justify;\">Fig. 7.8. Head direction cells excite themselves and other cells. The total activity sum is used to inhibit all cells equally.<\/p>\n<p style=\"text-align: justify;\"><strong><em>Localised Excitation <\/em><\/strong><\/p>\n<p style=\"text-align: justify;\">Each cell is connected to all the cells in the network including itself via excitatory links. The self-connected weight is the largest, with weight values dropping off in a <strong>discrete Gaussian manner<\/strong> for connections to more distant cells. The <strong>matrix <\/strong>storing the <strong>excitatory weight values<\/strong> between all cells,<img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem2.png\" alt=\"\" \/> , is given by:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem3.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem4.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: justify;\">where<img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem5.png\" alt=\"\" \/> is <strong>the variance of the Gaussian distribution<\/strong> used to form the weights profile.<\/p>\n<p style=\"text-align: justify;\">During an experiment, activity in each of the head direction cells is projected through the appropriate <strong>excitatory links<\/strong> back into the head direction cells. The updated cell activity level after excitation, <img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem6.png\" alt=\"\" \/> , is given by:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem7.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: justify;\">where <img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem8.png\" alt=\"\" \/> is the excitatory cell and <img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem9.png\" alt=\"\" \/> is the excitatory link value from cell <img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem10.png\" alt=\"\" \/> to cell <img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem11.png\" alt=\"\" \/>.<\/p>\n<p style=\"text-align: justify;\"><strong><em>Global Inhibition <\/em><\/strong><\/p>\n<p style=\"text-align: justify;\">Global inhibition based on <strong>the total activity<\/strong> in the network is performed to ensure that without input from allothetic stimuli, smaller activity packets will gradually &#8216;die out&#8217;. The updated activity level of a cell after inhibition, <img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem12.png\" alt=\"\" \/>, is given by:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem13.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem14.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: justify;\"><strong><em>Global Normalisation <\/em><\/strong><\/p>\n<p style=\"text-align: justify;\">To ensure that the total activity sum in the head direction network stays constant, a global normalisation step is performed after the allothetic association, allothetic calibration, and ideothetic update steps. The cell activity levels after normalisation, <img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem15.png\" alt=\"\" \/>,are given by:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"https:\/\/www.braininspirednavigation.com\/wp-content\/uploads\/2018\/01\/011718_0225_Howtoimplem16.png\" alt=\"\" \/><\/p>\n<pre lang=\"\u201dmatlab\u201d\" line=\"\u201d1\u2033\">clear all;\r\n\r\nglobal HDCELLS;                                % The hdcells network\r\nHDCELLS = zeros(1,36);\r\n\r\n% HDCELLS(15)=1;\r\nHDCELLS(11)=0.05;\r\nHDCELLS(12)=0.20;\r\nHDCELLS(13)=0.25;\r\nHDCELLS(14)=0.80;\r\nHDCELLS(15)=0.28;\r\nHDCELLS(16)=0.22;\r\nHDCELLS(17)=0.16;\r\nHDCELLS(18)=0.08;\r\n\r\nglobal HD_DIMENSION_THETA;                     % The hdcell theta dimension\r\nHD_DIMENSION_THETA = 36;\r\n\r\ntheta_size = 2*pi\/HD_DIMENSION_THETA;  % 0.6283 radian  36 deg\r\n\r\nglobal HD_TH_SUM_SIN_LOOKUP;\r\nglobal HD_TH_SUM_COS_LOOKUP;\r\nHD_TH_SUM_SIN_LOOKUP = sin((1:HD_DIMENSION_THETA).*theta_size);\r\nHD_TH_SUM_COS_LOOKUP = cos((1:HD_DIMENSION_THETA).*theta_size);\r\n\r\nglobal HD_CELLS_TO_AVG;\r\nglobal HD_AVG_TH_WRAP;\r\nHD_CELLS_TO_AVG = 3;\r\nHD_AVG_TH_WRAP = [(HD_DIMENSION_THETA - HD_CELLS_TO_AVG + 1):HD_DIMENSION_THETA 1:HD_DIMENSION_THETA 1:HD_CELLS_TO_AVG];\r\n\r\nglobal HD_WEIGHT_EXCITATION_DIMENSION;\r\nHD_WEIGHT_EXCITATION_DIMENSION = 7;\r\n\r\nglobal HD_WEIGHT_INHIBITION_DIMENSION;\r\nHD_WEIGHT_INHIBITION_DIMENSION = 5;\r\n\r\nglobal HD_WEIGHT_EXCITATION_DIMENSION_HALF;\r\nglobal HD_WEIGHT_INHIBITION_DIMENSION_HALF;\r\nHD_WEIGHT_EXCITATION_DIMENSION_HALF = floor(HD_WEIGHT_EXCITATION_DIMENSION\/2);\r\nHD_WEIGHT_INHIBITION_DIMENSION_HALF = floor(HD_WEIGHT_INHIBITION_DIMENSION\/2);\r\n\r\nglobal HD_WEIGHT_EXCITATION_VARIANCE;\r\nHD_WEIGHT_EXCITATION_VARIANCE = 2;\r\n\r\nglobal HD_WEIGHT_INHIBITION_VARIANCE;\r\nHD_WEIGHT_INHIBITION_VARIANCE =3;\r\n\r\nglobal HD_GLOBAL_INHIBITION;\r\nHD_GLOBAL_INHIBITION = 0.00002;\r\n\r\nglobal HD_WEIGHT_EXCITATION;                   % the hdcell local excitation weight matricies\r\nglobal HD_WEIGHT_INHIBITION;                   % the hdcell local inhibition weight matricies\r\nHD_WEIGHT_EXCITATION = test_create_hdcell_weights(HD_WEIGHT_EXCITATION_DIMENSION,HD_WEIGHT_EXCITATION_VARIANCE);\r\nHD_WEIGHT_INHIBITION = test_create_hdcell_weights(HD_WEIGHT_INHIBITION_DIMENSION,HD_WEIGHT_INHIBITION_VARIANCE);\r\n\r\n%% Local Excitation\r\n\r\nglobal HD_E_TH_WRAP;\r\nHD_E_TH_WRAP = [(HD_DIMENSION_THETA - HD_WEIGHT_EXCITATION_DIMENSION_HALF + 1):HD_DIMENSION_THETA 1:HD_DIMENSION_THETA 1:HD_WEIGHT_EXCITATION_DIMENSION_HALF];\r\n\r\nhdcells_le_new = zeros(1,HD_DIMENSION_THETA);\r\nfor z=1:HD_DIMENSION_THETA\r\n\tif HDCELLS(z) ~= 0\r\n       \thdcells_le_new(HD_E_TH_WRAP(z:z+HD_WEIGHT_EXCITATION_DIMENSION-1)) = ...\r\n        \thdcells_le_new(HD_E_TH_WRAP(z:z+HD_WEIGHT_EXCITATION_DIMENSION-1))+ HDCELLS(z).*HD_WEIGHT_EXCITATION ;\r\n    end\r\nend\r\nHDCELLS = HDCELLS + hdcells_le_new;\r\n\r\n\r\nglobal HD_I_TH_WRAP;\r\nHD_I_TH_WRAP = [(HD_DIMENSION_THETA - HD_WEIGHT_INHIBITION_DIMENSION_HALF + 1):HD_DIMENSION_THETA 1:HD_DIMENSION_THETA 1:HD_WEIGHT_INHIBITION_DIMENSION_HALF];\r\n\r\n\r\n%% local inhibition \r\nhdcells_li_new = zeros(1,HD_DIMENSION_THETA);\r\nfor z=1:HD_DIMENSION_THETA\r\n   if HDCELLS(z) ~= 0\r\n       hdcells_li_new(HD_I_TH_WRAP(z:z+HD_WEIGHT_INHIBITION_DIMENSION-1)) = ...\r\n       hdcells_li_new(HD_I_TH_WRAP(z:z+HD_WEIGHT_INHIBITION_DIMENSION-1))+ HDCELLS(z).*HD_WEIGHT_INHIBITION ;\r\n   end\r\nend\r\nHDCELLS = HDCELLS - hdcells_li_new;\r\n\r\n\r\n%% global inhibition\r\n\r\nfor i=1 : HD_DIMENSION_THETA\r\n    if HDCELLS(i) &gt;= HD_GLOBAL_INHIBITION\r\n        HDCELLS(i) = HDCELLS(i) - HD_GLOBAL_INHIBITION;\r\n    else \r\n        HDCELLS(i) = 0;\r\n    end \r\nend\r\n\r\n%% Global Normalisation\r\ntotal = 0;\r\ntotal = sum(HDCELLS);\r\nHDCELLS = HDCELLS.\/total;\r\n\r\n%% Get the current head direction\r\n\r\n[value, z] = max(HDCELLS);\r\n\r\nz_HDCELLS = zeros(1,HD_DIMENSION_THETA);\r\n\r\nz_HDCELLS(HD_AVG_TH_WRAP(z:z+HD_CELLS_TO_AVG*2)) = HDCELLS(HD_AVG_TH_WRAP(z:z+HD_CELLS_TO_AVG*2));\r\n\r\nout_theta = mod(atan2(sum(HD_TH_SUM_SIN_LOOKUP *(z_HDCELLS')), sum(HD_TH_SUM_COS_LOOKUP *(z_HDCELLS')))\/theta_size, HD_DIMENSION_THETA);\r\n\r\n\r\n%% create local excitation weight or local inhibition weight\r\n\r\nfunction [weight] = test_create_hdcell_weights(dim,var)\r\n\r\ndim_centre = floor(dim\/2) + 1;\r\n\r\nweight=zeros(1,dim);\r\n\r\nfor z=1:dim  \r\n    weight(z) = 1\/(var*sqrt(2*pi))*exp(-(z-dim_centre)^2)\/(2*var^2); \r\nend\r\n\r\ntotal = sum(weight);\r\nweight = weight.\/total;       \r\n\r\nend\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The excerpt note is from the Michael&#8217;s book. The example code is implemented by Fangwen, which can help us to understand the process and principle of the method. Michael Milford.\u00a0Robot Navigation from Nature: Simultaneous Localisation, Mapping, and Path Planning Based on Hippocampal Models. Springer-Verlag Berlin Heidelberg Press, pp. 68-69, 2008. To achieve stable activity profiles [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[114,96,257],"tags":[271,270,269],"_links":{"self":[{"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=\/wp\/v2\/posts\/1010"}],"collection":[{"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1010"}],"version-history":[{"count":5,"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=\/wp\/v2\/posts\/1010\/revisions"}],"predecessor-version":[{"id":1045,"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=\/wp\/v2\/posts\/1010\/revisions\/1045"}],"wp:attachment":[{"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/braininspirednavigation.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}