genetic programming system for music generation with automated fitness raters

18
Genetic Programming System for Music Generation With Automated Fitness Raters

Upload: jean-bailey

Post on 24-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Genetic Programming System for Music Generation With Automated Fitness Raters

Genetic Programming

System for Music GenerationWith Automated Fitness Raters

Page 2: Genetic Programming System for Music Generation With Automated Fitness Raters

What is Genetic Programming(GP)?

• an evolutionary algorithm-based methodology inspired by biological evolution

• New generation of solutions created from previous generations

• Three Steps:o Mutation: change random bitso Crossover: exchange parts of two parentso Selection: get rid of bad examples

Page 3: Genetic Programming System for Music Generation With Automated Fitness Raters

An Example: 8-Queen Problem

Page 4: Genetic Programming System for Music Generation With Automated Fitness Raters

Fitness Function: How good is each string? In this case, it depends on the number of non-attacking

pairs of queens. Selection:

Choose parents randomly according to fitness function Crossover:

Make new children from parents Choose a cut-point, swap halves

Mutation Change random bits with low probability

Page 5: Genetic Programming System for Music Generation With Automated Fitness Raters

Back to the GP-Music System

An interactive system which allows users to evolve short musical sequences.

Focus on creating short melodic sequences. Does not attempt to evolve polyphony or the

actual wave forms of the instruments. Create only a set of notes and pauses. Use XM format - store musical pieces rather than

straight digital audio

Page 6: Genetic Programming System for Music Generation With Automated Fitness Raters

Function and Terminal Sets

• Function Set: play_two(2 arguments),add_space(1 argument), play_twice(1 argument),shift_up(1 argument), shift_down(1 argument), mirror(1 argument), play_and_mirror(1 argument)

• Terminal Set: o Notes: C-4, C#4, D-4, D#4, E-4, F-4, F#4, G-4, G#4, A-5, A#5, B-5

• Pseudo-Chords:o C-Chord, D-Chord, E-Chord, F-Chord, G-Chord, A-Chord, B-Chord

• Other: RST (used to indicates one beat without a note)

Page 7: Genetic Programming System for Music Generation With Automated Fitness Raters

Function and Terminal Sets Cont.

Pseudo-Chord Corresponding Note Sequence

C-Chord C-4, E-4, G-4

D-Chord D-4, F#4, A-5

E-Chord E-4, G#4, B-5

F-Chord F-4, A-5, C-5

G-Chord G-4, B-5, D-5

A-Chord A-5, C#5, E-5

B-Chord B-5, D#5, F#5

Page 8: Genetic Programming System for Music Generation With Automated Fitness Raters

Sample Music ProgramInterpreter:(shift-down (add-space (play-and-mirror (play-two (play-two (play-two (play-two B-5 B-5) (shift-down A-5)) (shift-down A-5)) F-4))))A-5,RST,A-5,RST,F-4,RST,F-4,RST,E-4,RST,E-4,RST,F-4,RST,F-4,RST,A-5,RST,A-5,RST

shift-downadd-

spaceB-5,RST,B-5,RST,G-4,RST,G-4,RST,F-4,RST,F-4,RST,G-4,RST,G-4,RST,B-5,RST,B-5,RST

play-and-mirror

B-5,B-5,G-4,G-4,F-4,F-4,G-4,G-4,B-5,B-5

play-twoB-5,B-5,G-4,G-4,F-4

play-two F-4

play-two

shift-down

B-5,B-5,G-4,G-4

B-5,B-5,G-4

play-two

B-5

B-5

B-5,B-5 A-5

shift-down

A-5

Each node in the tree propagates up a musical note string, which is then modified by the next higher node. In this way a complete sequence of notes is built up, and the final string is returned by the root node.

Page 9: Genetic Programming System for Music Generation With Automated Fitness Raters

Fitness Selection

A human using the system is asked to rate the musical sequences that are created for each generation of the GP process.

Page 10: Genetic Programming System for Music Generation With Automated Fitness Raters

User Bottleneck A user can only rate a small number of sequences

in a sitting, limiting the number of individuals and generations that can be used.

The GP-Music System takes rating data from a users run and uses it to train a neural network based automatic rater.

Page 11: Genetic Programming System for Music Generation With Automated Fitness Raters

Neural Networks• A trainable mathematical model for finding

boundaries• Inspired by biological neurons

o Neurons collect input from receptors, other neuronso If enough stimulus collected, the neuron fires

• Inputs in artificial neurons are variables, outputs of other neurons

• Output is an “activation” determined by the weighted inputs

Page 12: Genetic Programming System for Music Generation With Automated Fitness Raters

Back Propagation Algorithm

We have some error and we want to assign “blame” for it proportionally to the various weights in the network

We can compute the error derivative for the last layer

Then, distribute “blame” to previous layer

Page 13: Genetic Programming System for Music Generation With Automated Fitness Raters

Backprop Trainingo Start with random weights o Run the network forward o Calculate the error based on outputs o Propagate the error backward o Update the weights o Repeat with next training example until you stop

improving o Cross validation data is very important here

Page 14: Genetic Programming System for Music Generation With Automated Fitness Raters

each lower level node affectstwo upper level nodes

each of the top level nodes has ‘Level Spread’ connections to lower nodes. The weights on these connections are all shared, so the weight on the first input to each upper level node is identical

Page 15: Genetic Programming System for Music Generation With Automated Fitness Raters

Auto Rater Runs• The weights and biases for the auto-rater network

trained for 850 cycles were used in several runs of the GP-Music System.

• To evaluate how well the auto-rater works in larger runs, runs with 100 and 500 sequences per generation over 50 generations were made. The resulting best individuals are shown in the next slide

Page 16: Genetic Programming System for Music Generation With Automated Fitness Raters

50 Generations, 100 individuals per Generation

50 Generations, 500 individuals per Generation

Page 17: Genetic Programming System for Music Generation With Automated Fitness Raters

Future Work• it would be interesting to analyze the weights

which are being learned by the network to see what sort of features it is looking for

• It may also be possible to improve the structure of the auto raters themselves by feeding them extra information, or modifying their topology

Page 18: Genetic Programming System for Music Generation With Automated Fitness Raters

Reference

Brad Johanson - Stanford UniversityRains Apt. 9A704 Campus Dr.Stanford, CA. [email protected]

Riccardo Poli - University of BirminghamSchool of Computer ScienceThe University of BirminghamBirmingham B15 [email protected]

The research is done by