Friday, 31 August 2012

Michael Arbib takes a look at Ada

Ten years ago, my colleagues and I at INI had a lot of fun, and stress, working on 'Ada - the intelligent space' [1] for the Swiss national exhibition of 2002. Recently, influential theoretical neuroscientist and a computer scientist Michael A. Arbib [2][3] published a paper in the journal Intelligent Buildings International [4] entitled Brains, machines and buildings: towards a neuromorphic architecture [5].

Ada was conceived as a novel artificial organism, a creature in the shape of a space that visitors could enter. The space could then perceive and playfully interact with her visitors via sensory organs. She could see, hear and sense touch and contact. She expressed herself through sound, light, and projections on the walls.

In Arbib's paper he points out that
"While there is a great deal of work well underway in the design of intelligent buildings and ambient intelligence, this work has almost entirely ignored the findings of neuroscience"
and asks what might happen
"if our knowledge of the structure and function of brains informs our design of perception, control and communication systems for buildings, so that these systems are based on brain operating principles rather than ad hoc computational designs".

In trying to answer this question he takes a new look at Ada, amongst other systems. Ada's various subsystems were inspired to different degrees by neuroscience [6], and as such Arbib suggests that Ada represents a 'seminal precursor' of future buildings constructed as perceiving, acting and adapting entities based on lessons learnt from studying real, biological brains, and "a significant stepping stone towards neuromorphic architecture."

Part of his paper may be read as an introduction to neuroscience for architects and building automation engineers. If these readers take up Arbib's ideas and those expressed in INI's Ada, in the not too distant future we may find ourselves living and working in buildings that react much more intelligently to our habits and requirements.

One small correction to Arbib's article - Ada was exhibited in Neuchatel (aka Neuenburg), not in Lausanne.


(This post is adapted from my post which first appeared on the Institute of Neuroinformatics' Blog )

Arbib also gave a lecture at ANFA, the Academy of Neuroscience for Architecture, see

Tuesday, 31 July 2012

Code review(ed)

Today I had the rare, but pleasant experience of getting my code
reviewed by a colleague. We were talking about some aspects of Python at
lunch, and he volunteered to take a look at my code, so I said yes
please. Later in the afternoon he sat down with me, and we went through
almost 300 lines of my code and I learnt a couple of things. For one,
I'm not doing too badly (i.e. not too un-Pythonically), something I was
not at all sure about. For another, I was doing something quite ugly
with iterating over lists of tuples, where my reviewer pointed out I
could use a dictionary and get a much more elegant, readable &
maintainable result.

The point is that I learned stuff, and my code is now better.

Unfortunately, in this environment (an academic research institute) code
writing is still predominantly seen as a solo activity conducted as a
means to an end which does not need to be discussed. Only the results
need to be discussed.

The quality of code I see being written by doctoral students varies
greatly. Some is excellent, some less so. And I think it's a shame that
learning opportunities are being lost because hardly anyone reads
anybody else's code. It's not only the weaker coders who could gain in
terms of productivity during their PhDs, the better ones might happen to
find bugs sooner too, on the basis that two heads are better than one.
And in both cases, doing a bit of code review should stand them in good
stead for their future careers, in which they are very likely to
continue to write code, whether in academia or in industry.

Thursday, 19 July 2012

IRQF_SAMPLE_RANDOM on its way out

According to Linux Weekly News article 507115 , the flag IRQF_SAMPLE_RANDOM, which
drivers use to tell the kernel whether to use interrupts from their
device(s) as a source of entropy for the entropy pool that backs the
kernel's RNG or not, is liable to become redundant from 3.6 onwards.
"After this change, adding randomness from interrupts ... is done by
default for all interrupts". This means that at that point I can remove
the flag in my out-of-line pciaer driver
( along with the handling
of a module parameter (no_sample_random) which I provided to allow
paranoiacs to turn the use of IRQF_SAMPLE_RANDOM off. This might have
been important if very regular address-event senders and/or receivers
were in use (e.g. during test) but high quality random-number generation
were still important.

I've queued this change up in my TODO file.

Wednesday, 18 July 2012

Bibtex entry creation script used in anger

I've been using my Python script in anger to help convert two chapters
worth of references from plain text references to Bibtex entries.

It's a bit rough and ready and assumes quite a bit about the layout of
the references in the plain-text text, but it did a kind of 90% job
for me.

Maybe it could be helpful for others too, but you shouldn't expect too
much of it.

Of course it could be improved a lot, but at some point, faced by the
law of diminishing returns, I decided to stop improving it when it was
doing 90% OK, and the rest (the difficult cases) I've edited by hand.

Monday, 16 July 2012

Python script

I'm writing a Python script to generate Bibtex entries from more or less
free-form citations, trying to guess which parts are the author names,
article title, page numbers etc.

This is the first time I've written any Python for over a year, and I'm
a bit rusty. I keep on forgetting the colons at the end of if's and
function definitions.

Thursday, 12 July 2012

Draft book chapters handed over

Yesterday and today I handed over the drafts of two chapters of a
forthcoming book to our lead editor, Shih-Chii Liu.