Call Windows Support

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg
Showing posts with label research. Show all posts
Showing posts with label research. Show all posts

Sunday, 17 November 2013

representations, permutations, visualisations

Posted on 04:09 by Unknown
One of the things I’m interested in is evolutionary algorithms (EAs), and how to make them better.  An EA takes a population of “genomes”, “mutates” (changes a little) and selects (based on “fitness”), and mutates and selects, and ... until a suitably fit answer is found.

A recent advance has been the introduction of “evo-devo” algorithms.  (I’m putting all this biological terminology in scare quotes, because by the time the relevant process has been translated into a computer algorithm, it is so far removed from its biological inspiration as to make a biologist wince, or even exclaim in outrage.)  Evo-devo puts a distance between the genome (the representation that gets mutated) and the “phenotype” (the representation that gets selected based on fitness).  This can help the algorithm’s performance, by allowing simple easily mutatable genomes develop into complex structured phenotypes.

A colleague of mine at York, Jillian Miller, is the inventor of such an algorithm, Cartesian Genetic Programming (CGP).  The genome is a string of numbers (numbers are easy to mutate a little bit).  The string is then interpreted as a network phenotype.  The network itself has inputs and outputs, so is a form of program.

Now, let’s consider permutations.  A permutation of the numbers 1 to N is these numbers in some specific order.  So the permutations of 1 to 3 are: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1).  A string of length N has N! (N factorial) permutations.  N! grows very fast; while 5! = 120, 10! = 3,628,800, and 100! > 10157.

Permutations are common in computer science.  One classic use is in the Travelling Salesman Problem: given a bunch of N cities, find the shortest path through all of them.  That is, find the permutation of 1 to N that gives the shortest path.  Given there are N! such permutations, clearly we don’t want to try them all.  Although exact algorithms that are essentially more efficient than trying all possibilities aren’t known (and it is strongly suspected that there aren’t any), there are algorithms that come up with very good approximate (nearly shortest path) answers most of the time.  EAs are one such class of algorithms: breed for fitter (shorter) paths.

Permutations as genomes are a bit tricky, though.  A permutation has structure: it must contain all the numbers from 1 to N, and each only once.  So you can’t mutate a single entry: you have to swap two entries, or do something else that maintains the permutation structure. “Crossover” is even harder: how do you take half of one permutation, half of another, and combine them into a valid permutation?  There are various techniques, but they are not very pretty.

Using an evo-devo approach to generate a permutation seems even harder: how do you ensure that your developed system is a valid permutation?  So, for example, with CGP we can have a list of outputs, but how do we ensure that this list is a valid permutation?  (Having a single output that is already a permutation merely moves the problem back inside the network somewhere.)

We need a further representation and development step that is guaranteed to produce a permutation.  Rather than try to get the network to produce a permutation immediately, let’s break it down into two steps: the network produces a list of numbers, then that list has to go through a further interpretation step to form a permutation.  Julian came up with an idea of how to do this: given a list of (say) real numbers (easy to produce with CGP), just sort them into ascending order.  The correspondingly sorted list of the indexes gives the required permutation.  VoilĂ !

A string of numbers is interpreted as a network, which outputs a real vector, which when sorted yields a permutation

What is happening here is easy to visualise using a technique called parallel coordinates.  A list of N real numbers can be thought of as a vector in N-D space.  But N-D space is hard to visualise if N > 3.  (I find it pretty hard to visualise even when N = 3.)

It’s hard to visualise a lot of dimensions this way

Parallel coordinates do what it says in the name: instead of drawing the N dimensions orthogonal to each other (rapidly running out of ways to do this in our 3D physical space), draw them parallel to each other.  It’s easy to draw lots of parallel lines.  Now plot the N-D point (x1,x2,...xN) as follows: plot the point x1 on axis 1, the point x2 on axis 2, and so on, then joint these points together with a line.  The line in the parallel coordinate plot represents the point in N-D space.

parallel coordinates view of a single N-D point

We can use these parallel coordinated to visualise how a vector of real numbers can represent a permutation by its components being sorted into ascending order.

(top) a vector of 20 real numbers, a 20-D point, drawn in parallel coordinates; (bottom) the same vector, with the parallel axes ordered so that the components are in increasing order: the sorted axis indexes are the permutation represented by the N-D point. 

The Python/numpy code that generated these plots is:
N = 20
P = range(N) # indexes
V = rand(N) # random vector

# plot unsorted vector
for dim in range(N):
ax1.plot([dim, dim], [0, 1], '0.5', linewidth=0.25)
ax1.text(dim, -0.2, str(P[dim]), ha='center', fontsize=32)
ax1.plot(range(N), V, '.k', markersize=20)
ax1.plot(range(N), V, 'k')

# sort, and plot sorted vector
P = argsort(V) # sort indexes
V = sort(V) # sort vector (for plotting)
for dim in range(N):
ax2.plot([dim, dim], [0, 1], '0.5', linewidth=0.25)
ax2.text(dim, -0.2, str(P[dim]), ha='center', fontsize=32)
ax2.plot(range(N), V, '.k', markersize=20)
ax2.plot(range(N), V, 'k')
Note that the code that generates the permutation is the single line P = argsort(V): the rest is just plotting code.

Here I started from a random vector, rather than the non-random output of some CGP network.  Sorting a random vector is one way to construct a random permutation, but as far as Julian and I can tell from the literature, this CGP use for representing evolved, non-random permutations isn’t standard.  Julian has been using it for several years in his module on evolutionary algorithms, and will be publishing a paper on some results next year.


Read More
Posted in algorithm, evolution, python, research | No comments

Saturday, 9 November 2013

the old and the new

Posted on 04:52 by Unknown
I’m just back from a 2 day residential Theo Murphy scientific workshop held in the Royal Society’s Kavli Centre at Chicheley Hall.  It’s my first visit there, and I can certainly recommend it as a marvellous venue for a workshop: great facilities, marvelous food, and friendly, efficient staff.  The science was great fun: I learned lots of new things, discovered links between seemingly diverse areas, and had interesting discussions over food and coffee.  I’m buzzing with ideas, which is the whole point!

I did the usual “photograph from my bedroom window” thing, which had a somewhat different from usual view:

first day of the workshop, view due east, into the rising sun

Oh, and then I took a photo from the other window in my bedroom:

first day of the workshop, view due south
Blissful.  I found an amusing view from the window half way down the main stairs:


A lovely formal garden, with lawns, paths, clipped bushes and trees, and, just visible at the vanishing point of the path … a wind farm!  The old and the new collide.

Read More
Posted in computer, conference, garden, history, research, science | No comments

Sunday, 4 August 2013

a new piling system

Posted on 04:15 by Unknown
I write academic papers, and read a lot of other papers. What with hard copy scattered through filing cabinets, and soft copies on a wide variety of websites, it can be hard to keep track of what I’ve read, made notes on, made BiBTeX citation data, and referenced.

Nearly two years ago I had a go at using Mendeley, designed to help with this very task. But for some reason, it never gelled for me, and I gave up using it. Then, when I became an Evernote convert, I fiddled about with using it to store data on the papers: author, title, etc, notes, BibTeX, and links to the papers themselves. But it was clunky work-flow, requiring a lot of hand-effort. Only the note keeping part of it worked well.

Then a colleague raved about Paperpile on his G+ stream. I had a look. It has a similar concept to Mendeley and other such systems, keeping references, supporting tags, good searching, associated notes, and citation output in multiple formats (although I only care about BibTeX). Instead of being a stand-alone application, however, it’s Chrome-based, and uses your Google Drive as a repository to store your papers. It’s currently in Beta, and I thought I’d give it a try. I emailed off for an account, and about a week later I got one.

The first thing I did was import my dusty Mendeley data (with a single button click and a log on), so I started off with a well-populated, if slightly out-of-date, database. I decided to trial it on the paper I had just started writing.

I defined a tag for the new paper. As I was writing, each time I included a reference in the text, I checked if that reference was already in my Paperpile database; if not, I added it. (Since there is usually a fair amount of overlap between bibliographies of papers in a similar domain, this should get faster as the db gets more populated.) Then I tagged it with the paper’s tag, and any other relevant tags.

My current Paperpile db, with 321 entries

To generate the BibTeX, all I needed to do was select the tag, which selected all the references, and then export the whole BibTeX file in one go.

The real benefit showed up when I got comments back on a draft of the paper. One was about a short quotation I had included, and I needed to find the quotation in its original context in order to address the comment. Click the Paperpile tab in Chrome. Type the author’s name into the search box; the paper’s details appear. Click the “view PDF” button. Voila! The paper is on my screen! I can’t think of a faster way to achieve that, without using telepathy.

You can upload in various ways, including PubMed, arXiv, doi, navigating to a website, or just giving it a PDF.  When you upload a PDF directly, the system searches the web to find the right data to populated the various fields. It gets this mostly right, but there have been a couple of odd peculiarities. Still, the system is in Beta. I reported the couple of weird results, and got very fast and helpful responses from the team. (I like Beta testing. I can whinge about software, and feel virtuous about doing so!)

One thing I particularly like is that the uploaded PDFs are stored in my Google Drive in a very sensible way. The files have obvious names: <Author> <Year> - <Title>.pdf. So if Paperpile were to disappear for any reason, I still have all my PDFs in a very usable form. (I’m not expecting it to disappear; I’m just paranoid: I have my Google Drive synched to my hard drive at home, in case Google disappears!)

I haven’t used all the facilities, in particular, I haven’t exploited the Google Docs integration. The Paperpile team report that some people are using it to write their papers collaboratively in Google Docs. That looks potentially useful, but I don’t use this plain format: I write my papers in LaTeX/BibTeX, using TeXnicCenter.

One part of the system I probably won’t use that much is the notes field. It’s perfectly fine, but I like to keep more substantial notes, with formatting, sketches, figures, and the like. So I’ll continue using my Evernote “papers” notebook, but now just for the notes, not the entire paper and other detials. For a paper with notes, I add a link from the Paperile entry to the relevant Evernote note, using the URL field which gives a clickable link (and I add an Evernote tag, to make it clear to me that there is a note). Similarly, I have a lot of already existing book reviews on my website. So when I include a book that I own, I add a link to the review on my site.

In fact, I think that having a variety of tools that each does their own thing well, with links between the relevant parts, works better than trying to shoehorn all capability into every application. So in Evernote, for example, for a meeting note, I don’t copy the agenda from the email notification, I just store a link to it. Evernote Webclipper allows you to clip the whole email into Evernote, but that just seems to cause unnecessary duplication. It’s good practice to keep only one copy of data (except for backups, of course!), otherwise there is the potential for copies to get out of synch. When that agenda is inevitably later updated, and a new copy emailed out, I don’t have to do anything: provided it is sent out with the same subject line, the Gmail link pulls up the entire conversation, and I can select the most recent agenda. (One day, the agenda setters may start using Google Docs, and so everyone will always have the most up to date version – provided they haven't clipped it into Evernote!) With all these web-based tools, the URL can link everything together.

In summary: first impressions of Paperpile are very favourable. I’ve successfully and productively used it for writing a paper, and it being web/Google based means it’s available at work, at home, and elsewhere, without me having to do anything special. I’ll report on progress if and when it gets more deeply integrated into my web-life.

Read More
Posted in Evernote, LaTeX, publishing, research, science, web | No comments

Monday, 8 July 2013

Unconventional Milan

Posted on 01:03 by Unknown
I'm back from the conference on Unconventional Computation and Natural Computation (UCNC) in Milan. Excellent conference, with lots of great presentations, conversations, and food.

My Evernote experience was a success.  I managed to take the notes I wanted, using my Netbook.  Fortunately, the venue being a university, the rooms had suitable benching for resting the Netbook on -- no more bruises where the computer's little feet dig into my legs.  And there were enough power sockets around that I could recharge as necessary.

When there was a particularly useful or interesting figure on a slide, I took a photo of it, and added "[photo]" to my notes at that point.  Then, when I got home, I downloaded the photos, straightened them up, cropped them, adjusted the contrast, and pasted them into Evernote in the right places.  That worked even better than scribbling down a diagram.  But it did mean that I had to remember to sit near the front.

So now I have enough trials to be convinced Evernote is the right approach, for SF conventions, for seminars, and for conferences.  Legible, searchable notes are a boon.
Read More
Posted in conference, Evernote, research | No comments

Sunday, 30 June 2013

Unconventional Computation with Evernote

Posted on 02:30 by Unknown
Today I'm off to the conference on Unconventional Computation and Natural Computation (UCNC) in Milan.  I'm running the CoSMoS (Complex Systems Modelling and Simulation) workshop there on the Monday, including giving a talk.  Then it's several days of listening to lots of interesting talks from the "here be dragons" end of computing.  On the Friday, one of my students is giving a couple of talks on his work.

This is the first conference I've been to where I'll be taking notes in Evernote on my Netbook, rather than with a pen in a lab book.  Last year, UCNC was in September, and I didn't start using Evernote until October.  I did use Evernote at the science fiction convention at Easter, where it worked really well, but this is the acid test: using it for the day job!  Like at the con, I've set up a bunch of template notes, one for each session, ready to start taking notes.

I hope there is somewhere to rest the Samsung Netbook so its sharp little feet don't bruise my knees like they did at the con!
Read More
Posted in conference, Evernote, research | No comments

Saturday, 20 April 2013

antisocial networking

Posted on 06:59 by Unknown
I have had my website since the mid 1990s.  I have had this blog since early 2011.  But I have resisted social networking.  No Facebook, no Twitter, no nothing.  Until yesterday.

I have finally succumbed, to Google+.  A colleague had just set up a "community" for a small group of us to collaborate on our research project.  So I clicked for an account, joined his community, added people to circles, and stuff.

Then, in another meeting yesterday, we decided to set up another community, for a different research collaboration.  Zero involvement to two communities, in about six hours!

So I am now networking -- but only in gated communities. Antisocial networking, I suppose.
Read More
Posted in research, web | No comments

Saturday, 15 September 2012

gamified research

Posted on 03:32 by Unknown
My day job includes working with people who research on flocking, social networks, and other complex interactions of groups of agents.  A while back, some of our researchers decided to see if their work could be brought to the public through "gamification".  Over the summer, the University has funded a couple of interns to work on this, and now ComplexCityApps have just released the first game for the Android: Floqua.


As the game's website says:
Find all of the lost fish in each level and guide them to safety in the castle. The tricky part is keeping them in your flock. Swim too fast and you'll leave your fish behind. Watch out for the predators: they're hungry!
The game is now available through Google play.  I confess, I've spent more time than I should herding fish.  It's easier than herding cats, which is part of my day job...

In addition to being a fun game (we hope!), it's educational (we also hope!).  You can simply play the game.  But, if you want to know more, there are pointers to the science behind the app.


And the developers have bravely been keeping a blog, so you can also dig down into some of the game design process, including effort to make sure the colour-coding of fish types is accessible to colour-blind players.


Okay, I'm off to try the next level, which has two rather hungry predators trying to eat my fish...

hiding from predators...

Read More
Posted in education, game, research, science | No comments

Thursday, 12 July 2012

narrating complexity

Posted on 00:11 by Unknown
Our new interdisciplinary network on Narrative and Complex Systems is having its first workshop, in York.  Yesterday we had a great time explaining to each other what we did, from narrative in fiction, in films, in computer games, to the narrative of complexity and emergence, and trying to discover common concepts.  We finished the day by brainstorming a mindmap:


This process was amazingly helpful in distilling our ideas.  The result, however, is pretty incomprehensible to anyone who wasn't there!
Read More
Posted in cognition, education, game, history, psychology, research, robots, science | No comments

Sunday, 17 June 2012

shooting chocolate

Posted on 12:19 by Unknown
I'm just back from a couple of days in Brussels, where I was at a meeting about Unconventional Computation. Brussels is a mixture of new and old buildings, as the "view" out of my hotel window shows:


New buildings at the back, packed right up against older ones in the middle.  And those older ones are indeed quite old; zooming in on the wall to the right shows some crumbling brickwork:


But what Belgium is famous for, of course, is chocolate.  I decided that photographs would be better for me than any closer interaction, and the displays themselves are works of art:


I did succumb to a hot chocolate drink, however.  Mmmm.
Read More
Posted in food, research | No comments

Sunday, 10 June 2012

search history

Posted on 13:56 by Unknown
I was writing a paper, and as a conclusion to a short section, I wanted to put "Life is a verb, not a noun".  Now, that sounds like something someone has probably said before, so I thought I would check, in case I needed to reference it.  I found the source as follows:
  • I Google “Life is a verb, not a noun”.
  • Lots of entries say it's by Charlotte Perkins Gilman, but none give a source (as usual)
  • I Google “Charlotte Perkins Gilman wikiquote”
  • I follow the link to http://en.wikiquote.org/wiki/Charlotte_Perkins_Gilman
  • It’s not there
  • I Google “Charlotte Perkins Gilman Life is a verb, not a noun”
  • One of the entries this time looks more like like a source: I can see that it has a reference in it, to a (p. xv)
  • I follow link to http://www.h-net.org/reviews/showrev.php?id=33118
  • It’s a review by Cara L. Burnidge, of Charlotte Perkins Gilman: a biography, by Cynthia J. Davis, with a link to the book itself at Amazon.com
  • I follow link to http://www.amazon.com/exec/obidos/ASIN/0804738890
  • The Amazon page has a “look inside” version of the book, so I look to see if p.xv is included. It is, and has the quote, but no source. However, the same paragraph has several other quotes, and then an endnote reference 10.
  • I look to see if endnote 10 is included in the “look inside” version. It is, on p.409, where it says “she calls 'life' a verb in HW, 203”, which sounds like it could be the source.
  • I assume 203 is a page reference, and that HW is an abbreviation for the source. What is HW?
  • I look to see if the abbreviations are included in the “look inside” version. They are; HW = Human Work
  • I Google “Charlotte Perkins Gilman Human Work”
  • There's a Google books version at http://books.google.co.uk/books/about/Human_work.html?id=IHoEAAAAYAAJ&redir_esc=y.
  • I follow the link to the book; it’s not searchable.
  • Back to Google Results page; there's another version at http://books.google.co.uk/books/about/Human_Work.html?id=y8Gif_Ni0L0C&redir_esc=y
  • I follow the link to the book; this one is searchable.
  • I search for “verb”; there are many hits; one is on p.203. And there it is:
  • I go to the beginning of the book, and get the rest of the bibliographic details.
"Life is a verb, not a noun."
Charlotte Perkins Gilman, Human Work, p203. McClure, Philips and Co, 1904.

Elapsed time, less than 15 minutes.
Try that with a paper library!

Maybe I should add it to wikiquotes...
Read More
Posted in books, quotations, research, web | No comments

Sunday, 12 June 2011

tar ice cream

Posted on 04:49 by Unknown
it never really got dark in Turku
I'm just back from Turku in Finland, from the Unconventional Computing conference. I had a great week listening to talks on computing with chemicals, with membranes, with weird quantum entanglement, with closed timelike curves, and more. (Did you know that if GPS didn't correct 42 microseconds a day for relativistic effects, locations would drift by 10km a day?) The weather was beautifully clear, and extremely hot (for Finland), sometimes even hitting 30C. And, of course, at this time of year, it never really got dark.

I'd been in Turku before, in 2003, at a formal methods conference (nice weather again, but nowhere near as hot). One evening a group of us went out for a meal at the Harald "Viking" restaurant (we didn't wear the helmets...). On the sweet menu was "tar ice cream". Ho, ho, ho, we went, it must be mistranslated. So we asked the server. "Tar? Like you put on the roads?" "Yes" she said. Okay, so I have to order that. It arrives: a scoop of plain white ice cream. I take a hesitant spoonful as the rest of the table watches. "It's tar!"

It had a lovely tarry flavour -- like mild creosote. It is actually pine tar, made from tree sap -- and it's very nice (although not everyone agrees!). This visit, one evening I was in a restaurant, and recognised it as that same place I'd been 8 years earlier. So I looked eagerly for the tar ice cream. Still available, and still delicious.

The next day was the conference dinner. We went to a lovely place in the archipelago, where they were serving a smoky tar drink in a wooden mug -- and the dinner included (among many other kinds of fish) herring in tar. Both nice, but not as good as that tar ice cream.
Read More
Posted in food, research | No comments
Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • hyperbolic hyperbole
    What's with hyperbolic discounting? It's everywhere ! I first consciously noticed the term at a workshop about six weeks ago, and n...
  • better use seaweed
    As Neils Bohr is alleged to have said , “prediction is very difficult, especially about the future”. My smartphone has a weather app on it t...
  • oh dear
    We have a garden pond to help encourage frogs and other amphibians. Hedgehogs may suffer, however. :-(
  • "Windows support" -- not
    Just had another scam phone call -- someone with a strong Indian accent claiming to be calling from "Windows Technical Support" (o...
  • national stereotypes
    I've just got back from a very productive three day meeting in Paris. Just around the corner from where I was working, there was a marv...
  • retrospective holiday diary day 1: travelling north
    We went to the Lake District last “summer” ; this “summer” it was time for touring the other side of the country: Northumbria. The holiday s...
  • retrospective holiday diary day 5: trains
    Monday 24 September, and the long-threatened rain finally arrived. So this was the ideal day for the planned Carlisle-Settle rail trip . Bu...
  • funfair mirror trees
    One of the trees in our garden has died.  It died last summer in the drought, but we gave it a year to prove to us it really was dead.  It i...
  • retrospective holiday diary day 3: Lindisfarne
    Saturday 22 September, and the weather was still fine, sunny holiday weather so we decided to take advantage of the sunshine, and do Lindisf...
  • more scammers
    So not long after the scam phone call , the phone rings again. It's British Gas -- they get to call me because I'm actually a custo...

Categories

  • 3D printer
  • algorithm
  • astronomy
  • birds
  • Bonnie Tyler
  • books
  • cognition
  • computer
  • conference
  • Doctor Who
  • driving
  • ducks
  • duodecimal
  • education
  • electricity
  • estimation
  • Evernote
  • evolution
  • font
  • food
  • fractals
  • game
  • garden
  • graphics
  • grimoire
  • history
  • holiday
  • humour
  • language
  • LaTeX
  • lego
  • lol
  • mathematics
  • medicine
  • money
  • music
  • obituary
  • pedantry
  • politics
  • probability
  • psychology
  • publishing
  • python
  • quotations
  • research
  • robots
  • science
  • science fiction
  • space flight
  • statistics
  • TPS
  • trains
  • tree
  • TV
  • weather
  • web

Blog Archive

  • ▼  2013 (119)
    • ▼  December (1)
      • that's not in the least bit suspicious
    • ►  November (17)
    • ►  October (12)
    • ►  September (10)
    • ►  August (9)
    • ►  July (8)
    • ►  June (10)
    • ►  May (19)
    • ►  April (10)
    • ►  March (9)
    • ►  February (4)
    • ►  January (10)
  • ►  2012 (103)
    • ►  December (16)
    • ►  November (8)
    • ►  October (14)
    • ►  September (6)
    • ►  August (13)
    • ►  July (8)
    • ►  June (6)
    • ►  May (9)
    • ►  April (10)
    • ►  March (7)
    • ►  February (5)
    • ►  January (1)
  • ►  2011 (79)
    • ►  December (7)
    • ►  November (5)
    • ►  October (10)
    • ►  September (7)
    • ►  August (6)
    • ►  July (5)
    • ►  June (6)
    • ►  May (6)
    • ►  April (9)
    • ►  March (9)
    • ►  February (3)
    • ►  January (6)
Powered by Blogger.

About Me

Unknown
View my complete profile