Friday, December 16, 2011

Sookie’s Complicated Love Life Or: An Absolute Beginner’s Guide to Connectionist Modeling

Preface:  In developing my undergraduate computational modeling class, I've been frustrated that there don't seem to be any really SIMPLE models out there that students can read to bridge the gap between learning about units and connections, to reading about actual published models.  This year my experience was that students did fine learning about what modeling is and what the constituent parts of a model are, but then had quite a lot of difficulty scaling that knowledge up to actually understanding the first few models we read.  It seemed to me that they need a more gentle transition.  So, I've been spending some time trying to write an extremely simple model with only a few units and connections, based in a framework that the students probably already understand:  the dangers of dating vampires.  This is definitely a work in progress, but I find it intensely amusing, so I've shared the first 2 sections below. 

1. Introduction Sookie Stackhouse is the protagonist / waitress of the “Sookie Stackhouse” novel serial and HBO show True Blood.  Most notably for our purposes, Sookie’s love life is incredibly complicated, and in addition to the normal perils of adult relationships (e.g., hurt feelings, recrimination, abuse of trust), is rife with the dangerous consequences of being romantically involved with various creatures of the night.  To date on the show, Sookie has become involved with (in no particular order):  A shape-shifter, a vampire, a werewolf, and another vampire. 

After years of failing to satisfactorily predict how dangerous each of her relationships with various creatures of the night would be (with subsequent consequences such as having all her blood drained, being kidnapped, and having her house taken over by a demon), Sookie has decided that the only method of making predictions about the amount of danger she is likely to face in any given relationship rigorous enough to prevent her from (e.g.,) having her best friend shot in the head by a jealous werewolf, is computational modeling.  Sookie knows that, given what she has learned about the consequences of dating the undead, she can train a computational model to predict how dangerous a particular romantic venture will be.

Goal of the model:  To predict how dangerous a particular ill-advised relationship is.

2.  The Network  Given this goal, it is clear to Sookie how she should set up the model.  She needs to tell the model the details of the romantic venture she is considering, and let it perform computations to predict how dangerous it will be.  Thus, Sookie knows what the Inputs of the model should be:  types of potential suitors (living and dead.) Up to the start of Season 5, she has had 5 types of suitor:  human, young vampire, old vampire, werewolf, and shapeshifter.  Therefore, she will start with 5 input units.  She also knows what the output of the model should be:  predicted danger.  That can easily be represented by the value of only one unit.  The units in the model look like this:  

FIGURE 1:  Units

Of course, in order for the suitor units to affect the DANGER! unit, they have to be connected to it.  One good way to think about units and connections is as tanks full of water connected with pipes.  If we have two water tanks, one that is full of water, and one that is empty, how can we get the water from the full tank into the empty tank? We connect them, perhaps with a hose.  In a network, instead of water, we have activation.  Activation can’t get from the Werewolf unit into the DANGER! unit unless there is a connection between them.  We need to get some activation into that danger unit, because its activation is going to be what tells Sookie how dangerous each potential relationship is.  Thus, we need to add some connections to the network.  In network figures, connections are usually represented as lines going between units, with arrows to show which way the connections go.  So, with the connections added in, our network now looks like this:

FIGURE 2:  Units and Connections

Now, Sookie can “pour” some activation into a particular suitor unit, and, because of the connections, that activation can “flow” into the danger unit.  The amount of activation in the danger unit is the model’s prediction of how dangerous a given romantic configuration will be.  At this point, we can realize some intuitive facts about this model.  First of all, the more activation Sookie pours into the network, the more of it is probably going to get into the danger unit, and the more dangerous the network is going to predict a relationship will be.  For example, if Sookie pours a bunch of activation into ALL FIVE UNITS, the danger unit is going to receive quite a lot of activation.  This corresponds with our intuition that the more creatures of the night one dates simultaneously, the more danger one is likely to be in.  Similarly, if Sookie doesn’t pour ANY activation into the network (that is, doesn’t date anyone,) she isn’t in any danger from her romantic entanglements. 

Second, we are now in a position to understand weights, also called connection strengths.  In the types of model we will be studying, not all the connections will always be equally strong.  In terms of the water and pipes analogy, a strong connection would be like a big thick pipe that lots of water can run through.  A weak connection would be like a tiny little thin pipe that only a drop or two can flow through at a time.  In Sookie’s model, we might imagine that Sookie will generally be in less danger if she dates a human than if she dates any of the undead.  Similarly, we might assume that the old vampire is more dangerous than the young vampire.  And maybe the werewolf and shapeshifter are somewhere in between the young and old vampire.  Imagining our connections as pipes of varying thickness, we might now depict the network like this:

FIGURE 3:  Units with varying connection strengths

We now have 3 out of 4 parts that a computational model needs to perform computations.  We have units, connections, and connection strengths.  In the next section, we will talk about the fourth part:  the activation function—the rule that tells the network how to add up all the activation coming in from the suitor units and actually give us a numerical estimation of predicted danger.    

...To Be Continued 

No comments:

Post a Comment