Nested Differentiation and Symmetric Hessian Graphs with ADTAGEO

Size: px
Start display at page:

Download "Nested Differentiation and Symmetric Hessian Graphs with ADTAGEO"

Transcription

1 Nested Differentiation and Symmetric Hessian Graphs with ADTAGEO ADjoints and TAngents by Graph Elimination Ordering Jan Riehme Andreas Griewank Institute for Applied Mathematics Humboldt Universität zu Berlin 7th December th Euro AD Workshop Aachen, Germany

2 Outline 1 Introduction 2 Nested Automatic Differentiation 3 Propagation within ADTAGEO 4 Hessian Graphs in ADTAGEO 5 Symmteric Hessian Graphs in ADTAGEO 6 Conclusion and Outlook

3 Introduction Introduction

4 Introduction Maintain a Live -DAG Eliminate as soon as possible as many vertecies as possible. DAG represents the active variables alive at any one time. Small graph Memory savings ADTAGEO performs vertex elimination whenever (i) An active variable is deallocated/destroyed (ii) An active variable is overwritten

5 Introduction Instant Elimination Looking at a function call: void f( double x1, double x2, double & z ) { double y1 = x1*x2, y2 = x1+x2; z = x1*y1*y2; } inside scope of f after leaving scope of f x1 c y1,x2 x2 x1 x2 c y1,x1 y1 c z,x1 c z,y1 c y2,x2 c y2,x1 c z,y2 y2 c z,x1 c z,x2 z z

6 may sound complicated... Perfect fitting into OOP scenario (i) is covered by Destructor (assuming it exists in language) (ii) is covered by assignment operator Prototype in C++ Proof of concept optimized for understanding, not optimized for speed Heavy use of class map from the Standard Template Library to store partials locally at every node (edges in graph) Rapid prototyping (First Order Derivatives): 140 lines of code for +-*/ and sin, cos, exp Rapid prototyping Hessian, Second Order Elimination: 100 additional lines of code for Hessian elimination

7 DAGLAD - Local graph storage class daglad{ private: double val; map<daglad*, double> args; map<daglad*, double> uses; hurry //function value //arguments = incoming edges //used by = outgoing edges public: daglad() {...}; //constructor void eliminate() {...}; //eliminate current vertex ~daglad() { eliminate();...}; //destructor void operator = (...) { eliminate();...}; // asgnm. friend dagdoub operator + (...); // arithmetic operators friend double operator % (...);... // retrieval op }; /* class daglad */

8 ADTAGEO Local Graph Representation Program: y = x1 * x2 * x3; z = x3 * x4 * y; x1 x2 x3 x4 y.args y y.uses z Note: Every partial is stored as attribute of a forward and corresponding reverse arcs.

9 ADTAGEO Overview No specification of independents/dependents Choose mixture of forward / reverse mode by variable allocation No tape on disc, Graph is managed and reduced memory Correctness of derivatives has to be ensured (full accumulation) No top-level routine concept Access to derivatives at any time = Nested Automatic Differentiation = Graph represents the sparsity structure of the Jacobian BUT: ADTAGEO is not only dynamic sparsity propagation ADTAGEO computes derivatives in sparse mode, therefore no structural zeros are computed No need to propagate a seed matrix / directions /... No need for Jacobian compression

10 ADTAGEO Derivative Retrieval Easy mode: Redeclare (required) variables to be of type daglad Retrieve first order partials y x on theee arc between variables x and y somewhere in the code using the % operator y[j]%x[i] y j x i x and y are vectors in your C++ program) Advanced mode: Check/prepare/write code for better performance Right mixture of forward and reverse mode Hybrid Forward-Reverse-sweeps Using propagators of ADTAGEO to ensure fully accummulated derivatives

11 Nested Automatic Differentiation Nested Automatic Differentiation

12 ?????? Newtons Method Suppose we have For fixed u = û lets look at F = F (y, u) : R 2 R F (y, û) = 0 = Newton s Method needs F y = f%y in ADTAGEO. How about solving F (y, û) = 0 and taking the derivative y(u) (û) =??????? u

13 ?????? Newtons Method Subprogram: #include "daglad.h" void newton(daglad &y, daglad &u, double &eps) { daglad f; // f (y, u) function value daglad t = 3*eps; // f /f, update while (fabs(t.val()) > eps ) // terminate loop if f /f ɛ { f = sin(exp(y)) - cos(exp(y)) * u * u; // compute f t = f / ( f%y ); // compute update using ADTAGEO y = y-t; // update iterate } } // end of newton

14 ?????? Main program Newton Main Program: main(){ double eps, dy; daglad y, u; cout << eps = ; cin >> eps; } y=0; u=0.5; // initialise newton(y,u,eps); // call newton method dy = y%u ; // retrieve derivative, AD // end of newton

15 Nested Automatic Differentiation Pain-free!!! Suppose we have For fixed u = û lets look at F = F (y, u) : R 2 R F (y, û) = 0 = Newton s Method needs F y = f%y in ADTAGEO. How about solving F (y, û) = 0 and taking the derivative ADTAGEOs answer: y(u) (û) =??????? u y(u) (û) = y%u u

16 Nested Automatic Differentiation Application Least Squares Scenario: 1 min y y 2 s.t. F (y, u) = 0 (y,u) 2 Derivatives needed in Newton J = F y = F%y Rn n Derivatives needed in Gauss - Newton K = y u = y%u Rn m with m n

17 Nested Automatic Differentiation Application Function eval y(y, u) F (y, u) = 0 with u fixed by Newton r = F (y, u) R n While r > ɛ Compute residual J = y r R n n [L, U] = LUdecomp(J) dy = LUsolve(L, U, r) y = y dy r = F (y, u) R n return y passive: partial Jacobian of r wrt. y passive: get LU decomposition of J active: compute update dy on y Apply update Compute residual

18 Nested Automatic Differentiation Application Least Squares with Gauss - Newton Target state y is given Choose initial control u and state y y = eval y(y, u) While y y 2 >2 ɛ Compute state y K = u y R n m passive: Reduced Jacobian of y wrt. u [Q, R] = QRdecomp(K) passive du = Backsolve(R, Q T (y y )) active u = u du Apply update on control y = eval y(y, u) R n Compute new state y u = u, y = y solution (u, y )

19 Nested Automatic Differentiation Application Example 11.1 from Nocedal/Wright: [Rheinboldt] [ ] y F (y, u) = A + φ(y) = 0 y R 5, u R 3, A R 5 8 u φ : R 5 R 5 non - linear State y: flight configuration of an aircraft y 1... roll y 2... pitch y 3... yaw y 4... incremental angle of attack y 5... sideslip angle Control u: controls of the aircraft u 1... elevator u 2... aileron u 3... rudder Implicit function y = y(u) : R 3 R 5 for fixed control u

20 Nested AD Numerical results lsqr START **Y** = [ ] START y = [ ] START u = [ ]... END res = 2.63e-13 END **Y** = [ ] END y = [ ] END u = [ ]

21 Nested AD Complexity Considerations Assumption (A1) : fixed number of Newton steps small number of Gauss - Newton steps Computation of y = eval y(y, u) (J R n n, Forward mode) OPS(u y) OPS(J 1 F ) = OPS((y, u) J) n3 n OPS((y, u) F ) Computation of F u (K R n m, Reverse mode) OPS((y, u) F ) m OPS((y, u) F ) u

22 Nested AD Optimal Reduced Jacobian All together we have OPS((y, u) u ) OPS(u K) + OPS(u J 1 F ) = OPS((y, u) F u ) + OPS(J 1 ) m OPS((y, u) F ) + OPS(u y) and since m <= n we have m OPS((y, u) F ) OPS(u y) and therefore we have for the Reduced Jacobian K in Gauss-Newton OPS((y, u) u ) OPS(u y) in contrast to general AD assumption OPS((y, u) u ) n OPS(u y)

23 Nested AD Verifying Complexity Central differences on discretization of x y + ɛ e y = 0 with N gridpoints in each direction y i,j = y(i h, j h), i = 1(1)n, j = 1(1)n y i 1,j + y i+1,j + y i,j 1 + y i,j+1 4y }{{ i,j + h 2 ɛ e yi,j = 0 } approximation of x y i,j So far: results for dense LU decomposition N n A P

24 Nested AD Verifying Complexity LU dense, active LU dense, passive

25 Propagation within ADTAGEO Propagation within ADTAGEO

26 Propagation within ADTAGEO Setup Example (from Andreas Book): y = f (x) = exp(x 1 ) sin(x 1 + x 2 ) v -1 v 3 1 v 4 v 0 1 v 1 cos(v 1 ) v 3 Main Propagation Pinciple Instant Propagation Whenever a vertex v i got the contributions v j c ij from all of its predecessors v j with j i, than the now fully accumulated v i = j i v i c ij has to be propagated immediately to successors of v i.

27 Propagation within ADTAGEO Forward, F ẋ Propagating ẋ = (1, 1) T ẋ 1 = 1 v -1 v 3 v 3 + v cos(v 3 1 ) 1 ẋ 2 = 1 12 v 0 1 v 1 cos(v 1 ) 2 cos(v 1 ) v 3 v 4

28 Propagation within ADTAGEO Notes Propagation does not require any searches, since successors of vertex v i can be visited in arbitrary order, thus especially as stored in the successors set of v i Propagation touches every arc exactly once Propagation appears always on a fixed graph, that might change again after propagation finished Propagation in reverse mode too Propagation might start somewhere in the graph This is in fact Nested Automatic Differentiation Evaluation of vector products with partial Jacobians (e.g. Jacobians of parts of the original function)

29 Propagation within ADTAGEO Notes Lemma The simple propagation technique from above computes F ẋ iff the vertices v i,i = 1... n, selected by seeding with ẋ R n forms a vertex cut in the graph. To have a Lemma is nice, but it tells a bad story: We have to search a vertex cut for seeding, that contains all x i selected by ẋ, and add some x j = 0. That is we have to propagate zeros. Really???

30 ADTAGEO Sparse Propagation Sparse propagation Add a level number to vertices instead of counting contributions Store every vertex on first visit in a priority queue Q sorted by ascending levels (F ẋ) or descending levels (ȳf ) Remove every finished vertex from Q (somehow) If propagation stops, but Q is not empty Take first vertex v i from Q and continue propagation from v i until Q is empty Lemma (i) Sparse Propagation in ADTAGEO always terminates. (ii) All zeros in the initial direction ẋ [ȳ] can be ignored.

31 Hessian Graphs in ADTAGEO Hessian Graphs in ADTAGEO

32 Hessian Graphs in ADTAGEO First European AD-Workshop in Nice, 2005: Storing sparse local Hessians in ADTAGEO utilizing symmetry Second order elimination rules preserving symmetry Example (from Andreas Book): y = f (x) = exp(x 1 ) sin(x 1 + x 2 ) v -1 v 3 1 v 0 1 v 1 -v 3 cos(v 1 ) v 3 1 v 4

33 ADTAGEO Annotated Hessian Arcs Annotated Hessian arcs... from v i pointing towards the predecessors of v i with the fully accumulated adjoint v i = i k v kc ki of v i v -1 v 0 1 v 1 Look at Reverse propagation of v 4 from v 4 v 4 v (cos( v 4 cos(v 1 ) + 1 ) v 3 ) v 3 v 4 1 -v 3 v 3 cos(v 1 ) v 3 v 3 v 4 1 v 4 v 4 v 4 v 4 cos(v 1 ) v 4 cos(v 1 )

34 Symmetric Second Order Propagation Second order propagation to compute ȳf ẋ Combine reverse propagation of v i with special second order propagation rules (similiarity to elimination rules), which incoporates v i from forward propagation of ẋ. v -1 v 3 1 v 0 1 v 1 -v 3 v 3 cos(v 1 ) v 3 1 v 4 v 4

35 Symmteric Hessian Graphs in ADTAGEO Symmteric Hessian Graphs in ADTAGEO

36 Symmteric Hessian Graphs in ADTAGEO You might ask: Where is the symmetric Hessian graph from Andreas book? v -1 v2 v-1 v 4 1 v 4 v 4 v 4 -v 3 v 3 v 3 v 4 v 3 v 0 v 1 v 1 v 0 v 3 v 3

37 Symmteric Hessian Graphs in ADTAGEO You might ask: Where is the symmetric Hessian graph from Andreas book? v -1 v 4 v -1 v 4 v 4 v 3 v 4 v 3 v 0 v 1 v 1 v 0 Here it is!! v 3 v 3

38 Conclusion and Outlook Conclusion You have seen ADTAGEO as a new AD concept You have seen Pain-free Nested Automatic Differentation You heard about Optimal Reduced Jacobian You have seenautomatic Exploitation of Sparsity You have seen Symmetrix Hessian Graphs and Propagation Outlook Easy to exploit Partial Separability Possible to detectpartial Separability Automatic deallocation reordering (vectors,..) Keep non differential vertices to get generalized derivatives ADTAGEO ALLEGRO : optimize for speed

39 Thank you Thank you very much!

The Art of Differentiating Computer Programs

The Art of Differentiating Computer Programs The Art of Differentiating Computer Programs Uwe Naumann LuFG Informatik 12 Software and Tools for Computational Engineering RWTH Aachen University, Germany naumann@stce.rwth-aachen.de www.stce.rwth-aachen.de

More information

STCE. Adjoint Code Design Patterns. Uwe Naumann. RWTH Aachen University, Germany. QuanTech Conference, London, April 2016

STCE. Adjoint Code Design Patterns. Uwe Naumann. RWTH Aachen University, Germany. QuanTech Conference, London, April 2016 Adjoint Code Design Patterns Uwe Naumann RWTH Aachen University, Germany QuanTech Conference, London, April 2016 Outline Why Adjoints? What Are Adjoints? Software Tool Support: dco/c++ Adjoint Code Design

More information

Exploiting Fill-in and Fill-out in Gaussian-like Elimination Procedures on the Extended Jacobian Matrix

Exploiting Fill-in and Fill-out in Gaussian-like Elimination Procedures on the Extended Jacobian Matrix 2nd European Workshop on AD 1 Exploiting Fill-in and Fill-out in Gaussian-like Elimination Procedures on the Extended Jacobian Matrix Andrew Lyons (Vanderbilt U.) / Uwe Naumann (RWTH Aachen) 2nd European

More information

5.1 Banded Storage. u = temperature. The five-point difference operator. uh (x, y + h) 2u h (x, y)+u h (x, y h) uh (x + h, y) 2u h (x, y)+u h (x h, y)

5.1 Banded Storage. u = temperature. The five-point difference operator. uh (x, y + h) 2u h (x, y)+u h (x, y h) uh (x + h, y) 2u h (x, y)+u h (x h, y) 5.1 Banded Storage u = temperature u= u h temperature at gridpoints u h = 1 u= Laplace s equation u= h u = u h = grid size u=1 The five-point difference operator 1 u h =1 uh (x + h, y) 2u h (x, y)+u h

More information

Numerical Methods I Non-Square and Sparse Linear Systems

Numerical Methods I Non-Square and Sparse Linear Systems Numerical Methods I Non-Square and Sparse Linear Systems Aleksandar Donev Courant Institute, NYU 1 donev@courant.nyu.edu 1 MATH-GA 2011.003 / CSCI-GA 2945.003, Fall 2014 September 25th, 2014 A. Donev (Courant

More information

Math 409/509 (Spring 2011)

Math 409/509 (Spring 2011) Math 409/509 (Spring 2011) Instructor: Emre Mengi Study Guide for Homework 2 This homework concerns the root-finding problem and line-search algorithms for unconstrained optimization. Please don t hesitate

More information

Intro to Automatic Differentiation

Intro to Automatic Differentiation Intro to Automatic Differentiation Thomas Kaminski (http://fastopt.com) Thanks to: Simon Blessing (FastOpt), Ralf Giering (FastOpt), Nadine Gobron (JRC), Wolfgang Knorr (QUEST), Thomas Lavergne (Met.No),

More information

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences)

AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences) AMS526: Numerical Analysis I (Numerical Linear Algebra for Computational and Data Sciences) Lecture 19: Computing the SVD; Sparse Linear Systems Xiangmin Jiao Stony Brook University Xiangmin Jiao Numerical

More information

On the efficient exploitation of sparsity

On the efficient exploitation of sparsity On the efficient exploitation of sparsity Andrea Walther Institut für Mathematik Universität Paderborn Workshop on PDE constrained optimization 2009 Trier, June 3 5, 2009 Outline 1 Motivation 2 Computing

More information

REVIEW OF DIFFERENTIAL CALCULUS

REVIEW OF DIFFERENTIAL CALCULUS REVIEW OF DIFFERENTIAL CALCULUS DONU ARAPURA 1. Limits and continuity To simplify the statements, we will often stick to two variables, but everything holds with any number of variables. Let f(x, y) be

More information

The Data-Dependence graph of Adjoint Codes

The Data-Dependence graph of Adjoint Codes The Data-Dependence graph of Adjoint Codes Laurent Hascoët INRIA Sophia-Antipolis November 19th, 2012 (INRIA Sophia-Antipolis) Data-Deps of Adjoints 19/11/2012 1 / 14 Data-Dependence graph of this talk

More information

Physics 202 Laboratory 3. Root-Finding 1. Laboratory 3. Physics 202 Laboratory

Physics 202 Laboratory 3. Root-Finding 1. Laboratory 3. Physics 202 Laboratory Physics 202 Laboratory 3 Root-Finding 1 Laboratory 3 Physics 202 Laboratory The fundamental question answered by this week s lab work will be: Given a function F (x), find some/all of the values {x i }

More information

Dynamic Programming: Shortest Paths and DFA to Reg Exps

Dynamic Programming: Shortest Paths and DFA to Reg Exps CS 374: Algorithms & Models of Computation, Spring 207 Dynamic Programming: Shortest Paths and DFA to Reg Exps Lecture 8 March 28, 207 Chandra Chekuri (UIUC) CS374 Spring 207 / 56 Part I Shortest Paths

More information

DIFFERENTIAL EQUATIONS

DIFFERENTIAL EQUATIONS DIFFERENTIAL EQUATIONS Chapter 1 Introduction and Basic Terminology Most of the phenomena studied in the sciences and engineering involve processes that change with time. For example, it is well known

More information

MIT Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology

MIT Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology MIT 6.035 Foundations of Dataflow Analysis Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology Dataflow Analysis Compile-Time Reasoning About Run-Time Values of Variables

More information

Automatic Differentiation for Optimum Design, Applied to Sonic Boom Reduction

Automatic Differentiation for Optimum Design, Applied to Sonic Boom Reduction Automatic Differentiation for Optimum Design, Applied to Sonic Boom Reduction Laurent Hascoët, Mariano Vázquez, Alain Dervieux Laurent.Hascoet@sophia.inria.fr Tropics Project, INRIA Sophia-Antipolis AD

More information

Neural Networks in Structured Prediction. November 17, 2015

Neural Networks in Structured Prediction. November 17, 2015 Neural Networks in Structured Prediction November 17, 2015 HWs and Paper Last homework is going to be posted soon Neural net NER tagging model This is a new structured model Paper - Thursday after Thanksgiving

More information

Sparse Solutions of Systems of Equations and Sparse Modelling of Signals and Images

Sparse Solutions of Systems of Equations and Sparse Modelling of Signals and Images Sparse Solutions of Systems of Equations and Sparse Modelling of Signals and Images Alfredo Nava-Tudela ant@umd.edu John J. Benedetto Department of Mathematics jjb@umd.edu Abstract In this project we are

More information

Lecture 4 Backpropagation

Lecture 4 Backpropagation Lecture 4 Backpropagation CMSC 35246: Deep Learning Shubhendu Trivedi & Risi Kondor University of Chicago April 5, 2017 Things we will look at today More Backpropagation Still more backpropagation Quiz

More information

MATHEMATICAL OBJECTS in

MATHEMATICAL OBJECTS in MATHEMATICAL OBJECTS in Computational Tools in a Unified Object-Oriented Approach Yair Shapira @ CRC Press Taylor & Francis Group Boca Raton London New York CRC Press is an imprint of the Taylor & Francis

More information

CTL satisfability via tableau A C++ implementation

CTL satisfability via tableau A C++ implementation CTL satisfability via tableau A C++ implementation Nicola Prezza April 30, 2015 Outline 1 Introduction 2 Parsing 3 Data structures 4 Initial sets of labels and edges 5 Cull 6 Examples and benchmarks The

More information

Introduction to data-flow analysis. Data-flow analysis. Control-flow graphs. Data-flow analysis. Example: liveness. Requirements

Introduction to data-flow analysis. Data-flow analysis. Control-flow graphs. Data-flow analysis. Example: liveness. Requirements Data-flow analysis Michel Schinz based on material by Erik Stenman and Michael Schwartzbach Introduction to data-flow analysis Data-flow analysis Example: liveness Data-flow analysis is a global analysis

More information

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations

An Overly Simplified and Brief Review of Differential Equation Solution Methods. 1. Some Common Exact Solution Methods for Differential Equations An Overly Simplified and Brief Review of Differential Equation Solution Methods We will be dealing with initial or boundary value problems. A typical initial value problem has the form y y 0 y(0) 1 A typical

More information

Linear Systems of n equations for n unknowns

Linear Systems of n equations for n unknowns Linear Systems of n equations for n unknowns In many application problems we want to find n unknowns, and we have n linear equations Example: Find x,x,x such that the following three equations hold: x

More information

Computation Theory Finite Automata

Computation Theory Finite Automata Computation Theory Dept. of Computing ITT Dublin October 14, 2010 Computation Theory I 1 We would like a model that captures the general nature of computation Consider two simple problems: 2 Design a program

More information

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit VII Sparse Matrix

Scientific Computing with Case Studies SIAM Press, Lecture Notes for Unit VII Sparse Matrix Scientific Computing with Case Studies SIAM Press, 2009 http://www.cs.umd.edu/users/oleary/sccswebpage Lecture Notes for Unit VII Sparse Matrix Computations Part 1: Direct Methods Dianne P. O Leary c 2008

More information

Branch Detection and Sparsity Estimation in Matlab

Branch Detection and Sparsity Estimation in Matlab Branch Detection and Sparsity Estimation in Matlab Marina Menshikova & Shaun Forth Engineering Systems Department Cranfield University (DCMT Shrivenham) Shrivenham, Swindon SN6 8LA, U.K. email: M.Menshikova@cranfield.ac.uk/S.A.Forth@cranfield.ac.uk

More information

Higher order derivative

Higher order derivative 2 Î 3 á Higher order derivative Î 1 Å Iterated partial derivative Iterated partial derivative Suppose f has f/ x, f/ y and ( f ) = 2 f x x x 2 ( f ) = 2 f x y x y ( f ) = 2 f y x y x ( f ) = 2 f y y y

More information

Migration with Implicit Solvers for the Time-harmonic Helmholtz

Migration with Implicit Solvers for the Time-harmonic Helmholtz Migration with Implicit Solvers for the Time-harmonic Helmholtz Yogi A. Erlangga, Felix J. Herrmann Seismic Laboratory for Imaging and Modeling, The University of British Columbia {yerlangga,fherrmann}@eos.ubc.ca

More information

Flows. Chapter Circulations

Flows. Chapter Circulations Chapter 4 Flows For a directed graph D = (V,A), we define δ + (U) := {(u,v) A : u U,v / U} as the arcs leaving U and δ (U) := {(u,v) A u / U,v U} as the arcs entering U. 4. Circulations In a directed graph

More information

Sparse Linear Systems. Iterative Methods for Sparse Linear Systems. Motivation for Studying Sparse Linear Systems. Partial Differential Equations

Sparse Linear Systems. Iterative Methods for Sparse Linear Systems. Motivation for Studying Sparse Linear Systems. Partial Differential Equations Sparse Linear Systems Iterative Methods for Sparse Linear Systems Matrix Computations and Applications, Lecture C11 Fredrik Bengzon, Robert Söderlund We consider the problem of solving the linear system

More information

CSE 4502/5717 Big Data Analytics Spring 2018; Homework 1 Solutions

CSE 4502/5717 Big Data Analytics Spring 2018; Homework 1 Solutions CSE 502/5717 Big Data Analytics Spring 2018; Homework 1 Solutions 1. Consider the following algorithm: for i := 1 to α n log e n do Pick a random j [1, n]; If a[j] = a[j + 1] or a[j] = a[j 1] then output:

More information

CS 138b Computer Algorithm Homework #14. Ling Li, February 23, Construct the level graph

CS 138b Computer Algorithm Homework #14. Ling Li, February 23, Construct the level graph 14.1 Construct the level graph Let s modify BFS slightly to construct the level graph L G = (V, E ) of G = (V, E, c) out of a source s V. We will use a queue Q and an array l containing levels of vertices.

More information

Dynamic Programming: Shortest Paths and DFA to Reg Exps

Dynamic Programming: Shortest Paths and DFA to Reg Exps CS 374: Algorithms & Models of Computation, Fall 205 Dynamic Programming: Shortest Paths and DFA to Reg Exps Lecture 7 October 22, 205 Chandra & Manoj (UIUC) CS374 Fall 205 / 54 Part I Shortest Paths with

More information

Neural Networks Learning the network: Backprop , Fall 2018 Lecture 4

Neural Networks Learning the network: Backprop , Fall 2018 Lecture 4 Neural Networks Learning the network: Backprop 11-785, Fall 2018 Lecture 4 1 Recap: The MLP can represent any function The MLP can be constructed to represent anything But how do we construct it? 2 Recap:

More information

Formally Analyzing Adaptive Flight Control

Formally Analyzing Adaptive Flight Control Formally Analyzing Adaptive Flight Control Ashish Tiwari SRI International 333 Ravenswood Ave Menlo Park, CA 94025 Supported in part by NASA IRAC NRA grant number: NNX08AB95A Ashish Tiwari Symbolic Verification

More information

Introduction to Natural Computation. Lecture 9. Multilayer Perceptrons and Backpropagation. Peter Lewis

Introduction to Natural Computation. Lecture 9. Multilayer Perceptrons and Backpropagation. Peter Lewis Introduction to Natural Computation Lecture 9 Multilayer Perceptrons and Backpropagation Peter Lewis 1 / 25 Overview of the Lecture Why multilayer perceptrons? Some applications of multilayer perceptrons.

More information

Scientific Computing

Scientific Computing Scientific Computing Direct solution methods Martin van Gijzen Delft University of Technology October 3, 2018 1 Program October 3 Matrix norms LU decomposition Basic algorithm Cost Stability Pivoting Pivoting

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Design and Analysis of Algorithms CSE 5311 Lecture 21 Single-Source Shortest Paths Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 Single-Source

More information

Generalized mid-point and trapezoidal rules for Lipschitzian RHS

Generalized mid-point and trapezoidal rules for Lipschitzian RHS Generalized mid-point and trapezoidal rules for Lipschitzian RHS Richard Hasenfelder, Andreas Griewank, Tom Streubel Humboldt Universität zu Berlin 7th International Conference on Algorithmic Differentiation

More information

Iterative Methods. Splitting Methods

Iterative Methods. Splitting Methods Iterative Methods Splitting Methods 1 Direct Methods Solving Ax = b using direct methods. Gaussian elimination (using LU decomposition) Variants of LU, including Crout and Doolittle Other decomposition

More information

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion CHAPTER 1 Relations 1. Relations and Their Properties 1.1. Definition of a Relation. Definition 1.1.1. A binary relation from a set A to a set B is a subset R A B. If (a, b) R we say a is Related to b

More information

MAA507, Power method, QR-method and sparse matrix representation.

MAA507, Power method, QR-method and sparse matrix representation. ,, and representation. February 11, 2014 Lecture 7: Overview, Today we will look at:.. If time: A look at representation and fill in. Why do we need numerical s? I think everyone have seen how time consuming

More information

7.2 Linear equation systems. 7.3 Linear least square fit

7.2 Linear equation systems. 7.3 Linear least square fit 72 Linear equation systems In the following sections, we will spend some time to solve linear systems of equations This is a tool that will come in handy in many di erent places during this course For

More information

Practice Problems for Final Exam

Practice Problems for Final Exam Math 1280 Spring 2016 Practice Problems for Final Exam Part 2 (Sections 6.6, 6.7, 6.8, and chapter 7) S o l u t i o n s 1. Show that the given system has a nonlinear center at the origin. ẋ = 9y 5y 5,

More information

Utilisation de la compression low-rank pour réduire la complexité du solveur PaStiX

Utilisation de la compression low-rank pour réduire la complexité du solveur PaStiX Utilisation de la compression low-rank pour réduire la complexité du solveur PaStiX 26 Septembre 2018 - JCAD 2018 - Lyon Grégoire Pichon, Mathieu Faverge, Pierre Ramet, Jean Roman Outline 1. Context 2.

More information

Parallel Iterative Methods for Sparse Linear Systems. H. Martin Bücker Lehrstuhl für Hochleistungsrechnen

Parallel Iterative Methods for Sparse Linear Systems. H. Martin Bücker Lehrstuhl für Hochleistungsrechnen Parallel Iterative Methods for Sparse Linear Systems Lehrstuhl für Hochleistungsrechnen www.sc.rwth-aachen.de RWTH Aachen Large and Sparse Small and Dense Outline Problem with Direct Methods Iterative

More information

Mathematics for Decision Making: An Introduction. Lecture 8

Mathematics for Decision Making: An Introduction. Lecture 8 Mathematics for Decision Making: An Introduction Lecture 8 Matthias Köppe UC Davis, Mathematics January 29, 2009 8 1 Shortest Paths and Feasible Potentials Feasible Potentials Suppose for all v V, there

More information

NUMERICAL MATHEMATICS & COMPUTING 7th Edition

NUMERICAL MATHEMATICS & COMPUTING 7th Edition NUMERICAL MATHEMATICS & COMPUTING 7th Edition Ward Cheney/David Kincaid c UT Austin Engage Learning: Thomson-Brooks/Cole wwwengagecom wwwmautexasedu/cna/nmc6 October 16, 2011 Ward Cheney/David Kincaid

More information

Linear Solvers. Andrew Hazel

Linear Solvers. Andrew Hazel Linear Solvers Andrew Hazel Introduction Thus far we have talked about the formulation and discretisation of physical problems...... and stopped when we got to a discrete linear system of equations. Introduction

More information

Week 4. (1) 0 f ij u ij.

Week 4. (1) 0 f ij u ij. Week 4 1 Network Flow Chapter 7 of the book is about optimisation problems on networks. Section 7.1 gives a quick introduction to the definitions of graph theory. In fact I hope these are already known

More information

Analysis of Algorithms. Outline. Single Source Shortest Path. Andres Mendez-Vazquez. November 9, Notes. Notes

Analysis of Algorithms. Outline. Single Source Shortest Path. Andres Mendez-Vazquez. November 9, Notes. Notes Analysis of Algorithms Single Source Shortest Path Andres Mendez-Vazquez November 9, 01 1 / 108 Outline 1 Introduction Introduction and Similar Problems General Results Optimal Substructure Properties

More information

Meronymy-based Aggregation of Activities in Business Process Models

Meronymy-based Aggregation of Activities in Business Process Models Meronymy-based Aggregation of Activities in Business Process Models Sergey Smirnov 1, Remco Dijkman 2, Jan Mendling 3, and Mathias Weske 1 1 Hasso Plattner Institute, Germany 2 Eindhoven University of

More information

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel

LECTURE NOTES ELEMENTARY NUMERICAL METHODS. Eusebius Doedel LECTURE NOTES on ELEMENTARY NUMERICAL METHODS Eusebius Doedel TABLE OF CONTENTS Vector and Matrix Norms 1 Banach Lemma 20 The Numerical Solution of Linear Systems 25 Gauss Elimination 25 Operation Count

More information

The First Derivative and Second Derivative Test

The First Derivative and Second Derivative Test The First Derivative and Second Derivative Test James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University April 9, 2018 Outline 1 Extremal Values 2

More information

Relations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples.

Relations. We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples. Relations We have seen several types of abstract, mathematical objects, including propositions, predicates, sets, and ordered pairs and tuples. Relations use ordered tuples to represent relationships among

More information

Section 7.1 Relations and Their Properties. Definition: A binary relation R from a set A to a set B is a subset R A B.

Section 7.1 Relations and Their Properties. Definition: A binary relation R from a set A to a set B is a subset R A B. Section 7.1 Relations and Their Properties Definition: A binary relation R from a set A to a set B is a subset R A B. Note: there are no constraints on relations as there are on functions. We have a common

More information

Continuous Differentiation of Complex Systems Applied to a Hypersonic Vehicle

Continuous Differentiation of Complex Systems Applied to a Hypersonic Vehicle Continuous of Complex Systems Applied to a Vehicle AIAA Aircraft Flight Mechanics Conference Derek J. Dalle, Sean M. Torrez, James F. Driscoll University of Michigan, Ann Arbor, MI 4819 August 15, 212,

More information

Have a Safe and Happy Break

Have a Safe and Happy Break Math 121 Final EF: December 10, 2013 Name Directions: 1 /15 2 /15 3 /15 4 /15 5 /10 6 /10 7 /20 8 /15 9 /15 10 /10 11 /15 12 /20 13 /15 14 /10 Total /200 1. No book, notes, or ouiji boards. You may use

More information

Fast algorithms for hierarchically semiseparable matrices

Fast algorithms for hierarchically semiseparable matrices NUMERICAL LINEAR ALGEBRA WITH APPLICATIONS Numer. Linear Algebra Appl. 2010; 17:953 976 Published online 22 December 2009 in Wiley Online Library (wileyonlinelibrary.com)..691 Fast algorithms for hierarchically

More information

Midterm Exam 2 Solutions

Midterm Exam 2 Solutions Algorithm Design and Analysis November 12, 2010 Pennsylvania State University CSE 565, Fall 2010 Professor Adam Smith Exam 2 Solutions Problem 1 (Miscellaneous). Midterm Exam 2 Solutions (a) Your friend

More information

Numerical Linear Algebra

Numerical Linear Algebra Numerical Linear Algebra Decompositions, numerical aspects Gerard Sleijpen and Martin van Gijzen September 27, 2017 1 Delft University of Technology Program Lecture 2 LU-decomposition Basic algorithm Cost

More information

Numerical solutions of nonlinear systems of equations

Numerical solutions of nonlinear systems of equations Numerical solutions of nonlinear systems of equations Tsung-Ming Huang Department of Mathematics National Taiwan Normal University, Taiwan E-mail: min@math.ntnu.edu.tw August 28, 2011 Outline 1 Fixed points

More information

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects

Program Lecture 2. Numerical Linear Algebra. Gaussian elimination (2) Gaussian elimination. Decompositions, numerical aspects Numerical Linear Algebra Decompositions, numerical aspects Program Lecture 2 LU-decomposition Basic algorithm Cost Stability Pivoting Cholesky decomposition Sparse matrices and reorderings Gerard Sleijpen

More information

Fisher Information in Gaussian Graphical Models

Fisher Information in Gaussian Graphical Models Fisher Information in Gaussian Graphical Models Jason K. Johnson September 21, 2006 Abstract This note summarizes various derivations, formulas and computational algorithms relevant to the Fisher information

More information

Sequential Supervised Learning

Sequential Supervised Learning Sequential Supervised Learning Many Application Problems Require Sequential Learning Part-of of-speech Tagging Information Extraction from the Web Text-to to-speech Mapping Part-of of-speech Tagging Given

More information

Algebraic flux correction and its application to convection-dominated flow. Matthias Möller

Algebraic flux correction and its application to convection-dominated flow. Matthias Möller Algebraic flux correction and its application to convection-dominated flow Matthias Möller matthias.moeller@math.uni-dortmund.de Institute of Applied Mathematics (LS III) University of Dortmund, Germany

More information

Direct Methods for solving Linear Equation Systems

Direct Methods for solving Linear Equation Systems REVIEW Lecture 5: Systems of Linear Equations Spring 2015 Lecture 6 Direct Methods for solving Linear Equation Systems Determinants and Cramer s Rule Gauss Elimination Algorithm Forward Elimination/Reduction

More information

Math 212-Lecture 8. The chain rule with one independent variable

Math 212-Lecture 8. The chain rule with one independent variable Math 212-Lecture 8 137: The multivariable chain rule The chain rule with one independent variable w = f(x, y) If the particle is moving along a curve x = x(t), y = y(t), then the values that the particle

More information

Power System Analysis Prof. A. K. Sinha Department of Electrical Engineering Indian Institute of Technology, Kharagpur. Lecture - 21 Power Flow VI

Power System Analysis Prof. A. K. Sinha Department of Electrical Engineering Indian Institute of Technology, Kharagpur. Lecture - 21 Power Flow VI Power System Analysis Prof. A. K. Sinha Department of Electrical Engineering Indian Institute of Technology, Kharagpur Lecture - 21 Power Flow VI (Refer Slide Time: 00:57) Welcome to lesson 21. In this

More information

Appendix A. Formal Proofs

Appendix A. Formal Proofs Distributed Reasoning for Multiagent Simple Temporal Problems Appendix A Formal Proofs Throughout this paper, we provided proof sketches to convey the gist of the proof when presenting the full proof would

More information

iretilp : An efficient incremental algorithm for min-period retiming under general delay model

iretilp : An efficient incremental algorithm for min-period retiming under general delay model iretilp : An efficient incremental algorithm for min-period retiming under general delay model Debasish Das, Jia Wang and Hai Zhou EECS, Northwestern University, Evanston, IL 60201 Place and Route Group,

More information

The First Derivative and Second Derivative Test

The First Derivative and Second Derivative Test The First Derivative and Second Derivative Test James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University November 8, 2017 Outline Extremal Values The

More information

Example problem: Adaptive solution of the 2D advection diffusion equation

Example problem: Adaptive solution of the 2D advection diffusion equation Chapter 1 Example problem: Adaptive solution of the 2D advection diffusion equation In this example we discuss the adaptive solution of the 2D advection-diffusion problem Solve Two-dimensional advection-diffusion

More information

Foundations of Informatics: a Bridging Course

Foundations of Informatics: a Bridging Course Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html

More information

Collapsed Gibbs Sampler for Dirichlet Process Gaussian Mixture Models (DPGMM)

Collapsed Gibbs Sampler for Dirichlet Process Gaussian Mixture Models (DPGMM) Collapsed Gibbs Sampler for Dirichlet Process Gaussian Mixture Models (DPGMM) Rajarshi Das Language Technologies Institute School of Computer Science Carnegie Mellon University rajarshd@cs.cmu.edu Sunday

More information

Algorithmic Differentiation of Numerical Methods: Tangent and Adjoint Solvers for Parameterized Systems of Nonlinear Equations

Algorithmic Differentiation of Numerical Methods: Tangent and Adjoint Solvers for Parameterized Systems of Nonlinear Equations Algorithmic Differentiation of Numerical Methods: Tangent and Adjoint Solvers for Parameterized Systems of Nonlinear Equations UWE NAUMANN, JOHANNES LOTZ, KLAUS LEPPKES, and MARKUS TOWARA, RWTH Aachen

More information

An Active Set Strategy for Solving Optimization Problems with up to 200,000,000 Nonlinear Constraints

An Active Set Strategy for Solving Optimization Problems with up to 200,000,000 Nonlinear Constraints An Active Set Strategy for Solving Optimization Problems with up to 200,000,000 Nonlinear Constraints Klaus Schittkowski Department of Computer Science, University of Bayreuth 95440 Bayreuth, Germany e-mail:

More information

Neural Networks. Bishop PRML Ch. 5. Alireza Ghane. Feed-forward Networks Network Training Error Backpropagation Applications

Neural Networks. Bishop PRML Ch. 5. Alireza Ghane. Feed-forward Networks Network Training Error Backpropagation Applications Neural Networks Bishop PRML Ch. 5 Alireza Ghane Neural Networks Alireza Ghane / Greg Mori 1 Neural Networks Neural networks arise from attempts to model human/animal brains Many models, many claims of

More information

HAMILTON CYCLES IN RANDOM REGULAR DIGRAPHS

HAMILTON CYCLES IN RANDOM REGULAR DIGRAPHS HAMILTON CYCLES IN RANDOM REGULAR DIGRAPHS Colin Cooper School of Mathematical Sciences, Polytechnic of North London, London, U.K. and Alan Frieze and Michael Molloy Department of Mathematics, Carnegie-Mellon

More information

1 Searching the World Wide Web

1 Searching the World Wide Web Hubs and Authorities in a Hyperlinked Environment 1 Searching the World Wide Web Because diverse users each modify the link structure of the WWW within a relatively small scope by creating web-pages on

More information

Using an Auction Algorithm in AMG based on Maximum Weighted Matching in Matrix Graphs

Using an Auction Algorithm in AMG based on Maximum Weighted Matching in Matrix Graphs Using an Auction Algorithm in AMG based on Maximum Weighted Matching in Matrix Graphs Pasqua D Ambra Institute for Applied Computing (IAC) National Research Council of Italy (CNR) pasqua.dambra@cnr.it

More information

CS 4407 Algorithms Lecture: Shortest Path Algorithms

CS 4407 Algorithms Lecture: Shortest Path Algorithms CS 440 Algorithms Lecture: Shortest Path Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Outline Shortest Path Problem General Lemmas and Theorems. Algorithms Bellman-Ford

More information

CMPS 6610 Fall 2018 Shortest Paths Carola Wenk

CMPS 6610 Fall 2018 Shortest Paths Carola Wenk CMPS 6610 Fall 018 Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight function w

More information

Single Source Shortest Paths

Single Source Shortest Paths CMPS 00 Fall 015 Single Source Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk 1 Paths in graphs Consider a digraph G = (V, E) with an edge-weight

More information

Consider the following example of a linear system:

Consider the following example of a linear system: LINEAR SYSTEMS Consider the following example of a linear system: Its unique solution is x + 2x 2 + 3x 3 = 5 x + x 3 = 3 3x + x 2 + 3x 3 = 3 x =, x 2 = 0, x 3 = 2 In general we want to solve n equations

More information

Numerical Methods I Solving Nonlinear Equations

Numerical Methods I Solving Nonlinear Equations Numerical Methods I Solving Nonlinear Equations Aleksandar Donev Courant Institute, NYU 1 donev@courant.nyu.edu 1 MATH-GA 2011.003 / CSCI-GA 2945.003, Fall 2014 October 16th, 2014 A. Donev (Courant Institute)

More information

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity CSE 531: Computational Complexity I Winter 2016 Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity January 22, 2016 Lecturer: Paul Beame Scribe: Paul Beame Diagonalization enabled us to separate

More information

Overview of Topics. Finite Model Theory. Finite Model Theory. Connections to Database Theory. Qing Wang

Overview of Topics. Finite Model Theory. Finite Model Theory. Connections to Database Theory. Qing Wang Overview of Topics Finite Model Theory Part 1: Introduction 1 What is finite model theory? 2 Connections to some areas in CS Qing Wang qing.wang@anu.edu.au Database theory Complexity theory 3 Basic definitions

More information

1 Functions of Several Variables Some Examples Level Curves / Contours Functions of More Variables... 6

1 Functions of Several Variables Some Examples Level Curves / Contours Functions of More Variables... 6 Contents 1 Functions of Several Variables 1 1.1 Some Examples.................................. 2 1.2 Level Curves / Contours............................. 4 1.3 Functions of More Variables...........................

More information

Automatic Differentiation Algorithms and Data Structures. Chen Fang PhD Candidate Joined: January 2013 FuRSST Inaugural Annual Meeting May 8 th, 2014

Automatic Differentiation Algorithms and Data Structures. Chen Fang PhD Candidate Joined: January 2013 FuRSST Inaugural Annual Meeting May 8 th, 2014 Automatic Differentiation Algorithms and Data Structures Chen Fang PhD Candidate Joined: January 2013 FuRSST Inaugural Annual Meeting May 8 th, 2014 1 About 2 3 of the code for physics in simulators computes

More information

Single Source Shortest Paths

Single Source Shortest Paths CMPS 00 Fall 017 Single Source Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight

More information

Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds

Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds Randomized Algorithms Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds Sotiris Nikoletseas Associate Professor CEID - ETY Course 2013-2014 Sotiris Nikoletseas, Associate Professor Randomized

More information

CSE613: Parallel Programming, Spring 2012 Date: May 11. Final Exam. ( 11:15 AM 1:45 PM : 150 Minutes )

CSE613: Parallel Programming, Spring 2012 Date: May 11. Final Exam. ( 11:15 AM 1:45 PM : 150 Minutes ) CSE613: Parallel Programming, Spring 2012 Date: May 11 Final Exam ( 11:15 AM 1:45 PM : 150 Minutes ) This exam will account for either 10% or 20% of your overall grade depending on your relative performance

More information

AB-267 DYNAMICS & CONTROL OF FLEXIBLE AIRCRAFT

AB-267 DYNAMICS & CONTROL OF FLEXIBLE AIRCRAFT FLÁIO SILESTRE DYNAMICS & CONTROL OF FLEXIBLE AIRCRAFT LECTURE NOTES LAGRANGIAN MECHANICS APPLIED TO RIGID-BODY DYNAMICS IMAGE CREDITS: BOEING FLÁIO SILESTRE Introduction Lagrangian Mechanics shall be

More information

Consequences of Continuity

Consequences of Continuity Consequences of Continuity James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 4, 2017 Outline 1 Domains of Continuous Functions 2 The

More information

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations

Lab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations Lab 2 Worksheet Problems Problem : Geometry and Linear Equations Linear algebra is, first and foremost, the study of systems of linear equations. You are going to encounter linear systems frequently in

More information

AM205: Assignment 2. i=1

AM205: Assignment 2. i=1 AM05: Assignment Question 1 [10 points] (a) [4 points] For p 1, the p-norm for a vector x R n is defined as: ( n ) 1/p x p x i p ( ) i=1 This definition is in fact meaningful for p < 1 as well, although

More information

Bipartite Matchings and Stable Marriage

Bipartite Matchings and Stable Marriage Bipartite Matchings and Stable Marriage Meghana Nasre Department of Computer Science and Engineering Indian Institute of Technology, Madras Faculty Development Program SSN College of Engineering, Chennai

More information

Lecture 18 April 26, 2012

Lecture 18 April 26, 2012 6.851: Advanced Data Structures Spring 2012 Prof. Erik Demaine Lecture 18 April 26, 2012 1 Overview In the last lecture we introduced the concept of implicit, succinct, and compact data structures, and

More information