EE 193/Comp 150 Computing with Biological Parts

Slides:



Advertisements
Similar presentations
Artificial Intelligence 12. Two Layer ANNs
Advertisements

Slides from: Doug Gray, David Poole
Learning in Neural and Belief Networks - Feed Forward Neural Network 2001 년 3 월 28 일 안순길.
1 Machine Learning: Lecture 4 Artificial Neural Networks (Based on Chapter 4 of Mitchell T.., Machine Learning, 1997)
Introduction to Training and Learning in Neural Networks n CS/PY 399 Lab Presentation # 4 n February 1, 2001 n Mount Union College.
Artificial Neural Networks ECE 398BD Instructor: Shobha Vasudevan.
1 Chapter 11 Neural Networks. 2 Chapter 11 Contents (1) l Biological Neurons l Artificial Neurons l Perceptrons l Multilayer Neural Networks l Backpropagation.
Slide 1 EE3J2 Data Mining EE3J2 Data Mining Lecture 15: Introduction to Artificial Neural Networks Martin Russell.
Artificial Neural Networks
CS 4700: Foundations of Artificial Intelligence
Neural Networks. Background - Neural Networks can be : Biological - Biological models Artificial - Artificial models - Desire to produce artificial systems.
Traffic Sign Recognition Using Artificial Neural Network Radi Bekker
Artificial Neural Nets and AI Connectionism Sub symbolic reasoning.
Neural Networks AI – Week 23 Sub-symbolic AI Multi-Layer Neural Networks Lee McCluskey, room 3/10
Introduction to Artificial Neural Network Models Angshuman Saha Image Source: ww.physiol.ucl.ac.uk/fedwards/ ca1%20neuron.jpg.
1 Machine Learning The Perceptron. 2 Heuristic Search Knowledge Based Systems (KBS) Genetic Algorithms (GAs)
LINEAR CLASSIFICATION. Biological inspirations  Some numbers…  The human brain contains about 10 billion nerve cells ( neurons )  Each neuron is connected.
Artificial Intelligence Lecture No. 29 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Artificial Neural Networks. The Brain How do brains work? How do human brains differ from that of other animals? Can we base models of artificial intelligence.
1 Chapter 11 Neural Networks. 2 Chapter 11 Contents (1) l Biological Neurons l Artificial Neurons l Perceptrons l Multilayer Neural Networks l Backpropagation.
ADVANCED PERCEPTRON LEARNING David Kauchak CS 451 – Fall 2013.
CSC321 Introduction to Neural Networks and Machine Learning Lecture 3: Learning in multi-layer networks Geoffrey Hinton.
Perceptrons Gary Cottrell. Cognitive Science Summer School 2 Perceptrons: A bit of history Frank Rosenblatt studied a simple version of a neural net called.
Image Source: ww.physiol.ucl.ac.uk/fedwards/ ca1%20neuron.jpg
COSC 4426 AJ Boulay Julia Johnson Artificial Neural Networks: Introduction to Soft Computing (Textbook)
1 Perceptron as one Type of Linear Discriminants IntroductionIntroduction Design of Primitive UnitsDesign of Primitive Units PerceptronsPerceptrons.
Artificial Intelligence CIS 342 The College of Saint Rose David Goldschmidt, Ph.D.
Bab 5 Classification: Alternative Techniques Part 4 Artificial Neural Networks Based Classifer.
Machine Learning Artificial Neural Networks MPλ ∀ Stergiou Theodoros 1.
Artificial Neural Networks This is lecture 15 of the module `Biologically Inspired Computing’ An introduction to Artificial Neural Networks.
Learning: Neural Networks Artificial Intelligence CMSC February 3, 2005.
Multinomial Regression and the Softmax Activation Function Gary Cottrell.
Learning with Neural Networks Artificial Intelligence CMSC February 19, 2002.
Today’s Lecture Neural networks Training
Fundamental ARTIFICIAL NEURAL NETWORK Session 1st
Neural networks and support vector machines
Bayesian Neural Networks
Neural Networks.
Artificial Neural Networks
Other Classification Models: Neural Network
Learning with Perceptrons and Neural Networks
Artificial Intelligence (CS 370D)
Artificial neural networks:
Other Classification Models: Neural Network
Real Neurons Cell structures Cell body Dendrites Axon
Announcements HW4 due today (11:59pm) HW5 out today (due 11/17 11:59pm)
Classification with Perceptrons Reading:
with Daniel L. Silver, Ph.D. Christian Frey, BBA April 11-12, 2017
Artificial Neural Networks
Machine Learning Today: Reading: Maria Florina Balcan
CSC 578 Neural Networks and Deep Learning
Data Mining with Neural Networks (HK: Chapter 7.5)
Logistic Regression & Parallel SGD
OVERVIEW OF BIOLOGICAL NEURONS
of the Artificial Neural Networks.
Perceptron as one Type of Linear Discriminants
network of simple neuron-like computing elements
What is an artificial neural network?
Artificial Intelligence Lecture No. 28
Capabilities of Threshold Neurons
Lecture Notes for Chapter 4 Artificial Neural Networks
Artificial Intelligence 12. Two Layer ANNs
EE 194 Advanced VLSI Spring 2018 Tufts University
COSC 4335: Part2: Other Classification Techniques
Computer Vision Lecture 19: Object Recognition III
EE 193: Parallel Computing
Seminar on Machine Learning Rada Mihalcea
David Kauchak CS158 – Spring 2019

CSC 578 Neural Networks and Deep Learning
Presentation transcript:

EE 193/Comp 150 Computing with Biological Parts Spring 2019 Tufts University Instructor: Joel Grodstein joel.grodstein@tufts.edu Neural nets

EE 155 / Comp 122 Joel Grodstein What is a neural net? Neural net (NN): a specific computing architecture modeled after the human brain The human brain is really, really good at recognizing and classifying patterns both visual and audio not surprisingly, so are NNs a “simple” task, like recognizing handwritten digits is actually really hard for a computer – unless you’re using a NN EE 155 / Comp 122 Joel Grodstein

The human brain synapse The brain is built from 100B neurons. Each dendrite takes inputs from 1000 other neurons and decides when to fire Each input pulse raises or lowers Vmem slightly; when we hit a threshold the neuron generates a spike EE 194/Bio 196 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein 100B neurons is a very big interconnected network Each neuron fires at various times; affects when its downstream neurons fire The human brain is very efficient and powerful machine It’s traditionally been better at (e.g.,) image classification than any computer Except… neural nets, modeled after the brain, now work quite well The most obvious way to build a neural net: spiking neural net (SNN) It’s “just like a brain” Why might that be easier said than done? One “small” problem in building a neural net like a brain: We understand the low-level neuron implementation reasonably well – but the high level is (yet another) mystery. E.g., … EE 155 / Comp 122 Joel Grodstein

How do we represent a number? Say we want to use neurons to add two numbers First question: how do we represent a number? big little Frequency? Period? Space between two edges? Use multiple neurons like binary? SNN designers have tried all the above Mostly unsure how the human nervous system works EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein This is a problem! It would be nice to know how the brain represents data. Without that… Makes it hard to design a SNN Human brain is about 12 Watts SNNs are, like brains, very energy efficient But hard to design Makes it hard to design electroceuticals Which neurons should you stimulate? For now it’s somewhat trial & error Yet another problem… EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein A brain can compute most anything The trick is the weights and connections Change them, and we compute something completely different Problem: we don’t really know how the brain alters them! Some reasonable hypotheses And this is where we stood – until ANNs EE 155 / Comp 122 Joel Grodstein

Artificial neural network Each node represents a number Very simple solution to “how do you represent a number?”  Compute each node as a weighted sum z=w1in1+w2in2+… every arrow has a weight Followed by an activation function e.g., out = (z>.5? 1 : .3) sort of the analog of a single biological neuron Each vertical slice is a layer Deep neural net has lots of layers EE 155 / Comp 122 Joel Grodstein

Artificial neural network We had two big problems: Which neurons are connected to which? Each layer is fully connected What are the weights? We will soon learn about training… but first, an example EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Some logic functions 1 1 X 1 X=0,Y=0: 1*0 + 1*0 = 0, 0>1.50 X=0,Y=1: 1*0 + 1*1 = 1, 1>1.50 X=1,Y=1: 1*1 + 1*1 = 2, 2>1.51 X AND Y Y >1.5 1 1 1 X 1 X=0,Y=0: 1*0 - 1*0 = 0, 0>.50 X=1,Y=0: 1*1 - 1*0 = 1, 1>.51 X=0,Y=1: 1*0 - 1*1 = -1, -1>.50 X AND Y Y >0.5 -1 Can you design an XOR gate? True if X AND Y 𝑂𝑅 X AND Y You will need multiple neurons EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Inference output input Let this be an ANN to recognize a single number Input could be a 35 nodes of 1=black, 0=white (I only drew 3 inputs to save space) Assume we know all of the weights (we’re fully trained) Propagate it through the network (inference) Again: each node is a weighted sum z=w1in1+w2in2+…, and the activation function And then you get to the output Probably we would have 10 output neurons (for the digits 0-9) The output pattern (.1, .9, .2, .1, 0, .2, .1, .1, 0, .2)  the digit “1” EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Activation function output input Without the activation functions, each node would just implement z=w1in1+w2in2+… Could such a network do anything interesting? This is a linear function A composition of linear functions is itself linear The entire network would reduce to a single linear function – not real useful! Activation function at each node makes the NN useful  EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Activation function Simplest activation function: a perceptron output = 𝑖𝑛𝑝𝑢𝑡𝑠 𝑖 𝑤 𝑖 𝑥 𝑖 > threshold? 1 : 0 You can build most anything with enough perceptrons We built logic gates But they’re not really used, because of that little problem: how do you compute the weights fast? EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Training Each node: a weighted sum z=w1in1+w2in2+… every arrow has a weight Practical ANNs have lots of weights. Where do they come from? Training. It’s why, for a long time, NNs “didn’t work.” Nobody knew how to figure out the best weights for a task The same architecture, with different weights, will perform a completely different task The training task (example) Input: a single handwritten digit Output: the weights to best recognize the digit EE 155 / Comp 122 Joel Grodstein

Stochastic gradient descent Get a whole bunch of examples Define a cost function Average, over all the examples, of how close your ANN gets to the right answer Here’s a cost function for just two weights High cost = high altitude Stochastic gradient descent Pick a random initial set of weights roughly compute which way is downhill take a step in that direction you’ll occasionally go in a bad direction; that’s OK tends to work well even if there are multiple valleys EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Perceptrons sum > .7? 1 : 0 do not make a nice landscape which way is downhill? Better choices: sigmoid ReLU EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Learning Stochastic gradient descent works quite well for ANNs That’s why almost all commercial NNs are ANNs No equally good method for SNNs We don’t really know how a brain learns EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Summary What do we want to build? Neurons: to understand the brain, and electroceuticals ANNs: morphogenesis and synthetic bio What we’ll learn Bioelectricity 2: the basics of neurons Lab #2: build a baby neuron Joel/Imran: electroceuticals Lab #3: build a small, chintzy ANN Potential final projects: build a bigger ANN, or a better one report out on electroceuticals, or efficiency of some NNs EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Backup EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein References: http://neuralnetworksanddeeplearning.com , by Michael Nielsen EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein Start with a set of NT training examples; i.e., a bunch of pixel arrays for which you know which number it’s meant to be a picture of. Our goal: pick the set of weights that minimize the cost function 𝐶≡ 1 𝑁 𝑇 𝑖=1 𝑁 𝑇 𝑦 𝑖 −𝑁𝑁 𝑦 𝑖 , where xi are the training images, yi is the desired output vector for image xi, NN(x) is our neural network, and the weights are what personalize NN to be a particular neural network. EE 155 / Comp 122 Joel Grodstein

EE 155 / Comp 122 Joel Grodstein We usually use a form of steepest-descent algorithm (show a 3D picture), where as usual: start with some initial set of weights w0 find the gradient ∇Cost; i.e., 𝜕𝐶 𝜕 𝑤 1 , 𝜕𝐶 𝜕 𝑤 2 ,⋯ pick some learning rate η set w1=w0-η∇Cost (i.e., walk in the direction of the gradient, so as to maximally decrease our cost) EE 155 / Comp 122 Joel Grodstein