SlideShare a Scribd company logo
1 of 17
Download to read offline
Machine Learning Practical
Part 2
MLP Lecture 10 MLP Part 2 1
MLP Part 2
Steve Renals
Machine Learning Practical — MLP Lecture 10
18 January 2017
http://www.inf.ed.ac.uk/teaching/courses/mlp/
MLP Lecture 10 MLP Part 2 2
MLP in Semester 2
Lectures
One introductory lecture (today)
Four guest lectures (weeks 2-5: 25 January / 1 February / 8
February / 15 February)
Labs
Weekly labs - six sessions, choose one at
http://doodle.com/poll/dy78erdey4twhk7c
Same place (Forrest Hill 3.D01), some times changed
Content
Moving away from MNIST, work on one of two datasets in
image recognition (CIFAR-10/100) or music (Million Song
Database).
Moving away from the MLP software framework to TensorFlow
(https://www.tensorflow.org)
MLP Lecture 10 MLP Part 2 3
Using Different Data
Although MNIST is an interesting, standard data set it has
limitations
Constrained task, results in high accuracy classifiers (quite
possible to get 99% with standard approaches)
So model/algorithm advances may result in only very small
changes
(But even in 2016 major conferences like NIPS still had plenty
of papers presenting results on MNIST)
What are we looking for in a dataset for part two of MLP
Large enough to be interesting, small enough to be
computationally feasible for the course
Not necessarily image recogniton.... definitely not digit
recognition
Clear task, ideally with published results
MLP Lecture 10 MLP Part 2 4
Choose one!
CIFAR-10/100 (object recognition in images) –
https://www.cs.toronto.edu/~kriz/cifar.html
(much harder task than MNIST)
Million song dataset (audio features and metadata for a
million contemporary popular music tracks) –
http://labrosa.ee.columbia.edu/millionsong/
(Note: you don’t need to immediately start downloading these
datasets, we’ll provide versions that you can use, will be explained
in lab 9)
MLP Lecture 10 MLP Part 2 5
CIFAR-10
https://www.cs.toronto.edu/~kriz/cifar.html
CIFAR-10 is a very well-studied dataset for object recognition
in images.
The data
60,000 colour images (32x32 pixels)
10 object classes – 6,000 examples of each class (5,000
training, 1,000 test)
Collected at University of Toronto as a labelled subset of the
MIT 80 million tiny images dataset
(http://people.csail.mit.edu/torralba/tinyimages/)
CIFAR-100 – similar to CIFAR-10, but 100 classes and 600
examples per class (500 training, 100 test)
Many results on CIFAR-10 and CIFAR-100 collected at
http://rodrigob.github.io/are_we_there_yet/build/
classification_datasets_results.html
CIFAR-10 – approx up to 95% correct
CIFAR-100 – approax up to 75% correct
MLP Lecture 10 MLP Part 2 6
CIFAR-10
MLP Lecture 10 MLP Part 2 7
CIFAR-10 vs MNIST
Similarities:
spatial data
small images
10-class classification
50k training images
Differences:
much greater diversity across images of e.g. ’truck’
compared with e.g. ’9’
colour images
MLP Lecture 10 MLP Part 2 8
Million Song Dataset
http://labrosa.ee.columbia.edu/millionsong/
Contains precomputed features and metadata (labels) for a
million songs
Several possible tasks, using subsets of the data – we will
focus on genre classification of a subset of the data
Acoustic features:
Each song represented by a sequence of segments – roughly
each segment corresponds to a note, variable number of
segments in a song
Each segment represented by a fixed size feature vector
containing information relating to pitch (chroma), timbre
(MFCCs), loudness, duration.
The specific task and test/training sets are much less standard
compared to CIFAR-10, wide range of reported results
MLP Lecture 10 MLP Part 2 9
Song classification
Requires temporal modelling – can train a network to label
each segment, but the task requires a label per song (not per
segment)
Possible approaches
Transform variable length sequence of segments into a
fixed-dimension “supervector”, and then classify
Classify each segment then use some kind of temporal model
to generate a song-level classification
Train a network which maps an input sequence (variable
length) to a single classification (e.g. recurrent network)
MLP Lecture 10 MLP Part 2 10
TensorFlow
https://www.tensorflow.org
Overview
TensorFlow is an open source software library for numerical
computation using data flow graphs.
Nodes in the graph represent mathematical operations, while the
graph edges represent the multidimensional data arrays (tensors)
communicated between them.
Flexible, portable, efficient
Automatic differentiation
Python interface
MLP Lecture 10 MLP Part 2 11
Basics of TensorFlow
https://www.tensorflow.org/get_started/basic_usage
TensorFlow represents computations as graphs where the
nodes are mathematical operations (add, multiply, ...) and the
edges are data (multidimension arrays or tensors)
Build a graph that multiplies a 1x2 matrix with a 2x1 matrix:
import tensorflow as tf
matrix1 = tf.constant([[3., 3.]])
matrix2 = tf.constant([[2.],[2.]])
product = tf.matmul(matrix1, matrix2)
Run the graph in a session
with tf.Session() as sess:
result = sess.run(product)
MLP Lecture 10 MLP Part 2 12
Other basic concepts
Variables – tensors which maintain state across executions of
a graph (e.g. weights and biases of a network)
Placeholders – rather than specifying tensors directly, allow
them to feed into the graph as an argument to the run call
(e.g. input data for a network)
Training a single layer network for MNIST – example in lab 8
MLP Lecture 10 MLP Part 2 13
Build a single-layer network for MNIST (lab 8)
inputs = tf.placeholder(tf.float32, [None, 784], ’inputs’)
targets = tf.placeholder(tf.float32, [None, 10], ’targets’)
weights = tf.Variable(tf.zeros([784, 10]))
biases = tf.Variable(tf.zeros([10]))
outputs = tf.matmul(inputs, weights) + biases
per_datapoint_errors = tf.nn.softmax_cross_entropy_with_logits(
outputs, targets)
error = tf.reduce_mean(per_datapoint_errors)
train_step = tf.train.GradientDescentOptimizer(learning_rate=0.5).
minimize(error)
train_data = data_providers.MNISTDataProvider(’train’, batch_size=50)
valid_data = data_providers.MNISTDataProvider(’valid’, batch_size=50)
MLP Lecture 10 MLP Part 2 14
Run a single-layer network for MNIST (lab 8)
sess = tf.InteractiveSession()
init_op = tf.global_variables_initializer()
sess.run(init_op)
num_epoch = 5
for e in range(num_epoch):
running_error = 0.
for input_batch, target_batch in train_data:
_, batch_error = sess.run(
[train_step, error],
feed_dict={inputs: input_batch, targets: target_batch})
running_error += batch_error
running_error /= train_data.num_batches
MLP Lecture 10 MLP Part 2 15
Labs and coursework
After the initial lab on Introduction to TensorFlow, you will
focus on a mini-project, either
CIFAR-10/100
Million Song DataSet
Phase 1: develop baseline systems (typically DNN systems),
report results, develop plan for phase 2. Submit a report.
(weeks 3–5)
Phase 2: conduct more advanced experiments (e.g. RNN
architectures, CNN architectures, pretrainining, data
augmentation, ....). Report results and conclusions. Submit a
report. (weeks 6–8)
MLP Lecture 10 MLP Part 2 16
Semester plan
Week 2: Intorduction to TensorFlow (lab 8)
Week 3: Start work on either CIFAR-10 or Million Song
Dataset (there will be a lab to get you started for each
released end of next week)
Week 5 (16 February): Handin initial report including
baseline results and plan for future work. (“coursework 3”)
Week 8 (16 March): Handin final report, with methods,
results, discussion, and conclusions (“coursework 4”)
MLP Lecture 10 MLP Part 2 17

More Related Content

Similar to mlp10-sem2.pdf

Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...Codemotion
 
Scaling Deep Learning Algorithms on Extreme Scale Architectures
Scaling Deep Learning Algorithms on Extreme Scale ArchitecturesScaling Deep Learning Algorithms on Extreme Scale Architectures
Scaling Deep Learning Algorithms on Extreme Scale Architecturesinside-BigData.com
 
Deep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGLDeep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGLOswald Campesato
 
A Tour of Tensorflow's APIs
A Tour of Tensorflow's APIsA Tour of Tensorflow's APIs
A Tour of Tensorflow's APIsDean Wyatte
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectMatthew Gerring
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...Databricks
 
Natural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usageNatural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usagehyunyoung Lee
 
Multi-Layer Perceptrons
Multi-Layer PerceptronsMulti-Layer Perceptrons
Multi-Layer PerceptronsESCOM
 
Language translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowLanguage translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowS N
 
Using R on Netezza
Using R on NetezzaUsing R on Netezza
Using R on NetezzaAjay Ohri
 
Boosting machine learning workflow with TensorFlow 2.0
Boosting machine learning workflow with TensorFlow 2.0Boosting machine learning workflow with TensorFlow 2.0
Boosting machine learning workflow with TensorFlow 2.0Jeongkyu Shin
 
Making fitting in RooFit faster
Making fitting in RooFit fasterMaking fitting in RooFit faster
Making fitting in RooFit fasterPatrick Bos
 
Bring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone ScardapaneBring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone ScardapaneMeetupDataScienceRoma
 
Fann tool users_guide
Fann tool users_guideFann tool users_guide
Fann tool users_guideBirol Kuyumcu
 
Kevin merchantss
Kevin merchantssKevin merchantss
Kevin merchantssdharmesh69
 
KEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENTKEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENTtejas1235
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Ganesan Narayanasamy
 
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...Simplilearn
 
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...Simplilearn
 

Similar to mlp10-sem2.pdf (20)

Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
 
Scaling Deep Learning Algorithms on Extreme Scale Architectures
Scaling Deep Learning Algorithms on Extreme Scale ArchitecturesScaling Deep Learning Algorithms on Extreme Scale Architectures
Scaling Deep Learning Algorithms on Extreme Scale Architectures
 
Deep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGLDeep Learning in your Browser: powered by WebGL
Deep Learning in your Browser: powered by WebGL
 
A Tour of Tensorflow's APIs
A Tour of Tensorflow's APIsA Tour of Tensorflow's APIs
A Tour of Tensorflow's APIs
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science Project
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
 
Natural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usageNatural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usage
 
Multi-Layer Perceptrons
Multi-Layer PerceptronsMulti-Layer Perceptrons
Multi-Layer Perceptrons
 
Language translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlowLanguage translation with Deep Learning (RNN) with TensorFlow
Language translation with Deep Learning (RNN) with TensorFlow
 
Using R on Netezza
Using R on NetezzaUsing R on Netezza
Using R on Netezza
 
Boosting machine learning workflow with TensorFlow 2.0
Boosting machine learning workflow with TensorFlow 2.0Boosting machine learning workflow with TensorFlow 2.0
Boosting machine learning workflow with TensorFlow 2.0
 
Making fitting in RooFit faster
Making fitting in RooFit fasterMaking fitting in RooFit faster
Making fitting in RooFit faster
 
Bring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone ScardapaneBring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone Scardapane
 
Fann tool users_guide
Fann tool users_guideFann tool users_guide
Fann tool users_guide
 
Kevin merchantss
Kevin merchantssKevin merchantss
Kevin merchantss
 
KEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENTKEVIN MERCHANT DOCUMENT
KEVIN MERCHANT DOCUMENT
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
 
Matlab Manual
Matlab ManualMatlab Manual
Matlab Manual
 
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
What is TensorFlow? | Introduction to TensorFlow | TensorFlow Tutorial For Be...
 
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
TensorFlow Tutorial | Deep Learning With TensorFlow | TensorFlow Tutorial For...
 

Recently uploaded

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxShobhayan Kirtania
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 

Recently uploaded (20)

Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
The byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptxThe byproduct of sericulture in different industries.pptx
The byproduct of sericulture in different industries.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 

mlp10-sem2.pdf

  • 1. Machine Learning Practical Part 2 MLP Lecture 10 MLP Part 2 1
  • 2. MLP Part 2 Steve Renals Machine Learning Practical — MLP Lecture 10 18 January 2017 http://www.inf.ed.ac.uk/teaching/courses/mlp/ MLP Lecture 10 MLP Part 2 2
  • 3. MLP in Semester 2 Lectures One introductory lecture (today) Four guest lectures (weeks 2-5: 25 January / 1 February / 8 February / 15 February) Labs Weekly labs - six sessions, choose one at http://doodle.com/poll/dy78erdey4twhk7c Same place (Forrest Hill 3.D01), some times changed Content Moving away from MNIST, work on one of two datasets in image recognition (CIFAR-10/100) or music (Million Song Database). Moving away from the MLP software framework to TensorFlow (https://www.tensorflow.org) MLP Lecture 10 MLP Part 2 3
  • 4. Using Different Data Although MNIST is an interesting, standard data set it has limitations Constrained task, results in high accuracy classifiers (quite possible to get 99% with standard approaches) So model/algorithm advances may result in only very small changes (But even in 2016 major conferences like NIPS still had plenty of papers presenting results on MNIST) What are we looking for in a dataset for part two of MLP Large enough to be interesting, small enough to be computationally feasible for the course Not necessarily image recogniton.... definitely not digit recognition Clear task, ideally with published results MLP Lecture 10 MLP Part 2 4
  • 5. Choose one! CIFAR-10/100 (object recognition in images) – https://www.cs.toronto.edu/~kriz/cifar.html (much harder task than MNIST) Million song dataset (audio features and metadata for a million contemporary popular music tracks) – http://labrosa.ee.columbia.edu/millionsong/ (Note: you don’t need to immediately start downloading these datasets, we’ll provide versions that you can use, will be explained in lab 9) MLP Lecture 10 MLP Part 2 5
  • 6. CIFAR-10 https://www.cs.toronto.edu/~kriz/cifar.html CIFAR-10 is a very well-studied dataset for object recognition in images. The data 60,000 colour images (32x32 pixels) 10 object classes – 6,000 examples of each class (5,000 training, 1,000 test) Collected at University of Toronto as a labelled subset of the MIT 80 million tiny images dataset (http://people.csail.mit.edu/torralba/tinyimages/) CIFAR-100 – similar to CIFAR-10, but 100 classes and 600 examples per class (500 training, 100 test) Many results on CIFAR-10 and CIFAR-100 collected at http://rodrigob.github.io/are_we_there_yet/build/ classification_datasets_results.html CIFAR-10 – approx up to 95% correct CIFAR-100 – approax up to 75% correct MLP Lecture 10 MLP Part 2 6
  • 7. CIFAR-10 MLP Lecture 10 MLP Part 2 7
  • 8. CIFAR-10 vs MNIST Similarities: spatial data small images 10-class classification 50k training images Differences: much greater diversity across images of e.g. ’truck’ compared with e.g. ’9’ colour images MLP Lecture 10 MLP Part 2 8
  • 9. Million Song Dataset http://labrosa.ee.columbia.edu/millionsong/ Contains precomputed features and metadata (labels) for a million songs Several possible tasks, using subsets of the data – we will focus on genre classification of a subset of the data Acoustic features: Each song represented by a sequence of segments – roughly each segment corresponds to a note, variable number of segments in a song Each segment represented by a fixed size feature vector containing information relating to pitch (chroma), timbre (MFCCs), loudness, duration. The specific task and test/training sets are much less standard compared to CIFAR-10, wide range of reported results MLP Lecture 10 MLP Part 2 9
  • 10. Song classification Requires temporal modelling – can train a network to label each segment, but the task requires a label per song (not per segment) Possible approaches Transform variable length sequence of segments into a fixed-dimension “supervector”, and then classify Classify each segment then use some kind of temporal model to generate a song-level classification Train a network which maps an input sequence (variable length) to a single classification (e.g. recurrent network) MLP Lecture 10 MLP Part 2 10
  • 11. TensorFlow https://www.tensorflow.org Overview TensorFlow is an open source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them. Flexible, portable, efficient Automatic differentiation Python interface MLP Lecture 10 MLP Part 2 11
  • 12. Basics of TensorFlow https://www.tensorflow.org/get_started/basic_usage TensorFlow represents computations as graphs where the nodes are mathematical operations (add, multiply, ...) and the edges are data (multidimension arrays or tensors) Build a graph that multiplies a 1x2 matrix with a 2x1 matrix: import tensorflow as tf matrix1 = tf.constant([[3., 3.]]) matrix2 = tf.constant([[2.],[2.]]) product = tf.matmul(matrix1, matrix2) Run the graph in a session with tf.Session() as sess: result = sess.run(product) MLP Lecture 10 MLP Part 2 12
  • 13. Other basic concepts Variables – tensors which maintain state across executions of a graph (e.g. weights and biases of a network) Placeholders – rather than specifying tensors directly, allow them to feed into the graph as an argument to the run call (e.g. input data for a network) Training a single layer network for MNIST – example in lab 8 MLP Lecture 10 MLP Part 2 13
  • 14. Build a single-layer network for MNIST (lab 8) inputs = tf.placeholder(tf.float32, [None, 784], ’inputs’) targets = tf.placeholder(tf.float32, [None, 10], ’targets’) weights = tf.Variable(tf.zeros([784, 10])) biases = tf.Variable(tf.zeros([10])) outputs = tf.matmul(inputs, weights) + biases per_datapoint_errors = tf.nn.softmax_cross_entropy_with_logits( outputs, targets) error = tf.reduce_mean(per_datapoint_errors) train_step = tf.train.GradientDescentOptimizer(learning_rate=0.5). minimize(error) train_data = data_providers.MNISTDataProvider(’train’, batch_size=50) valid_data = data_providers.MNISTDataProvider(’valid’, batch_size=50) MLP Lecture 10 MLP Part 2 14
  • 15. Run a single-layer network for MNIST (lab 8) sess = tf.InteractiveSession() init_op = tf.global_variables_initializer() sess.run(init_op) num_epoch = 5 for e in range(num_epoch): running_error = 0. for input_batch, target_batch in train_data: _, batch_error = sess.run( [train_step, error], feed_dict={inputs: input_batch, targets: target_batch}) running_error += batch_error running_error /= train_data.num_batches MLP Lecture 10 MLP Part 2 15
  • 16. Labs and coursework After the initial lab on Introduction to TensorFlow, you will focus on a mini-project, either CIFAR-10/100 Million Song DataSet Phase 1: develop baseline systems (typically DNN systems), report results, develop plan for phase 2. Submit a report. (weeks 3–5) Phase 2: conduct more advanced experiments (e.g. RNN architectures, CNN architectures, pretrainining, data augmentation, ....). Report results and conclusions. Submit a report. (weeks 6–8) MLP Lecture 10 MLP Part 2 16
  • 17. Semester plan Week 2: Intorduction to TensorFlow (lab 8) Week 3: Start work on either CIFAR-10 or Million Song Dataset (there will be a lab to get you started for each released end of next week) Week 5 (16 February): Handin initial report including baseline results and plan for future work. (“coursework 3”) Week 8 (16 March): Handin final report, with methods, results, discussion, and conclusions (“coursework 4”) MLP Lecture 10 MLP Part 2 17