Você está na página 1de 4

Overview

• Neural Networks (NN)


Neural Networks and Particle • Particle Swarm Optimizations (PSO)
Swarms • Training an NN using a PSO

By Jeremy Nunn

Neural Networks NN Background


• Artificial Neural Network (ANN or just NN) • Branch of artificial intelligence (or artificial life)
based on the human brain • Dates back to the 1940’s, McCulloch and Pitts
developed the first neural model [1]
• Connected nodes, like a graph • 1962, F. Rosenblatt develops the perceptron
• Takes some inputs, gives outputs model, which is useful for solving very simple
pattern classification problems
• Interest disappears in the 70’s
? • Since the 80’s, has seen renewed interest
because of better network designs, better
training algorithms, and faster hardware

Some NN Vocabulary NN Examples


• Neuron – a node in the network

• Activation value – the computed value of a


node, based on weighted inputs

• Threshold – the value that determines whether


a neuron will fire (pass its output onward)

• Training – the process of tuning the network by


adjusting the weights, the idea is to get better
results

1
NN Math Why use NNs?
• Looking at some neuron, U, and its threshold TU, we • Have been used in speech synthesis,
calculate the activation value AU as
diagnostic problems, computer vision
AU = w1Ux1 + w2Ux2 + … + wnUxn
• Can be used when a rule-based expert

n
= wiU xi
i =1 system would be too complicated to
where wij is the weight value of the edge from input i design
to neuron j. • Can be used to recognize complicated
• The neuron fires (output is 1.0) if AU > TU, usually patterns, even with noisy input
• Other activation functions exist, such as just allowing
the output to be AU, or mapping RÎR (i.e. sigmoid) • Can use parallel algorithms

Why use NNs? (con’t) Particle Swarm Optimization


• Ford Motor Co. used NNs to diagnose
engine malfunctions
• Boeing Aircraft Co. use NNs to find a best
match for manufacturing a new part, given
existing parts being manufactured [2]
• More stuff: sales forecasting, customer
research, risk management which includes
credit scoring and underwriting
Screen shot from the BOIDS simulation
found at [5].

PSO Background PSO Overview


• Developed in 1995 by Eberhart and • Each particle represents a solution
Kennedy • As the particles fly around the search
• Derived from models that simulate flocking space, they are evaluated (given a fitness)
and schooling (see boids and floys)
• They remember their best, and they are
• Similar to Genetic Algorithms and Ant
told their neighbors best. These two
Colony Optimizations
locations will influence their movement.
• In the category of ALife that uses
biological techniques to help solve
problems

2
PSO Algorithm PSO Algorithm
For each particle
• Velocity as Initialize particle
END
v v v v
v = v + c1 (r1 ⊗ ( pbest − present )) + c2 (r2 ⊗ ( gbest − present )) (1)
Do
For each particle
Calculate fitness value
where c1 and c2 are learning factors, and r1 If the fitness value is better than the best fitness value (pBest) in history set
current value as the new pBest
and r2 are vectors of random values End

between (0,1) Choose the particle with the best fitness value of all the particles as the gBest
For each particle
Calculate particle velocity according equation (1)
Update particle position according equation (2)
End
• Position as While maximum iterations or minimum error criteria is not attained
v
present = present + v (2)
[3]

PSO Tuning PSO Application


• There are a limited number of parameters that need to • Any function that you need to optimize
be tuned – Even with discontinuous surfaces [4]
• Number of particles
• Can be used in multi-objective, multi-constraint
• Maximum velocity
cases
• Learning factors
• Stop condition
• Evolving NNs
• Inertia weight • Functions where the optima move over time
• Many real-world problems
• Determined by the problem: – Reactive power and voltage control
• Particle dimension – Ingredient mix optimization
• Range – Pressure vessel design

Training a NN using a PSO Training a NN using PSO


• A NN’s effectiveness is in its weights
(assuming the topology is correct)
• Other methods exist to train NNs, but they
can be slow and/or difficult to implement
(GA’s, back-propagation, etc)

• How can we use a PSO to do this?

3
Training (con’t) My Project, Briefly
• Every edge (or weight) in the NN is an • Using a NN to classify songs into genres
element in our particle; if our NN has k • Training the NN on ~500 song samples, in
weights, our particles will have k
.wav format
dimensions
• The fitness value is how well the NN • Initial setup will use 5 outputs (genres)
performs on the test data • Once the NN gets all the test data right, try
• We run the PSO for a given number of non-test data
iterations or until a minimum error is • Compare the NN results with human
reached results to verify correctness

NN + PSO Uses in Games References


• NNs can be used in just about any game 1. Neural Networks,
http://uhavax.hartford.edu/compsci/neural-networks-
– Although other options may be better tutorial.html, Russell, Ingrid
• Card games 2. Neural Networks,
http://www.doc.ic.ac.uk/~nd/surprise_96/journal/vol4/cs
– My hand, opponent’s bet, time he took to act, 11/report.html, Stergiou, C., Siganos, D.
etc 3. Particle Swarm Optimization,
• Board games http://www.swarmintelligence.org
– Go, Chess, Tic-Tac-Toe 4. Particle Swarm Optimization, Kennedy, J., Eberhart,
R., Fromm Proc.IEEE Int’l Conf. on Neural Networks,
• Agent AI IEEE Service Center, Piscataway, NJ, IV:1942-1948
– FPS, RTS

References
5. Boids, http://www.red3d.com/cwr/boids,
Reynolds, Craig

Você também pode gostar