1 of 87

NEU 314: Mathematical Tools for Neuroscience

Instructor: Sam Nastase

Princeton Neuroscience Institute

Fall, 2022

2 of 87

NEU 314: Mathematical Tools for Neuroscience

Instructor: Sam Nastase*

Princeton Neuroscience Institute

Fall, 2022

* many slides adapted from Jonathan Pillow’s NEU 314 materials!

3 of 87

Who we are

Instructor: Sam Nastase (snastase@princeton.edu)

Office hours: Tuesday 3pm and by appointment (PNI 238E)

AIs:

Rober Boshra (rboshra@princeton.edu)

Zaid Zada (zzada@princeton.edu)

Wayan Gauthey (wgauthey@princeton.edu)

David Allen (da9769@princeton.edu)

4 of 87

Course description

This course introduces students to the mathematical tools at the core of computational neuroscience research. The course aims to familiarize students with topics in linear algebra, statistics, and machine learning, with a heavy emphasis on applications to neurobiology. Lectures on each topic will develop the relevant mathematical background with links to foundational applications in the field. Coursework will focus primarily on problem sets requiring the implementation of models and analyses in Python. The course will equip students with a practical proficiency in various computational methods, including programming skills in data analysis and visualization that are increasingly important to scientific inquiry in general, and neuroscience in particular.

Course website: https://snastase.github.io/teaching/neu314

5 of 87

Prerequisites

Working knowledge of high-school mathematics is required.

Experience with programming is helpful but not required. Python will be introduced in the early lab sessions.

6 of 87

Course format

Two ~1.5-hour lectures per week:

Tuesdays and Thursdays, 1:30–2:50 pm, Jadwin A06

One 3-hour computer labs per week:

B01: Tu, 7:30–10:20 pm, PNI A02, David Allen

B02: W, 1:30–4:20 pm, PNI A02, Wayan Gauthey

B03: F, 1:30–4:20 pm, PNI A02, Zaid Zada

B04: Th, 7:30–10:20 pm, PNI A02, Rober Boshra

Typically one homework assignment every other week comprising programming and math exercises.

Each Thursday lecture will begin with a short quiz.

Students will complete a take-home final exam at the end of the term.

7 of 87

Grading

Homework: 60%

Quizzes: 10%

Participation: 10%

Take-home final exam: 20%

8 of 87

Homework

Homework problem sets will consist primarily of Python programming exercises, as well as some pencil-and-paper math problems.

The goal of these assignments is to put mathematical concepts from class into practice. Writing computer programs to test or implement mathematical concepts provides a deeper form of understanding. These programming exercises will serve as prototypes for data analysis problems in real-world neuroscience research.

All homework assignments will be submitted as Jupyter Notebooks using Google Colab. Use LaTeX/Markdown within the notebook to answer pencil-and-paper math problems. Each homework assignment will be counted equally, so the homework grade will be the average over all assignments.

9 of 87

Quizzes

Thursday lectures will begin with a 5-minute quiz on previous material. The quizzes should be easy for students who have followed recent lectures and completed previous homework assignments.

The goal of these quizzes is to ensure that students have an active grasp of key concepts, without assistance from AIs or fellow students.

The three lowest quiz scores will be dropped when determining grades. No make-up quizzes will be permitted; students who miss a lecture can count the missed quiz among their three lowest scores.

10 of 87

Labs

The primary focus of labs will be to work on the homework problem sets. The AI will begin each lab with a brief overview and field any questions about lecture material. The AI may provide some warm-up problems, but otherwise you’ll be free to work on the homework problem sets individually or in collaboration with other students.

There will be no write-ups or additional assignments associated with labs, but attendance is mandatory: this is your chance to get to know fellow students and get one-on-one help from your AI. Attendance will be taken at lab sessions and count toward your participation grade.

11 of 87

Participation

Participation in class, lab sessions, and online on Ed is

strongly encouraged. Remember that if you have a question, other people probably have the same question!

12 of 87

Collaboration and academic integrity

You are strongly encouraged to work together on problem sets, but the work you submit should be uniquely your own, by your own hand. Transparency and “showing your work” are core pillars of ethical scientific research. Students should understand every step of their code such that they could implement it again without help.

13 of 87

Python

All homework problem sets will require programming in Python, and learning basic scientific computing in Python will be one of the core goals of early lab sessions. We’ll use Jupyter Notebooks in Google Colab, which allows you to edit code in the browser and run it on the cloud.

For more information, see the “Welcome to Colaboratory” notebook: https://colab.research.google.com/notebooks/intro.ipynb

14 of 87

Python

If you want to run Python locally, work with your AI to set up a dedicated conda environment for this class.

# download and install miniconda on Linux (or Windows Subsystem for Linux)

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

bash Miniconda3-latest-Linux-x86_64.sh

source ~/.bashrc

# create a conda environment and install python software

conda create -n neu314

conda install python numpy scipy matplotlib jupyter

# download and install miniconda on MacOSX

curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh

bash Miniconda3-latest-MacOSX-x86_64.sh

source ~/.bash_profile

15 of 87

16 of 87

What is computational neuroscience?

17 of 87

18 of 87

Sensory transduction

Motor reflexes

Autonomic regulation

Multimodal perception

Saliency and attention

Complex motor behavior

Memory

Language production/comprehension

Social cognition

19 of 87

What is computational neuroscience?

20 of 87

What is computational neuroscience?

Hodgkin & Huxley, 1952

21 of 87

What is computational neuroscience?

“When an axon of cell A is near enough to excite cell B and repeatedly or persistently takes part in firing it, some growth process or metabolic change takes place in one or both cells such that A's efficiency, as one of the cells firing B, is increased.”

Hebb, 1949

22 of 87

What is computational neuroscience?

“When an axon of cell A is near enough to excite cell B and repeatedly or persistently takes part in firing it, some growth process or metabolic change takes place in one or both cells such that A's efficiency, as one of the cells firing B, is increased.”

Hebb, 1949

23 of 87

What is computational neuroscience?

“Sensory relays recode sensory messages so that their redundancy is reduced but comparatively little information is lost.”

Attneave, 1954

Barlow, 1961

24 of 87

25 of 87

What is computational neuroscience?

Hubel & Wiesel, 1959, 1962, 1968

26 of 87

What is computational neuroscience?

Hubel & Wiesel, 1959, 1962, 1968

27 of 87

What is computational neuroscience?

Hubel & Wiesel, 1959, 1962, 1968

28 of 87

What is computational neuroscience?

Riesenhuber & Poggio, 1999

Felleman & Van Essen, 1991

29 of 87

30 of 87

31 of 87

32 of 87

33 of 87

34 of 87

35 of 87

36 of 87

37 of 87

38 of 87

39 of 87

40 of 87

Marr, 1982

What is computational neuroscience?

“But somewhere underneath, something was going wrong. The initial discoveries of the 1950s and 1960s were not being followed by equally dramatic discoveries in the 1970s. None of the new studies succeeded in elucidating the function of the visual cortex.”

“The key observation is that neurophysiology and psychophysics have as their business to describe the behavior of cells or of subjects but not to explain such behavior. What are the visual areas of the cerebral cortex actually doing? What are the problems in doing it that need explaining, and at what level of description should such explanations be sought?”

41 of 87

Computational theory

Representation and algorithm

Hardware implementation

What is the goal of the computation, why is it appropriate, and what is the logic of the strategy by which it can be carried out?

How can this computational theory be implemented? In particular, what is the representation for the input and output and what is the algorithm for the transformation?

How can the representation and algorithm be realized physically?

Figure 1–4. The three levels at which any machine carrying out an information- processing task must be understood.

Marr, 1982

What is computational neuroscience?

42 of 87

Computational theory

Representation and algorithm

Hardware implementation

What is the goal of the computation, why is it appropriate, and what is the logic of the strategy by which it can be carried out?

How can this computational theory be implemented? In particular, was is the representation for the input and output and what is the algorithm for the transformation?

How can the representation and algorithm be realized physically?

Figure 1–4. The three levels at which any machine carrying out an information- processing task must be understood.

Marr, 1982

“Vision is therefore, first and foremost, an information-processing task, but we cannot think of it just as a process. For if we are capable of knowing what is where in the world, our brains must somehow be capable of representing this information—in all its profusion of color and form, beauty, motion and detail.”

What is computational neuroscience?

43 of 87

Marr, 1982

Computational theory

Representation and algorithm

Hardware implementation

What is the goal of the computation, why is it appropriate, and what is the logic of the strategy by which it can be carried out?

How can this computational theory be implemented? In particular, was is the representation for the input and output and what is the algorithm for the transformation?

How can the representation and algorithm be realized physically?

Figure 1–4. The three levels at which any machine carrying out an information- processing task must be understood.

Marr, 1982

“Vision is therefore, first and foremost, an information-processing task, but we cannot think of it just as a process. For if we are capable of knowing what is where in the world, our brains must somehow be capable of representing this information—in all its profusion of color and form, beauty, motion and detail.”

What is computational neuroscience?

44 of 87

Computational theory

Representation and algorithm

Hardware implementation

What is the goal of the computation, why is it appropriate, and what is the logic of the strategy by which it can be carried out?

How can this computational theory be implemented? In particular, was is the representation for the input and output and what is the algorithm for the transformation?

How can the representation and algorithm be realized physically?

Figure 1–4. The three levels at which any machine carrying out an information- processing task must be understood.

Marr, 1982

“Vision is therefore, first and foremost, an information-processing task, but we cannot think of it just as a process. For if we are capable of knowing what is where in the world, our brains must somehow be capable of representing this information—in all its profusion of color and form, beauty, motion and detail.”

What is computational neuroscience?

Marr, 1982

45 of 87

Computational theory

Representation and algorithm

Hardware implementation

What is the goal of the computation, why is it appropriate, and what is the logic of the strategy by which it can be carried out?

How can this computational theory be implemented? In particular, was is the representation for the input and output and what is the algorithm for the transformation?

How can the representation and algorithm be realized physically?

Figure 1–4. The three levels at which any machine carrying out an information- processing task must be understood.

Marr, 1982

“Vision is therefore, first and foremost, an information-processing task, but we cannot think of it just as a process. For if we are capable of knowing what is where in the world, our brains must somehow be capable of representing this information—in all its profusion of color and form, beauty, motion and detail.”

What is computational neuroscience?

Marr, 1982

46 of 87

Marr, 1982

What is computational neuroscience?

Ecological psychology

“The affordances of the environment are what it offers the animal, what it provides or furnishes, either for good or ill… The perceiving of an affordance is not a process of perceiving a value-free physical object to which meaning is somehow added in a way that no one has been able to agree upon; it is a process of perceiving a value-rich ecological object. Any substance, any surface, any layout has some affordance for benefit or injury to someone. Physics may be value-free, but ecology is not.”

Gibson, 1979

Control theory

“Why do we and other animals have brains? Now you may reason that we have one to perceive the world or to think, and that’s completely wrong. We have a brain for one reason and one reason only, and that’s to produce adaptable and complex movements.”

Wolpert, 2011

47 of 87

Marr, 1982

“Computational neuroscience is an approach to understanding the information content of neural signals by modeling the nervous system at many different scales, including the biophysical, the circuit, and the systems levels.”

What? “Descriptive models summarize large amounts of experimental data compactly yet accurately, thereby characterizing what neurons and neural circuits do.”

How? “Mechanistic models address the question of how nervous systems operate on the basis of known anatomy, physiology, and circuitry.”

Why? “Interpretive models use computational and information-theoretic principles to explore the behavioral and cognitive significance of various aspects of nervous system function.”

What is computational neuroscience?

Sejnowski & Poggio

Dayan & Abbott, 2001

48 of 87

Marr, 1982

“What is being modeled by a computer [the brain] is itself a kind of computer, albeit one quite unlike the serial, digital machines on which computer science cut its teeth. That is, nervous systems and probably parts of nervous systems are themselves naturally evolved computers

—organically constituted, analog in representation, and parallel in their processing architecture.”

What is computational neuroscience?

Patricia Churchland

Churchland & Sejnowski, 1992

49 of 87

Marr, 1982

“What is being modeled by a computer [the brain] is itself a kind of computer, albeit one quite unlike the serial, digital machines on which computer science cut its teeth. That is, nervous systems and probably parts of nervous systems are themselves naturally evolved computers

—organically constituted, analog in representation, and parallel in their processing architecture.”

What is computational neuroscience?

Patricia Churchland

Churchland & Sejnowski, 1992

50 of 87

Marr, 1982

“What is being modeled by a computer [the brain] is itself a kind of computer, albeit one quite unlike the serial, digital machines on which computer science cut its teeth. That is, nervous systems and probably parts of nervous systems are themselves naturally evolved computers

—organically constituted, analog in representation, and parallel in their processing architecture.”

What is computational neuroscience?

Patricia Churchland

Churchland & Sejnowski, 1992

Jonas & Kording, 2017

51 of 87

What is computational neuroscience?

Our working definition…

Computational neuroscience is the enterprise of quantitatively modeling neural activity—the information content and algorithmic operations of the nervous system—given an organism’s sensory input, behavioral output, internal states, and relationship to its environment.

52 of 87

What is computational neuroscience?

Our working definition…

Computational neuroscience is the enterprise of quantitatively modeling neural activity—the information content and algorithmic operations of the nervous system—given an organism’s sensory input, behavioral output, internal states, and relationship to its environment.

We can learn something about the scope and geography of computational neuroscience by exploring some of the intersecting dialectics that drive the field…

53 of 87

Symbolic vs. connectionist computing

54 of 87

Symbolic vs. connectionist computing

Chomsky, 1957, 1965

Fodor, 1975, 1983

Baddeley & Hitch, 1974

55 of 87

Symbolic vs. connectionist computing

Rumelhart, McClelland, & PDP Group, 1987

56 of 87

Symbolic vs. connectionist computing

57 of 87

Krizhevsky et al., 2012

Symbolic vs. connectionist computing

58 of 87

Symbolic vs. connectionist computing

Vaswani et al., 2017

59 of 87

Symbolic vs. connectionist computing

McClelland et al., 2010

Griffiths et al., 2010

60 of 87

Nativism vs. learning

61 of 87

Nativism vs. learning

Spelke et al., 1992

Pinker et al., 1994

Elman et al., 1996

Hasson et al., 2020

62 of 87

Localized vs. distributed processing

63 of 87

Localized vs. distributed processing

Kanwisher et al., 1997, 2010

64 of 87

Localized vs. distributed processing

Haxby et al., 2001

65 of 87

Georgopoulos et al., 1986

Hinton et al., 1986

66 of 87

Georgopoulos et al., 1986

Mikolov et al., 2013

67 of 87

Explanation vs. prediction

68 of 87

Explanation vs. prediction

Breiman, 2001

Shmueli, 2010

Yarkoni & Westfall, 2017

Varoquaux & Poldrack, 2019

69 of 87

Encoding vs. decoding

70 of 87

Encoding vs. decoding

encoding

predicting brain activity from external stimuli or behavior

decoding

predicting external stimuli or behavior from brain activity

71 of 87

Experimental control vs. ecological validity

72 of 87

Experimental control vs. ecological validity

“We can rightfully claim to understand only 10% to 20% of how V1 actually operates under normal conditions.”

Olshausen & Field, 1999

73 of 87

Experimental control vs. ecological validity

“Ecological validity”—coined by Egon Brunswik in 1947

Egon Brunswik

74 of 87

Experimental control vs. ecological validity

Ecological validity”—coined by Egon Brunswik in 1947

…to mean something else (¬_¬)

Egon Brunswik

Representative design

Ecological generalizability demands a “representative sampling of situations” where “situational instances in an ecology are analogous to individuals in a population.”

75 of 87

Experimental control vs. ecological validity

Jolly & Chang, 2019

Yarkoni, 2020

Nastase et al., 2020

76 of 87

What is computational neuroscience?

Our working definition…

Computational neuroscience is the enterprise of quantitatively modeling neural activity—the information content and algorithmic operations of the nervous system—given an organism’s sensory input, behavioral output, internal states, and relationship to its environment.

77 of 87

Applications of computational neuroscience

Neural prosthesis

If we can build robust models of neural information processing in particular parts of the nervous system, we can (in theory) replace them with artificial prosthetics!

78 of 87

Applications of computational neuroscience

Neural prosthesis

If we can build robust models of neural information processing in particular parts of the nervous system, we can (in theory) replace them with artificial prosthetics!

Cochlear implant

79 of 87

2008

80 of 87

2012

81 of 87

The future of computational neuroscience

82 of 87

Tungsten electrode

83 of 87

Utah array

84 of 87

The future of computational neuroscience

Neuropixels probe

85 of 87

The future of computational neuroscience

Stevenson & Kording, 2011

86 of 87

The future of computational neuroscience

Stevenson & Kording, 2011

It’s an exciting time to study computational neuroscience:

We’re getting incredible data!

Computers are getting extremely fast!

Mathematical advances are yielding deeper insights into neural information processing!

87 of 87