Algoritmi ad apprendimento automatico Se si possiedono dei buoni modelli probabilistici che descrivano bene l informazione contenuta in un contesto biologico, è possibile far imparare le relazioni che il modello propone ad un computer. L applicazione pratica di questo concetto si ritrova in: 1- Hidden Markov Models 2- Reti neurali 3- Algoritmi genetici Proprio perchè oggi disponiamo di un gran numero di informazioni ma piuttosto disordinate, è possibile cercare di istruire un computer allo scopo di capire da solo le relazioni che intercorrono tra i vari elementi.
Reti neurali Sono circuiti di informazioni con una fissato numero di nodi (STATI) in cui immagazzinare le informazioni risultanti dalle varie interconnessioni ed una precisa ARCHITETTURA, cioè una struttura di interconnessione dei nodi. Se fornisco ad una rete neurale una informazione e il suo risultato (un TRAINING SET), gli stati memorizzano il modo di andare dall informazione al risultati sfruttando le interconnessioni. Ripetendo molte volte il training con set diversi ma ugualmente veri, alla fine la rete è in grado di arrivare da sola al risultato. Se fornisco alla rete una informazione con risultato incognito, essa risponderà con il risultato che per lei è appropriato, dato quello che ha imparato dai training set. es. Se io fornisco un numero di multiallineamenti esatti, la rete impara a multiallineare, e alla fine, data una serie di sequenze, sarà in grado di multiallinearle.
Neural Networks Neural Networks can be : Biological models Artificial models Desire to produce artificial systems capable of sophisticated computations similar to the human brain Compute a known function Approximate an unknown function Pattern Recognition Signal Processing Learn to do any of the above 14 dicembre Jens Meiler 3
Biological Neurons NEURON The cell that perform information processing in the brain Fundamental functional unit of all nervous system tissue We are born with about 100 billion neurons A neuron may connect to as many as 100,000 other neurons Signals move via electrochemical signals The synapses release a chemical transmitter the sum of which can cause a threshold to be reached causing the neuron to fire Synapses can be inhibitory or excitatory 14 dicembre Jens Meiler 4
Biological Neurons Each consists of : SOMA, DENDRITES, AXON, and SYNAPSE 14 dicembre Jens Meiler 5
Brain vs. Computer Computers require hundreds of cycles to simulate a firing of a neuron The brain can fire all the neurons in a single step: Parallelism Serial computers require billions of cycles to perform some tasks but the brain takes less than a second (e.g. face recognition) 14 dicembre Jens Meiler 6
Artificial Neuron = NODE Each neuron is connected to other nodes with an associated weight (strength) which typically multiplies the signal transmitted Each neuron has a single threshold value Weighted sum of all the inputs coming into the neuron is formed and the threshold is subtracted from this value = activation Activation signal is passed through an activation function (a.k.a. transfer function) to produce the output of the neuron weight 1 weight 2 weight 3 weight 4 Sum Activation Function Output 1.0 0.5 Sum 14 dicembre Jens Meiler 7
Artificial Neuron = NODE Definition of a node: A node is an element which performs the function y = f H ( (w i x i ) + W b ) 14 dicembre Jens Meiler 8
What is and Artificial Neural Network (ANN)? An interconnected assembly of simple processing elements, units, neurons or nodes, whose functionality is loosely based on the animal neuron The processing ability of the network is stored in the interunit connection strengths, or weights, obtained by a process of adaptation to, or learning from, a set of training patterns. A Neural Network is a system composed of many simple processing elements operating in parallel which can acquire, store, and utilize experiential knowledge 14 dicembre Jens Meiler 9
ANN Characteristics Basis: a crude low-level model of biological neural systems Powerful: capable of modeling very complex functions/relationships handles curse of dimensionality Ease of Use: learns the structure for you, i.e. avoids need for formulating rules user must deal with type of network, complexity, learning algorithms & inputs to use Architecture: the pattern of nodes and connections between them Learning algorithm, or training method: method for determining weights of the connections 14 dicembre Jens Meiler 10
ANN Architecture: Basic Concept A Neural Network generally maps a set of inputs to a set of outputs Number of inputs/outputs is variable The Network itself is composed of an arbitrary number of nodes with an arbitrary topology 14 dicembre Jens Meiler 11
ANN Architecture Connectivity: fully connected partially connected Feedback feedforward network: no feedback simpler, more stable, proven most useful recurrent network: feedback from output to input units complex dynamics, may be unstable Number of layers i.e. presence of hidden layers 14 dicembre Jens Meiler 12
Simple Perceptron: Architecture Binary logic application f H (x) = u(x) [linear threshold] W i = random(-1,1) Y = u(w 0 X 0 + W 1 X 1 + W b ) Now how do we train it? 14 dicembre Jens Meiler 13
Simple Perceptron: Basic Training Perception learning rule ΔW i = η * (D Y) * X i η = Learning Rate D = Desired Output Adjust weights based on a how well the current weights match an objective 14 dicembre Jens Meiler 14
Simple Perceptron: Logic Training Expose the network to the logical OR operation Update the weights after each epoch As the output approaches the desired output for all cases, ΔW i will approach 0 X 0 X 1 D 0 0 0 0 1 1 1 0 1 1 1 1 14 dicembre Jens Meiler 15
Simple Perceptron: Training Progress and Result W 0 W 1 W b 14 dicembre Jens Meiler 16
Simple Perceptron: Details Network converges on a hyper-plane decision surface X 1 = (W 0 /W 1 )X 0 + (W b /W 1 ) 14 dicembre Jens Meiler 17
Simple Perceptron with multiple Outputs? 14 dicembre Jens Meiler 18
Simple Perceptron: Limits Simple Perceptrons can only represent Linearly Separable Functions 0,1 1,1 0,1 1,1 0,0 AND AND 1,0 0,0 XOR XOR 1,0 14 dicembre Jens Meiler 19
Sigmoidal Activation Function F(x) = 1 / (1 + e -k (w ixi) ) Shown for k = 0.5, 1 and 10 Using a nonlinear function which approximates a linear threshold allows a network to approximate nonlinear functions 14 dicembre Jens Meiler 20
Alternative Activation Functions Radial Basis Functions Square Triangle Gaussian! 14 dicembre Jens Meiler 21
Feedforward, Fully-Connected with One Hidden Layer Connection Node Outputs Inputs Input Layer Hidden Layer Output Layer 14 dicembre Jens Meiler 22
Hidden Layer Layer of nodes between input and output nodes Allow a network to learn non-linear functions Allow the net to represent combinations of the input features 14 dicembre Jens Meiler 23
Types of ANNs Multilayer Perceptron Radial Basis Function Kohonen Demo Linear Hopfield Adaline/Madaline Probabilistic Neural Network (PNN) General Regression Neural Network (GRNN) and at least thirty others 14 dicembre Jens Meiler 24
Training Algorithms What it is: How the network learns the relationship between the inputs and outputs. Type of algorithm used depends on type of networkarchitecture, type of learning,etc. The most popularis Back Propagation modifications exist: quick prop, Delta-bar-Delta Others: Conjugate gradient descent, Levenberg-Marquardt, K-Means, Kohonen, standard pseudo-inverse (SVD) linear optimization 14 dicembre Jens Meiler 25
Training algorithm: Backpropagation of Errors Forward Pass: Error is calculated from outputs Used to update output weights Backward Pass: Error at hidden nodes is calculated by back propagating the error at the outputs through the new weights Hidden weights updated 14 dicembre Jens Meiler 26
Algoritmi genetici Se consideriamo un problema che ha una soluzione dipendente da n parametri e da k valori, una esplorazione completa richiede k n operazioni. Ma se noi sappiamo come si può evolvere il sistema (perchè abbiamo un training set o sappiamo le regole) per ricavare il risultato, sappiamo che alcuni passaggi non sono possibili o non si sono mai verificati, e sappiamo che ci sono percorsi che sono preferiti ad altri. Se l algoritmo viene modellato per rispettare gli schemi osservati e viene calcolata per ogni passaggio una FITNESS, cioè un valore di attendibilità, posso arrivare entro un certo numero di cicli ad avere un risultato che ha una fitness ottimale per le mie aspettative
posso simulare un crossing over tra due sequenze visto che so come il crossing over avviene. posso simulare la mutagenesi visto che conosco le frequenze di mutazioni e gli eventi mutageni che accadono cromosomi valutazione della fitness generazione selezione del cromosoma con fitness maggiore mutazione e crossing-over nuovi cromosomi sostituiscono i precedenti stop