23 Jun

neurons for memory

New Scientist has an article about a study which is honing in on particular neurons which fire when a person recognises an image of a person.

What I find surprising about this is that the concept is very simple to understand, but it seems to be taking researchers decades to come to the point – they seem surprised to find single neurons firing, as a single neuron is a very simple organism, so how could it hold an abstract concept?

I’ve been doing a lot of thinking about neural networks recently, as I’m working on a robotic gardening machine, which will eventually be put to good use in my own garden to help with my farming.

During my own thinking on this, I’ve also come to the realisation that one single neuron can hold an entire complex memory. When you think of it, a neuron includes not just itself, but its connections to the neurons around it. It is the connections that give a neuron its “intelligence”. A memory, then, is the sum of a neuron’s connections.

Now, it’s not quite as simple as that… the connections take input from other neurons, which in turn are calculated from further connections. In short, a simple yes/no question is actually quite complex when you try to work it out with neurons, but when you get the answer, you can trace back on the connections and get a very rich “reason” for the solution.

For instance, the article mentions Halle Berry. Now, for me, Halle Berry rings several bells – a very nice golf swing in a certain film I can’t remember the name of being the strongest. So, for me at least, the neuron (or small group of neurons) that recognises Halle also links the recognition strongly to that scene. There is also an image of her face, and for some reason, a Michael Jackson video (did she play an Egyptian queen in a video?).

That’s at least four neurons, each of which, if I think about them, will throw up a load more connections.

I think that the various neurons help to keep the memory strong. In Artificial Neural Networks, changing a single neuron is discouraged if it has strong connections to many others, as that change will affect the results of those other neurons.

I think that this is why mnemonic memory works so well. In Mnemonics, in order to remember a single item, you try to link it with something you already know. For example, in the old Memory Palace method, you imagine a walk through your house, or another familiar place. Each room that you enter, you can associate with a certain thought. For more memories, you can associate individual points of interest in the room – shelves, windows, corners, etc.

For instance, let’s say you are to remember a shopping list of “bananas, lightbulbs, baby food, and clothes pegs”, you could associate it with my own house like this: “I walk into my house. Before I can enter, I need to push a huge inflated banana out of the way. On my left is a lavatory. In that room, the walls are covered in blinking lightbulbs. Further on, I reach the main hall. The floor is cobbled with jars of baby food. I walk over the jars into the sitting room, where my girlfriend is sitting, trying to stick as many clothespegs to her face as possible”.

Now, by associating the front door with a banana, for instance, you are doing a few things – you strengthen connections between your front door and bananas, you also connect bananas with your front door, and the absurdity of the situation impresses the connections further. Later on, when you reach the shopping market, you don’t need to remember what was on your list – you just need to go through your memory palace a room at a time.

What is very important about this is that you have used only two items of memory (your front door, and bananas) to remember a third item – that bananas are on your list.

I wonder – Is the sum of possible memories far greater than the sum of neurons available to you? It seems to me that it’s dependant more on the connections than the neurons.

Ramble finished…

21 Jun

columnar coding in vim

I like to see as much code on the screen as possible. I also like to use short lines of code, as they are easier to read.

Combining the two, though, usually means that I end up with a screen with code on teh left side of the terminal, and nothing on the right – not ideal.

So, I posed a question on the vim mailing list, and got an answer about two hours later from Chip.

The solution is to split the screen into two columns, scroll the right column down one page, and “lock” the scrolls together, so that scrolling one column by a line causes the other to also scroll.

To do this, first place this function in your ~/.vimrc:

" Scb: toggle all windows to/from scrollbind {{{2
com! -nargs=0 Scb call ScrollBindToggle()
fun! s:ScrollBindToggle()
  if &scb == 0

   let wn                 = winnr()
   let g:scrollbindtoggle = &sbo
   set sbo=ver,hor,jump
   windo set scb
   exe wn."wincmd w"
  else
   let wn   = winnr()
   let &sbo = g:scrollbindtoggle
   unlet g:scrollbindtoggle
   windo set noscb
   exe wn."wincmd w"
  endif
endfun

Then, load up a file of code which usually takes up two or more screens to view it.

Now, split the page in two columns, select the right one, scroll that down a page, lock the scroll, and go back to the first column.

:vsp
<CTRL+w> →
<PGDN>
:Scb
<CTRL+w> ←

That’s it!