29
Intelligence Intelligence Musical and Otherwise Musical and Otherwise

Intelligence Musical and Otherwise. Huh? Huh? Webster’s definition Intelligence: The ability to reason

Embed Size (px)

Citation preview

Page 1: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

IntelligenceIntelligenceMusical and OtherwiseMusical and Otherwise

Page 2: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Huh?Huh?

Page 3: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Webster’s definitionWebster’s definition

Intelligence:Intelligence: The ability to reasonThe ability to reason

Page 4: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Webster’s definitionWebster’s definition

ReasonReason The capacity for intelligenceThe capacity for intelligence

Page 5: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

AI classAI class

LearnLearn, consciousness, , consciousness, sense of humorsense of humor, ,

understandingunderstanding, , lovelove, , creativitycreativity, , thinkthink, , imaginationimagination, , analysisanalysis, , logiclogic, , analogyanalogy, ,

associationassociation, , abstractionabstraction, , reasoningreasoning, , intuitionintuition, , dreamdream, , adaptadapt, , aware of deathaware of death, ,

memorymemory, , skill setskill set, , appreciateappreciate, ,

sacrificesacrifice, , controlcontrol, , winwin, , predictpredict, , crycry, , honorhonor, , computecompute, , suicidesuicide, , lielie, , inventinvent, , communicationcommunication, , converseconverse, , perceiveperceive

Page 6: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Our definition.Our definition.

1. Learn1. Learn 2. Reason2. Reason 3. Abstract3. Abstract

Page 7: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Enjoy?Enjoy?

Page 8: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

GAsGAs

Page 9: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Genetic AlgorithmsGenetic Algorithms Definition Definition a computer simulation in which a population of abstract representations a computer simulation in which a population of abstract representations

(called chromosomes, genotype, or genome) of candidate solutions (called (called chromosomes, genotype, or genome) of candidate solutions (called individuals, creatures, or phenotypes) to an optimization problem evolves individuals, creatures, or phenotypes) to an optimization problem evolves toward better solutions.toward better solutions.

BasicsBasics A genetic representation of the solution domain,A genetic representation of the solution domain, A fitness function to evaluate the solution domain.A fitness function to evaluate the solution domain.

Along the way Along the way crossover and mutationcrossover and mutation

Fitness testsFitness tests

Until Until a solution is found that satisfies minimum criteriaa solution is found that satisfies minimum criteria

Page 10: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason
Page 11: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Karl SimsKarl Sims

Evolved Virtual CreaturesEvolved Virtual Creatures Not an animationNot an animation Evolved objects in motionEvolved objects in motion Encased in various media (water, air, etc.)Encased in various media (water, air, etc.) With gravityWith gravity

Page 12: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Evolved Virtual CreaturesEvolved Virtual Creatures

Page 13: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

In lispIn lisp

Creating a very simple genetic algorithm for Creating a very simple genetic algorithm for producing melodies of a certain typeproducing melodies of a certain type

Page 14: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Step 1Step 1

1. program a class of objects that have music 1. program a class of objects that have music melodies as attributesmelodies as attributes

Page 15: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Step 2Step 2 2. create a whole bunch, say 100, of instances of this 2. create a whole bunch, say 100, of instances of this

object class (initial population)object class (initial population)

Page 16: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Step 3Step 3

3. give the objects a (fitness test) based on overall 3. give the objects a (fitness test) based on overall interval direction, say 9 [stop when fulfilled]interval direction, say 9 [stop when fulfilled]

Page 17: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Step 4Step 4

4. the ones closest survive (selection), the rest are 4. the ones closest survive (selection), the rest are discardeddiscarded

Page 18: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Step 5Step 5

5. the remaining ones (mate) 5. the remaining ones (mate)

Page 19: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Step 6Step 6

6. their offspring inherit (crossover) the general 6. their offspring inherit (crossover) the general shape of the parents combined melodiesshape of the parents combined melodies

Page 20: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Step 7Step 7

7. maybe a (mutation) creeps in7. maybe a (mutation) creeps in

Page 21: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Step 8Step 8

8. return to step 38. return to step 3

Page 22: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

1. program a class of objects that have music melodies as 1. program a class of objects that have music melodies as attributesattributes

2. create a whole bunch, say 100, of instances of this object 2. create a whole bunch, say 100, of instances of this object class (initial population)class (initial population)

3. give the objects a (fitness test) based on overall interval 3. give the objects a (fitness test) based on overall interval direction, say 9 [stop when fulfilled]direction, say 9 [stop when fulfilled]

4. the ones closest survive (selection), the rest are discarded4. the ones closest survive (selection), the rest are discarded

5. the remaining ones (mate) 5. the remaining ones (mate)

6. their offspring inherit (crossover) the general shape of the 6. their offspring inherit (crossover) the general shape of the parents combined melodiesparents combined melodies

7. maybe a (mutation) creeps in7. maybe a (mutation) creeps in

8. return to step 38. return to step 3

Page 23: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Variables Variables ;;;variables;;;variables

(defvar *mutation*(defvar *mutation* (defvar *allowable-deviation* (defvar *allowable-deviation*

Page 24: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

ObjectObject

;;;class of object with one attribute (a melody);;;class of object with one attribute (a melody)

(defclass individual ()(defclass individual () ((melody :initarg :melody :initform nil :accessor melody))((melody :initarg :melody :initform nil :accessor melody)) (:documentation "Our objects in the evolutionary potboiler."))(:documentation "Our objects in the evolutionary potboiler."))

Page 25: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Functions Functions ;;;functions;;;functions

(defun melody (defun melody

(defun fitness (defun fitness

(defun mate(defun mate

(defun inherit(defun inherit

(defun mutation (defun mutation

Page 26: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Top levelTop level ;;;top-level;;;top-level

(defun produce-crossover-melodies (defun produce-crossover-melodies

Page 27: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

MGCMGC ;;;use MGC to quickly turn into a midi file;;;use MGC to quickly turn into a midi file

(mgc "GA-1.mid" :ontimes '() :pitches '() :durations '() :channels '() :dynamics '())(mgc "GA-1.mid" :ontimes '() :pitches '() :durations '() :channels '() :dynamics '())

Page 28: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

(defvar *mutation*(defvar *mutation* (defvar *allowable-deviation* (defvar *allowable-deviation*

(defclass individual ()(defclass individual () ((melody :initarg :melody :initform nil :accessor melody))((melody :initarg :melody :initform nil :accessor melody)) (:documentation "Our objects in the evolutionary potboiler."))(:documentation "Our objects in the evolutionary potboiler."))

(setf i-1 (make-instance 'individual))(setf i-1 (make-instance 'individual))

(defun melody (defun melody

(defun fitness (defun fitness

(defun mate(defun mate

(defun inherit(defun inherit

(defun mutation (defun mutation

(defun produce-crossover-melodies (defun produce-crossover-melodies

(mgc "GA-1.mid" :ontimes '() :pitches '() :durations '() :channels '() :dynamics '())(mgc "GA-1.mid" :ontimes '() :pitches '() :durations '() :channels '() :dynamics '())

Page 29: Intelligence Musical and Otherwise.  Huh? Huh? Webster’s definition  Intelligence:  The ability to reason

Interesting Music? Interesting Music?

Example Example