Top Banner
Agile Deep Learning David Murgatroyd (@dmurga)
56

Agile Deep Learning

Jan 28, 2018

Download

Technology

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: Agile Deep Learning

Agile Deep LearningDavid Murgatroyd (@dmurga)

Page 2: Agile Deep Learning

@dmurga

Page 3: Agile Deep Learning

@dmurga

Page 4: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 5: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 6: Agile Deep Learning

@dmurga

If a typical person can do a mental task with less than one second of thought, we can

probably automate it using AI either now or in the near future.

- Andrew Ng, HBR Nov 2016

Identifying a Problem: Perception

Page 7: Agile Deep Learning

@dmurga

For any concrete, repeated event that we observe, we can reasonably try to predict the

outcome of the next such event. - Andrew Ng, NIPS 2016

Identifying a Problem: Prediction

Page 8: Agile Deep Learning

@dmurga

If a desire for content is shared by many individuals but should be met in ways specific to each of them, we can probably automate

satisfying those desires with AI.- (yours truly, today :-)

Identifying a Problem: Personalization

Page 9: Agile Deep Learning

@dmurga

Page 10: Agile Deep Learning

@dmurga

Page 11: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 12: Agile Deep Learning

@dmurga

Need both:Offline: for quick experimentation -- model training and quality analysisOnline: for monitoring alignment with business goals

Identifying Metrics

Page 13: Agile Deep Learning

@dmurga

Art of identifying some part of signal to try to predict it.

Example ways to identify signal:‣ Create it directly: humans annotate the right output.‣ Usage of feature: predict historical usage from data prior to it.‣ Usage of other features: identify other ways users satisfied need.‣ Outside product: predict related data in the same domain.

Identifying Metrics: Offline

Page 14: Agile Deep Learning

@dmurga

Usage metrics:‣ How many users?‣ How much do they use it?‣ How often do they use it?‣ How do they use it?

Explicit feedback metrics:‣ Thumbs up or down, etc.

Identifying Metrics: Online

Page 15: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 16: Agile Deep Learning

@dmurga

Concrete data is the way deep learning products are specified. Uses‣ Truth: start with manual generation, especially by product

manager.‣ Fodder: not the ultimate output, but valuable for training

subcomponents‣ Baseline: output of simplest solution you can think of,

worst case random.

Watch out for bias against under-represented subpopulations!

Identifying Data

Page 17: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 18: Agile Deep Learning

@dmurga

Identifying Model(s)

Quantity of data?

Structure of data?

1D Discrete

Categorical

2D+ Continuous

1D Continuous

R

U

L

E

S SVM

CRF

CNN

RNN (BiLSTM)

GAN ...ever deeper with richer attention

FF

Deep RL

Page 19: Agile Deep Learning

@dmurga

Seed with pre-trained models from similar tasks.

Consider other properties of model’s output:‣ interpretable‣ confidence scores‣ time / space performance

Identifying Model(s)

Page 20: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 21: Agile Deep Learning

@dmurga

Explore

Page 22: Agile Deep Learning

@dmurga

Experiment

Page 23: Agile Deep Learning

@dmurga

Experiment

Gradually increase:‣ Amount of data used to train / dev‣ Amount of data used to test‣ Complexity of model

Page 24: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 25: Agile Deep Learning

@dmurga

Analyze: Bugs v. Errors

‣ Error: incorrect output from a model despite the model being correctly implemented. Egregious examples are “howlers” or “WTFs”.

‣ Bug: implementation does something other than what was intended

This distinction is useful for managing expectations about cost of addressing.

Bug Error

Page 26: Agile Deep Learning

@dmurga

Analyze: Isolate functional tests

Options:

Black-box style: ensure “can’t be wrong” (“earmark”) input/output pairs. Might lead to spurious test failures.

Page 27: Agile Deep Learning

@dmurga

Analyze: Isolate functional tests

Options:

Black-box style: ensure “can’t be wrong” (“earmark”) input/output pairs. Might lead to spurious test failures.

Clear-box style: use a mock implementation of the model that produces expected answers.

Page 28: Agile Deep Learning

@dmurga

Analyze: Automate all tests

Deep Learning’s dependence on data means changing anything changes everything.

Look at aggregate results across data sets to gauge importance.

Page 29: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 30: Agile Deep Learning

@dmurga

Prioritize

Page 31: Agile Deep Learning

@dmurga

High training error?

More training epochs Bigger / new model

Page 32: Agile Deep Learning

@dmurga

High development error? (train error OK)

Page 33: Agile Deep Learning

@dmurga

High development error?

More data Regularize / new model

Dev errorDev error

Page 34: Agile Deep Learning

@dmurga

High evaluation error? (train/dev OK)

Get more development data similar to test data so you can return to the

“High development error?” step.

Page 35: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 36: Agile Deep Learning

@dmurga

Kinds of overrides:‣ Always give this answer.‣ Never give this answer.

Beware of ‘whack a mole’.

Be sad when overrides are used.

Productize: Overrides

Page 37: Agile Deep Learning

@dmurga

Productize: How and when to scale

Move from data parallelism to model parallelism as there’s first more data then more complex models.

Only scale rest of product when you’re sure what problem you’re solving.

Page 38: Agile Deep Learning

@dmurga

Productize: Milestones

1. By hand examples2. Glued-together with some rules

(Prototype)3. Functions on some data (“Labs” /

Alpha)4. Measurable & inspectable (0.1% /

early Beta)5. Accurate, not slow, nice demo,

documented & configurable (1% / late Beta)

6. Simple & fast (100% / GA)7. Handle new domains (post-100%

/ post-GA)

Page 39: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning: Early Iterations (Spikes)

Page 40: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning: Middle Sprints

Page 41: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning: Late Sprints

Page 42: Agile Deep Learning

@dmurga

IdentifyProblem

Identify Metrics

IdentifyData

IdentifyModel(s)

Explore & Experiment Analyze Prioritize Productize

Agile Deep Learning

Page 43: Agile Deep Learning

Thanks! Questions?

David Murgatroyd (@dmurga)

Suggestions:

Pros and cons of different team organizations strategies?

What are the different roles in a Deep Learning oriented group?

Does Scrum or Kanban work better for Deep Learning?

What about “presentation bias” for measuring on historic data?

We’re hiring in Boston, NYC, and Stockholm!

Page 44: Agile Deep Learning

Appendix

David Murgatroyd (@dmurga)

Page 45: Agile Deep Learning

How does deep learning affect team organization?

45

Machine Learning Expert

Page 46: Agile Deep Learning

Encourages alignment with business goals.

Challenges machine learning collaboration, depth and reuse.

Best for products with many small, simpler models.

Option 1: integrated teams with cross-team groups (chapters!)

46

Page 47: Agile Deep Learning

Encourages machine learning collaboration, depth and reuse.

Challenges alignment with business goals.

Best for products with fewer large, complex model(s).

Option 2: independent machine learning team delivering models

47

Page 48: Agile Deep Learning

Just one kind of ML Expert?

48

Machine Learning Expert

Page 49: Agile Deep Learning

Machine Learning Expert

49

Page 50: Agile Deep Learning

50

Page 51: Agile Deep Learning

Carpenters

Blacksmiths

Miners51

Page 52: Agile Deep Learning

52

An Applied Machine Learning Engineer:● crafts specific (parts of) products ● by applying tools (e.g., libraries) ● to materials (e.g., data)

with an understanding of what sort of product is desired.

Carpenters

Page 53: Agile Deep Learning

53

A Machine Learning Toolist (Engineer/Scientist):● implements practical machine learning ideas into

industrial-strength tools (like a blacksmith firing metal into carpentry tools)

● understands the latest in ML theory and prototypes to see what’s practical (like a blacksmith smelting ore into metal)

Blacksmiths

Page 54: Agile Deep Learning

54

An Machine Learning Theoretician:● distills new material from nature to be made into tools● understands the fundamental characteristics of that material to inform its use

Miners

Page 55: Agile Deep Learning

Carpenters

Blacksmiths

Miners55

Page 56: Agile Deep Learning

CarpentersApplied ML Eng

BlacksmithsML Toolist

MinersML Theoretician

56