International Conference on Advanced Intelligence 2010

The 2nd International Conference on Advanced Intelligence 2010 has just released it’s call for papers, which you can download here: ICAI2010 Call For Papers.

How is “Advanced Intelligence” different from general AI? The release says:

Typical features of Advanced Intelligence include: (1) Close interaction and coordination between Natural Intelligence and Artificial Intelligence, (2) Ideas and applications that push the frontiers of both Artificial Intelligence and Natural Intelligence, (3) Large-scale Distributed Intelligence and Web Intelligence

FWIW, I’m not sure I agree with the name, since “advanced” is a relative term, and the field of AGI (artificial general intelligence) is already fragmented enough without adding additional labels. Having said that, I’ve been invited to be an assistant co-chair, so I cordially invite you to submit interesting papers since then they’ll be a greater chance of me getting interesting papers to review 😉

Python to parse fields in Amazon S3 logs

The log format for Amazon S3 is slightly annoying. Not overwhelmingly so, but the date field has the field separator (a space) in the middle of it and it isn’t encapsulated by quote characters. Here’s some code to split the fields up, assuming you’ve downloaded the log file already (it’s easy enough to list all logs and retrieve them with boto):

import csv
r = csv.reader(open('logfilename'),
        delimiter=' ',quotechar='"')
log_entries = []
for i in r:
    i[2] = i[2] + " " + i[3] # repair date field
    del i[3]
    log_entries.append(i)

SizeUp behaviour using Compiz

Recently I found out about SizeUp in OSX and found it really useful. Basically it gives you hot keys for window positions, such that you can maximise them vertically and attach them to the left or right of the screen. Great for placing terminal windows and browsers. This is similar to the behaviour in Windows 7 (don’t know what they call it or care, they are just copying this stuff from existing window managers and getting all the credit). You can also send a window to a corner, or maximise horizontally and attach to top/bottom.

I knew it must be possible in linux somehow. For one thing, there’s wmctrl, a command line program for scripting window positions and I found some scripts made by others in the Ubuntu forums that act similar to the way I wanted.

However, it turns out there is something already available if you’re using Compiz as your display manager.

To change to using Compiz and get the required config tool, run:

sudo aptitude install compizconfig-settings-manager compiz-fusion-plugins-extra

And then open the menu System → Preferences → Appearance. Go to the Visual Effects tab and choose “Extra”.

Then fire up the CompizConfig Settings Manager that’s also under System → Preferences. When the dialog loads, go to the filter and type “grid”. This is the module of Compiz that gives you almost the same behaviour as SizeUp (you can get the rest of the behaviour using other modules in the “Window Management” category.

Update: changed the apt-get command to also install compiz-fusion-plugins-extra as the grid plugin is no longer part of the core package.

Bits and bobs as we enter 2010

  • OpenCog is getting get a bit of comment on twitter, which might in part be due to it being linked on Hacker News.
  • I’ve started up at Jai Thai Kickboxing, which is just around the corner from where I live so I hope to get 4-5 sessions in a week. After my first session my shins and feet are somewhat bruised, this could indicate that my technique leaves something to be desired. Equally likely however is that my shins just need to harden up!
  • I read in the paper that Avatar is the faster movie to reach a billion dollars at the box office. It was very pretty, but it was also only a passable story. I hope that Avatar’s success will show the movie industry that they need to adapt by making cinema an immersive experience so that they are providing people a reason to go to the cinema instead of watching movies at home.
  • My life experience keeps expanding and it makes me feel alive. I stand by my assertion that the meaning of life is experience.

Licensing dynamic systems and AI

Recently I’ve been contemplating a number of potential directions for creating a start-up based on application of OpenCog to a problem or field.

One evening, I had an interesting discussion in bed with my partner that was related to licensing such technology. OpenCog is open source, which is my personal preference for the development of AGI, even if the jury on whether it’s beneficial or needless reckless is still out. As open source software, it means that if we sold expert systems based on OpenCog to end-users, we’d have to also provide the source. Even though we can license it under different terms from SIAI, this isn’t entirely needed since my current viewpoint is that the real value will be in data within the system.

As an analogy, the biological design for the brain isn’t what makes us unique or what encompasses our knowledge and experience of the world. The pattern that’s formed during our childhood and education is what is really valuable, otherwise we’d make no distinction between twins and not particularly care if one twin passed away.

So, the digital mind’s pattern would be the important part that we’d license or sell. However dealing with a dynamic system makes that interesting, since the pattern that was sold/licensed would inevitably change. Learning software could well have the valuable part (the “identity” if you will) morph and change beyond the original deployment. In fact, the software could learn new things which makes the individual deployment “smarter” than the original or any other deployment.

In that case, who owns those improvements? Should we get
the rights, since it was our software that altered itself, or does it belong to the license-holder since the AI learnt the improvement in their environment?

I’m sure with sufficiently rigorous legal-work one could protect towards one view over another, but I’m more interested in what seems right.

Connectedness and gift giving

It’s Christmas time, and I enjoy getting gifts for people even though I’m not religious. I’ve also been enjoying getting rid of lots of stuff I don’t use/need. This not only makes me feel like I’m clearing out mental space (I have Tyler Durden’s words echoing in my head “The things you own, end up owning you”) but also makes me feel good that other people are getting something that they want/need. Especially since I’m either giving the stuff away or selling it cheaply on TradeMe.

I googled “It’s better to give than receive.” since that’s the quote that’s automatically been ingrained into my psyche. Turns out it’s from the Bible, Acts 20:35 (King James Version):

“I have showed you all things, how that so labouring ye ought to support the weak, and to remember the words of the Lord Jesus, how he said: ‘It is more blessed to give than to receive.'”

(I guess “more blessed” translates to “better” these days.)

Never mind that giving psychologically makes us happier than spending money on ourselves. It also physiologically affects us, by releasing, not only the good old reward molecule Dopamine, but also the love neurotransmitter Oxytocin (unfortunately the mention of oxytocin isn’t in the abstract, but it’s discussed here).

There is another aspect of gift giving I want to mention, which I haven’t got any references for, but is based on my intuition on the mechanics of intelligence. When we give someone a gift, we usually have a reason for it, and when we choose a gift for them we tend to think “Will the person like this?”. The act of that means we have to emulate, model, and predict what they want and by activation it re-enforces their pattern within our mind. Does this inadvertently get us thinking of other aspects of their personality and of what other people might like too? I’ve discussed how part of love is the strong bonding of patterns, one’s self in another mind, their mind emulated in the self. This twinning makes us feel connected to the other person. To me, it makes sense that going through this process while selecting gifts for other people will inevitably make one feel more connected in general. And as mentioned above, the neurotransmitter associated with love is also released during giving.

Maybe this is why the gifting economy of Kiwiburn (and the American equivalent) is such a central part of the festivals and contributes to them being such enjoyable experiences.

“We make a living by what we get, but we make a life by what we give.”
— Winston Churchill

Upload a file to S3 with Boto

Amazon S3 is a distributed storage service which I’ve recently been working with. Boto is Python library for working with Amazon Web Services, which S3 is one facet of. This post will demonstrate how to upload a file using boto (a future post will demonstrate who to create the parameters for POST multi-part request that another client can use to upload to S3 without knowing your AWS key id or secret access key).

I will assume you’ve signed up for S3 already, and successfully downloaded and installed boto.

import boto

# Fill these in - you get them when you sign up for S3
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''

bucket_name = AWS_ACCESS_KEY_ID.lower() + '-mah-bucket'
conn = boto.connect_s3(AWS_ACCESS_KEY_ID,
            AWS_SECRET_ACCESS_KEY)

If you’ve previously learnt about S3 you’ll know that bucket names need to be unique, so that’s why we’ve used the AWS Key ID as a prefix (as this is your unique id it’s unlikely someone else will be using it as a prefix). We’ve also converted the bucket to lowercase, as DNS is case-insensitive and it’s nice to use vanity domains of the form http://[bucket_name].s3.amazonaws.com/.

We create the connection object with boto.connect_s3() and this object let’s us interact with S3. We now create ourselves a bucket and upload a file:

import boto.s3
bucket = conn.create_bucket(bucket_name,
        location=boto.s3.connection.Location.DEFAULT)

testfile = "replace this with an actual filename"
print 'Uploading %s to Amazon S3 bucket %s' % \
       (testfile, bucket_name)

import sys
def percent_cb(complete, total):
    sys.stdout.write('.')
    sys.stdout.flush()

from boto.s3.key import Key
k = Key(bucket)
k.key = 'my test file'
k.set_contents_from_filename(testfile,
        cb=percent_cb, num_cb=10)

There you have it! The set_contents_from_filename is a particularly nifty method which simplifies all the streaming of data to S3. Amazon’s prototype python S3 library required that the file be loaded into memory. This doesn’t work too well if you are working with large media files.

Oh, and the percent_cb function is a call back that gets called as the upload progresses.

Code-brain

I have the code-brain.

Now that I live centrally, I’ve been finding myself more frequently excusing myself for having code-brain. What is code-brain? It’s when I’ve spent a day immersed in hacking code without social interaction… and to get out of this state generally just requires time. Usually if I went anywhere it’d require a drive and enough temporal separation for me to revert to a more sociable state, but now that I live in town, it’s about a 5 minute walk to meet up with people which is not enough time and words come with difficulty.

Given the plasticity of the brain, I sometimes wonder if coding for a living is psychologically stunting for one’s social behaviour. However, I can quickly reject that because many coders I know are very social and I don’t see them having the same difficulty.

I sometimes liken it to a mild form of Aspergers, since when dealing with code, for the most part it’s possible to keep everything you need to know about in front of you and it’s finite. It’s not overwhelming except when you’re thrown into a new project with a large existing code-base. Coming from being immersed in such a controlled environment it’s hard to adapt to being in a room full of people because it’s impossible to predict exactly what everyone else will do.

I don’t want to predict what everyone else will do, that’d make life boring. I just know it personally takes time to adjust between the two environments. If anyone has read or seen anything about this phenomenon then I’d appreciate links/comments – mostly so I can understand how to speed the transition and get more enjoyment from social situations without the painful transition.

Possibly I just need to make the transition more often and it’ll become easier 😉

Filtering Python dictionaries

Here’s a little Python snippet I just made up, but is immensely useful because I couldn’t find an obvious method like filter that applied to dictionaries instead of lists. This code pulls out specific key-value pairs from a dictionary and puts them in a new dictionary.

>>> x={ 'test1':1, 'test2':2, 'test3':3 }
>>> my_keys = ('test1','test2')
>>> y=dict(filter(lambda t: t[0] in my_keys, x.items()))
{'test': 1, 'test2': 2}

Obviously the performance characteristics of this won’t scale, but if you just want a few keys out of a dictionary then you should be fine.

Will it be okay?

This is a piece of writing from Hubbards cereal newsletter #36 – I used to have it on my wall when I was incredibly depressed, it was a amusing light in otherwise dark time. I’m miles from that place now, so am going to throw the newsletter out, but the writing itself deserves transcribing.

Will it be okay?
by Crescent Dragonwagon.

Yes it will.

But what if a big dog comes?

You will know whether it is friendly or not, if it is friendly, you pat it, if it is not you stand perfectly still and unafraid and it stops barking and comes to you and sits quietly beside you.

But what if there is thunder and lightning?

Continue reading →