comparison thesis/cortex.org @ 462:bb81cef09ad7

stuff about simulation vs reality.
author Robert McIntyre <rlm@mit.edu>
date Thu, 27 Mar 2014 20:18:51 -0400
parents b345650a0baa
children 6d55ac73bc6f
comparison
equal deleted inserted replaced
461:b345650a0baa 462:bb81cef09ad7
172 #+caption: curling, wiggling, and resting. 172 #+caption: curling, wiggling, and resting.
173 #+name: worm-intro 173 #+name: worm-intro
174 #+ATTR_LaTeX: :width 15cm 174 #+ATTR_LaTeX: :width 15cm
175 [[./images/worm-intro-white.png]] 175 [[./images/worm-intro-white.png]]
176 176
177 #+caption: =EMPATH= recognized and classified each of these poses by 177 #+caption: =EMPATH= recognized and classified each of these
178 #+caption: inferring the complete sensory experience from 178 #+caption: poses by inferring the complete sensory experience
179 #+caption: proprioceptive data. 179 #+caption: from proprioceptive data.
180 #+name: worm-recognition-intro 180 #+name: worm-recognition-intro
181 #+ATTR_LaTeX: :width 15cm 181 #+ATTR_LaTeX: :width 15cm
182 [[./images/worm-poses.png]] 182 [[./images/worm-poses.png]]
183 183
184 One powerful advantage of empathic problem solving is that it 184 One powerful advantage of empathic problem solving is that it
219 [experiences] 219 [experiences]
220 (and (curled? experiences) 220 (and (curled? experiences)
221 (let [worm-touch (:touch (peek experiences)) 221 (let [worm-touch (:touch (peek experiences))
222 tail-touch (worm-touch 0) 222 tail-touch (worm-touch 0)
223 head-touch (worm-touch 4)] 223 head-touch (worm-touch 4)]
224 (and (< 0.55 (contact worm-segment-bottom-tip tail-touch)) 224 (and (< 0.2 (contact worm-segment-bottom-tip tail-touch))
225 (< 0.55 (contact worm-segment-top-tip head-touch)))))) 225 (< 0.2 (contact worm-segment-top-tip head-touch))))))
226 #+end_src 226 #+end_src
227 #+end_listing 227 #+end_listing
228 228
229 229
230 ** =CORTEX= is a toolkit for building sensate creatures 230 ** =CORTEX= is a toolkit for building sensate creatures
231 231
232 I built =CORTEX= to be a general AI research platform for doing 232 I built =CORTEX= to be a general AI research platform for doing
233 experiments involving multiple rich senses and a wide variety and 233 experiments involving multiple rich senses and a wide variety and
234 number of creatures. I intend it to be useful as a library for many 234 number of creatures. I intend it to be useful as a library for many
235 more projects than just this one. =CORTEX= was necessary to meet a 235 more projects than just this thesis. =CORTEX= was necessary to meet
236 need among AI researchers at CSAIL and beyond, which is that people 236 a need among AI researchers at CSAIL and beyond, which is that
237 often will invent neat ideas that are best expressed in the 237 people often will invent neat ideas that are best expressed in the
238 language of creatures and senses, but in order to explore those 238 language of creatures and senses, but in order to explore those
239 ideas they must first build a platform in which they can create 239 ideas they must first build a platform in which they can create
240 simulated creatures with rich senses! There are many ideas that 240 simulated creatures with rich senses! There are many ideas that
241 would be simple to execute (such as =EMPATH=), but attached to them 241 would be simple to execute (such as =EMPATH=), but attached to them
242 is the multi-month effort to make a good creature simulator. Often, 242 is the multi-month effort to make a good creature simulator. Often,
329 - I built =EMPATH=, which uses =CORTEX= to identify the actions of 329 - I built =EMPATH=, which uses =CORTEX= to identify the actions of
330 a worm-like creature using a computational model of empathy. 330 a worm-like creature using a computational model of empathy.
331 331
332 * Building =CORTEX= 332 * Building =CORTEX=
333 333
334 ** To explore embodiment, we need a world, body, and senses 334 I intend for =CORTEX= to be used as a general purpose library for
335 building creatures and outfitting them with senses, so that it will
336 be useful for other researchers who want to test out ideas of their
337 own. To this end, wherver I have had to make archetictural choices
338 about =CORTEX=, I have chosen to give as much freedom to the user as
339 possible, so that =CORTEX= may be used for things I have not
340 forseen.
341
342 ** Simulation or Reality?
343
344 The most important archetictural decision of all is the choice to
345 use a computer-simulated environemnt in the first place! The world
346 is a vast and rich place, and for now simulations are a very poor
347 reflection of its complexity. It may be that there is a significant
348 qualatative difference between dealing with senses in the real
349 world and dealing with pale facilimilies of them in a
350 simulation. What are the advantages and disadvantages of a
351 simulation vs. reality?
352
353 *** Simulation
354
355 The advantages of virtual reality are that when everything is a
356 simulation, experiments in that simulation are absolutely
357 reproducible. It's also easier to change the character and world
358 to explore new situations and different sensory combinations.
359
360 If the world is to be simulated on a computer, then not only do
361 you have to worry about whether the character's senses are rich
362 enough to learn from the world, but whether the world itself is
363 rendered with enough detail and realism to give enough working
364 material to the character's senses. To name just a few
365 difficulties facing modern physics simulators: destructibility of
366 the environment, simulation of water/other fluids, large areas,
367 nonrigid bodies, lots of objects, smoke. I don't know of any
368 computer simulation that would allow a character to take a rock
369 and grind it into fine dust, then use that dust to make a clay
370 sculpture, at least not without spending years calculating the
371 interactions of every single small grain of dust. Maybe a
372 simulated world with today's limitations doesn't provide enough
373 richness for real intelligence to evolve.
374
375 *** Reality
376
377 The other approach for playing with senses is to hook your
378 software up to real cameras, microphones, robots, etc., and let it
379 loose in the real world. This has the advantage of eliminating
380 concerns about simulating the world at the expense of increasing
381 the complexity of implementing the senses. Instead of just
382 grabbing the current rendered frame for processing, you have to
383 use an actual camera with real lenses and interact with photons to
384 get an image. It is much harder to change the character, which is
385 now partly a physical robot of some sort, since doing so involves
386 changing things around in the real world instead of modifying
387 lines of code. While the real world is very rich and definitely
388 provides enough stimulation for intelligence to develop as
389 evidenced by our own existence, it is also uncontrollable in the
390 sense that a particular situation cannot be recreated perfectly or
391 saved for later use. It is harder to conduct science because it is
392 harder to repeat an experiment. The worst thing about using the
393 real world instead of a simulation is the matter of time. Instead
394 of simulated time you get the constant and unstoppable flow of
395 real time. This severely limits the sorts of software you can use
396 to program the AI because all sense inputs must be handled in real
397 time. Complicated ideas may have to be implemented in hardware or
398 may simply be impossible given the current speed of our
399 processors. Contrast this with a simulation, in which the flow of
400 time in the simulated world can be slowed down to accommodate the
401 limitations of the character's programming. In terms of cost,
402 doing everything in software is far cheaper than building custom
403 real-time hardware. All you need is a laptop and some patience.
335 404
336 ** Because of Time, simulation is perferable to reality 405 ** Because of Time, simulation is perferable to reality
337 406
407 I envision =CORTEX= being used to support rapid prototyping and
408 iteration of ideas. Even if I could put together a well constructed
409 kit for creating robots, it would still not be enough because of
410 the scourge of real-time processing. Anyone who wants to test their
411 ideas in the real world must always worry about getting their
412 algorithms to run fast enough to process information in real
413 time. The need for real time processing only increases if multiple
414 senses are involved. In the extreme case, even simple algorithms
415 will have to be accelerated by ASIC chips or FPGAs, turning what
416 would otherwise be a few lines of code and a 10x speed penality
417 into a multi-month ordeal. For this reason, =CORTEX= supports
418 /time-dialiation/, which scales back the framerate of the
419 simulation in proportion to the amount of processing each
420 frame. From the perspective of the creatures inside the simulation,
421 time always appears to flow at a constant rate, regardless of how
422 complicated the envorimnent becomes or how many creatures are in
423 the simulation. The cost is that =CORTEX= can sometimes run slower
424 than real time. This can also be an advantage, however ---
425 simulations of very simple creatures in =CORTEX= generally run at
426 40x on my machine!
427
338 ** Video game engines are a great starting point 428 ** Video game engines are a great starting point
429
430 I did not need to write my own physics simulation code or shader to
431 build =CORTEX=. Doing so would lead to a system that is impossible
432 for anyone but myself to use anyway. Instead, I use a video game
433 engine as a base and modify it to accomodate the additional needs
434 of =CORTEX=. Video game engines are an ideal starting point to
435 build =CORTEX=, because they are not far from being creature
436 building systems themselves.
437
438 First off, general purpose video game engines come with a physics
439 engine and lighting / sound system. The physics system provides
440 tools that can be co-opted to serve as touch, proprioception, and
441 muscles. Since some games support split screen views, a good video
442 game engine will allow you to efficiently create multiple cameras
443 in the simulated world that can be used as eyes.
339 444
340 ** Bodies are composed of segments connected by joints 445 ** Bodies are composed of segments connected by joints
341 446
342 ** Eyes reuse standard video game components 447 ** Eyes reuse standard video game components
343 448