Top Banner
Accelerating system simulation, identification and design with ML Alex Beatson Princeton University Department of Computer Science 1
90

Accelerating system simulation, identification and design ...

Dec 18, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Accelerating system simulation, identification and design ...

Accelerating system simulation, identification and design with ML

Alex Beatson

Princeton University Department of Computer Science

�1

Page 2: Accelerating system simulation, identification and design ...

SIMULATION AND NUMERICAL METHODS

Numerical methods enable model-based reasoning about the world.

!2

Page 3: Accelerating system simulation, identification and design ...

SIMULATION AND NUMERICAL METHODS

Numerical methods enable model-based reasoning about the world.

e.g. ODEs (solved with Euler, Runge-Kutta, …)

!3

Page 4: Accelerating system simulation, identification and design ...

SIMULATION AND NUMERICAL METHODS

!4

Numerical methods enable model-based reasoning about the world.

e.g. PDEs (solved with Finite Element Analysis, Finite Volume Method, …)

Page 5: Accelerating system simulation, identification and design ...

SIMULATION AND NUMERICAL METHODS

!5

Numerical methods enable model-based reasoning about the world.

e.g. “inner loop” of optimization or iterative methods within variational methods, meta-learning, hyperparameter optimization

Page 6: Accelerating system simulation, identification and design ...

MODEL-BASED OPTIMIZATION

!6

Numerical methods enable model-based reasoning about the world.

Optimizing the output of a numerical method with respect to system parameters allows system identification, design, and control.

Page 7: Accelerating system simulation, identification and design ...

BOTTLENECKS

• Model design and parametrization

• Numerical method implementation and tuning

• Computation

!7

Page 8: Accelerating system simulation, identification and design ...

BOTTLENECKS

• Model design and parametrization

• Numerical method implementation and tuning

• Computation

!8

Page 9: Accelerating system simulation, identification and design ...

COMMON STRUCTURE

Discretization through time, space, or iterations

Increasing accuracy with increasing computation

!9

Page 10: Accelerating system simulation, identification and design ...

GOAL

Develop ML tools which exploit this structure to accelerate system simulation, identification, and design.

!10

Page 11: Accelerating system simulation, identification and design ...

Efficient Optimization of Loops and Limits with Randomized Telescoping Sums

�11

with Ryan P. Adams

ICML 2019

Page 12: Accelerating system simulation, identification and design ...

MOTIVATION

• Optimization with inner loops‣ Meta learning, hyperparameter optimization‣ Recurrent models

• Optimization with limits‣ Discretized numerical methods: PDEs, ODEs, …‣ Iterative methods: linear systems, inverses, eigenvalues, ‣ Integration with Monte Carlo or quadrature

• In both cases..‣ cheap truncations/approximations cause harmful bias‣ accurate approximations are computationally expensive

!12

Page 13: Accelerating system simulation, identification and design ...

RANDOMIZED TELESCOPES: UNBIASED ESTIMATION OF LIMITS

Consider:

Then:

Consider an estimator:

This is unbiased iff:

!13

Page 14: Accelerating system simulation, identification and design ...

DEMONSTRATION

General form

!14

Ground truth

Page 15: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!15

Ground truth

“Single sample”

Page 16: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!16

Ground truth

“Single sample”

Page 17: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!17

Ground truth

“Single sample”

Page 18: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!18

Ground truth

“Single sample”

Page 19: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!19

Ground truth

“Single sample”

Page 20: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!20

Ground truth

“Single sample”

Page 21: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!21

Ground truth

“Single sample”

Page 22: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!22

Ground truth

“Single sample”

Page 23: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!23

Ground truth

“Single sample”

Page 24: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!24

Ground truth

“Single sample”

Page 25: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!25

Ground truth

“Single sample”

Page 26: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!26

Ground truth

“Single sample”

Page 27: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!27

Ground truth

“Single sample”

Page 28: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!28

Ground truth

“Single sample”

Page 29: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!29

Ground truth

“Single sample”

Page 30: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!30

Ground truth

“Single sample”

Page 31: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!31

Ground truth

“Single sample”

Page 32: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!32

Ground truth

“Single sample”

Page 33: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!33

Ground truth

“Single sample”

Page 34: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!34

Ground truth

“Single sample”

Page 35: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!35

Ground truth

“Single sample”

Page 36: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!36

Ground truth

“Single sample”

Page 37: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!37

Ground truth

“Single sample”

Page 38: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!38

Ground truth

“Single sample”

Page 39: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!39

Ground truth

“Single sample”

Page 40: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!40

Ground truth

“Single sample”

Page 41: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!41

Ground truth

“Single sample”

Page 42: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!42

Ground truth

“Single sample”

Page 43: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!43

Ground truth

“Single sample”

Page 44: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!44

Ground truth

“Single sample”

Page 45: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!45

Ground truth

“Single sample”

Page 46: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!46

Ground truth

“Single sample”

Page 47: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!47

Ground truth

“Single sample”

Page 48: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!48

Ground truth

“Single sample”

Page 49: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!49

Ground truth

“Single sample”

Page 50: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!50

Ground truth

“Single sample”

Page 51: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!51

Ground truth

“Single sample”

Page 52: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!52

Ground truth

“Single sample”

Page 53: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!53

Ground truth

“Single sample”

Page 54: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!54

Ground truth

“Single sample”

Page 55: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!55

Ground truth

“Single sample”

Page 56: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!56

Ground truth

“Single sample”

Page 57: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!57

Ground truth

“Single sample”

Page 58: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!58

Ground truth

“Single sample”

Page 59: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!59

Ground truth

“Single sample”

Page 60: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!60

Ground truth

“Single sample”

Page 61: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!61

Ground truth

“Single sample”

Page 62: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!62

Ground truth

“Single sample”

Page 63: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!63

Ground truth

“Single sample”

Page 64: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!64

Ground truth

“Single sample”

Page 65: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!65

Ground truth

“Single sample”

Page 66: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!66

Ground truth

“Single sample”

Page 67: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!67

Ground truth

“Single sample”

Page 68: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!68

Ground truth

“Single sample”

Page 69: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!69

Ground truth

“Single sample”

Page 70: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!70

Ground truth

“Single sample”

Page 71: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!71

Ground truth

“Single sample”

Page 72: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!72

Ground truth

“Single sample”

Page 73: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!73

Ground truth

“Single sample”

Page 74: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!74

Ground truth

“Single sample”

Page 75: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!75

Ground truth

“Single sample”

Page 76: Accelerating system simulation, identification and design ...

“Russian roulette”

DEMONSTRATION

General form

!76

Ground truth

“Single sample”

Page 77: Accelerating system simulation, identification and design ...

RANDOMIZED TELESCOPES FOR OPTIMIZATION

• Randomized telescoping estimators for optimization = SGD for limits

• Can achieve finite variance and compute for any geometrically converging sequence, or sufficiently fast polynomially converging sequences (p > 3/2).

• This means we can optimize the limit itself rather than an approximation, with provable convergence rates and anytime guarantees!

!77

Page 78: Accelerating system simulation, identification and design ...

PRACTICAL RECIPE

• Pick a (large) maximal truncation

• Estimate the convergence properties of online

• Adapt sampling probabilities and learning rate: balance computation and variance to maximize a lower bound on increase in optimization efficiency relative to maximal truncation

!78

Page 79: Accelerating system simulation, identification and design ...

EXPERIMENTS

!79

Page 80: Accelerating system simulation, identification and design ...

LIMITATIONS AND EXTENSIONS

• Does not accelerate very high-dimensional problems (e.g., optimizing an RNN): our model of suffers in high dimensions and adaptive sampling falls back on the maximal truncation

• Theory only worked out for SGD: possible extensions to Adam, quasi-Newton, …

• Use series acceleration or predictive models to accelerate convergence to the limit

!80

Page 81: Accelerating system simulation, identification and design ...

SUMO: UNBIASED ESTIMATION OF LOG MARGINAL PROBABILITY FOR LATENT VARIABLE MODELS

• In latent variable modeling we often use a “decoder” and a “recognition model”

• This leads to a lower bound on the log-likelihood

• Debiasing this estimator improves image modeling and allows latent variable models to be used when lower bounds aren’t appropriate.

!81

Submittedwith Yucen Luo, Mohammad Norouzi, Jun Zhu, David Duvenaud, Ryan P. Adams, Ricky T. Q. Chen

Page 82: Accelerating system simulation, identification and design ...

PDE Model-Order Reduction with Neural Potential Energies

�82

with Tianju Xie, Jordan Ash, Geoffrey Roeder, Ryan P. Adams

In progress

Page 83: Accelerating system simulation, identification and design ...

CELLULAR MECHANICAL META MATERIALS

!83

Overvelde & Bertoldi, 2014

Page 84: Accelerating system simulation, identification and design ...

NONLINEAR ELASTICITY PDE

!84

Page 85: Accelerating system simulation, identification and design ...

BILEVEL DECOMPOSITION

!85

Page 86: Accelerating system simulation, identification and design ...

REDUCED-ORDER MODELING WITH NEURAL POTENTIAL ENERGIES

!86

• Collect data using Fenics to solve the PDE with random imposed boundary deformations (CPU)

• Train a neural network using Pytorch to model energy in cell as function of boundary deformation (GPU)

• Goal: “tile” these surrogate energy models to efficiently solve large systems

• Tricks: train on energy derivatives (stress-strain relations) as well as values; exploit physical invariances

Page 87: Accelerating system simulation, identification and design ...

• Assume boundary deformations are smooth: represent with a small number of cubic spline control points

• Spline interpolation from control points (Pytorch vector) to target locations (Fenics vector of Finite Element coefficients) is linear: ‣ Assemble the interpolation matrix once‣ Map deformations from Pytorch to Fenics, or energy gradients

from Fenics to Pytorch, by GPU matrix multiplication

SPLINE BOUNDARY REPRESENTATION

!87

Page 88: Accelerating system simulation, identification and design ...

INVARIANCES

!88

• Translation: subtract mean of displacements along each dimension

• Rotation: rotate coordinates to align with a reference (“Procrustes analysis”, closed form)

• Flips: use polar coordinates and one-dimensional convolution

Page 89: Accelerating system simulation, identification and design ...

DISTRIBUTED TRAINING WITH RAY+AWS

!89

CPU worker: data collection

CPU worker: deployment /

evaluation

GPU driver: model training

Page 90: Accelerating system simulation, identification and design ...

THANKS!