Wednesday, March 28, 2007

Bayesian Model of Curiosity

As I continue to implement and experiment with a context representation based on Bayesian inference, I have considered various ways to implement curiosity. The main component I need is a prediction error based on the difference between the system's predictions and reality. Given the tools available in the Bayesian framework, the most obvious method would be to use the prior and posterior distribution. The prior represents the systems predictions, and the posterior represents reality (approximately). So the prediction error would be the difference (possible KL divergence) between the prior and posterior distributions. (One implication is that if the incoming evidence (likelihood) contains no new information, the prior and posterior will be equal, resulting in zero prediction error.) The prediction error can then be used to generate a curiosity reward, either for "surprising" events or for those that yield high learning progress (reduction in surprise over time).

After I went through all the trouble of figuring this out, I came across this mathematical model of surprise based on Bayesian statistics (in which surprise is measured in units of "wow").

Thursday, March 22, 2007

QuickProf 0.9.0 Released

Just a quick note to say that I just released version 0.9.0 of QuickProf, a very small (one header file) cpu profiling API for C++ applications on all platforms. It's easy to add it to your projects, and the timing measurements it provides are very useful for optimizing performance. For example, it can give you an overall timing summary when your app finishes, or it can generate an output file for graphing your app's runtime performance.

For example, I use QuickProf to profile the major components of my context representation code (inference, propagation, and adaptation). I have it print out an overall summary at the end, which usually gives me something like this:

adaptation: 23.2914 %
inference: 11.5562 %
propagation: 0.200819 %

...and I have it output a timing data file, which I then plot with the Python library Matplotlib:

Monday, March 12, 2007

The Universe as a Computer Simulation, Quantum Mechanics

I had a thought last week. Say you wanted to build a simulated universe, and your simulation would contain intelligent beings. To conserve computational resources, you would want to avoid simulating aspects of the universe that are not observed by its inhabitants. It would be like a colossal view frustum culling process. For example, events that are very small or very far away from an observer might not need to be computed.

If our universe is a computer simulation, maybe that's why we see quantum mechanical effects. The detailed positions of individual particles remain in indeterminant states until they are observed, at which point their wave functions collapse (i.e. their states are computed in more detail).

Interestingly, this entire thought process assumes that the observer has a very important role in the simulation, as if the universe were designed for intelligent beings.

GDC 2007

I just got back from the Game Developers Conference 2007 in San Francisco. I hung out with Ken Kopecky, Andres Reinot, and Josh Larson most of the week.

Here is a very terse summary of each day at the conference:

I attended Creativity Boot Camp, a full-day tutorial by Paul Schuytema. The morning was more lecture style, covering a set of practical tips on how to live a lifestyle that fosters creativity. In the afternoon the audience formed groups to work on several exercises. One was a problem solving task (deciding which objects to bring along when trying to escape a mall full of zombies). Another was a board game design task based on a random set of pieces, randomizers, and board layouts. Alexey Pajitnov happened to be there observing the groups as they worked.

I attended the day-long Independent Games Summit, which included sessions on prototyping, bootstrapping an indie game dev project, retail distribution, indie development logistics, the casual game market (presented by Eric Zimmerman of gamelab), the story behind Cloud, marketing for indie games, physics games (presented by Matthew Wegner, creator of Fun-Motion), and a panel discussion on the future of indie games.

At the Sony keynote they presented a "home" feature for the PS3. It looks like a SecondLife kind of thing with much better graphics. They also introduced an great-looking game called LittleBigPlanet. I went to a round table discussion on non-profit games, moderated by Martin de Ronde of OneBigGame. I also went to a round table on security and privacy in games, which touched on the legal and marketing issues related to storing user data. Finally, in the evening we went to the Independent Games Festival & awards ceremony and Game Developers Choice awards.

Shigeru Miyamoto gave the Nintendo keynote, discussing his vision and how it relates to that of Nintendo. One interesting point was that his goal for the original Zelda for NES was to introduce a new form of communication: instead of playing the game in isolation, gamers were forced to talk to each other about how to solve puzzles. Miyamoto also showed a video of Super Mario Galaxy.

At the annual Game Design Challenge, three designers were presented with the task of creating a video game using a needle and thread interface. Alexey Pajitnov won. I then attended a game design talk by Clint Hocking entitled Exploration: From Systems to Spaces to Self. The talk was based on the idea that humans have a need to explore things and that every game is an exploration game. "Exploration" was defined in several ways, including system exploration (the general idea of exploring the properties of some system, like the mechanics of a video game), spatial exploration (the special case where the system in question is defined spatially, e.g., a physics simulation). A third type, rarely seen in video games, is self-exploration, which refers to the process of putting ourselves in situations that lead to us learning something about ourselves.

Chris Hecker gave a talk on "how to animate a character you've never seen before," referring to the challenge of animating the user-designed creatures in SPORE. In the evening we went to the Programmer's Challenge, a game show with six of the industry's leading programmers.

Tom Leonard from Valve gave a talk on making the Source engine scalable to multiple cores. It sounds like they built a custom framework to support several different concurrency models (course-grained and fine-grained parallelism) for different situations. Chaim Gingold gave a talk entitled SPORE's Magic Crayons, which was about limiting the parameters available for user-generated content in order to push the space of probable designs into the space of desirable designs. In other words, for SPORE it was important to avoid giving users knobs that tend to yield ugly results.

We went to the Video Games Live concert in the evening, which included performances by Koji Kondo and Martin Leung (aka the Video Game Pianist).