SlideShare a Scribd company logo
1 of 17
Download to read offline
Machine Teaching
The inverse problem of machine learning
Yi-Fan Liou
Distillation
• Model distillation
– Classical method
– Annoying teacher
• Dataset distillation
– CVPR2018
• FAIR
– ICLR2019
• …..a sad story……
Machine Teaching
“Machine Teaching: An Inverse Problem to Machine Learning and an Approach Toward Optimal
Education”
D 屬於 𝔻,同時可以透過A投射到Θ。
我們已經知道在Θ有一組參數𝜃 ∗是可以
明確找出在𝔻當中特定的dataset,我們
能不能找出這個A-1
目標:
如果可以找出一組特定資料對應到最佳模型
,我們就能拿這些資料來訓練出另外一台機
器。
Distilling knowledge in a neural network
Teacher net
student net
劉阿帆
劉阿華
金阿武
Ground truth
Results can use:
1. Softmax with
temperature
2. Logits (better)
results
loss
loss
Teacher nets are thought to lean
much “empirical” information which
would contain in the categories not
activated.
Perturbation the logits
would be better.
“Deep Model Compression: Distilling
Knowledge from Noisy Teachers”
https://arxiv.org/pdf/1610.09650.pdf
Teaching assistant
“Improved Knowledge Distillation via Teacher Assistant: Bridging the Gap Between
Student and Teacher”, https://arxiv.org/pdf/1902.03393.pdf
1. When the power of teachers increase,
the student did not have more power.
2. Enlarging the size of student, the power
is still not increased.
Teacher net Student net
Teaching assistant
net 1
Teaching assistant
net 2
Traditional
method
Directly
training
Using several intermediated size
neural networks (TA nets)
Dataset Distillation – CVPR2018
The comparism of model distillation and dataset
distillation.
“Data Distillation: Towards Omni-Supervised Learning”, CVPR2018
Status:
If you have only limited labeled dataset, and much unlabeled
dataset
Labeled
dataset
Model
1Model
1
Model
n
Train several models using the same
dataset
unlabele
d dataset
Model
1Model
1
Model
n
Labeling the unlabeled dataset using existing
models. Hence, you will have several copy answers
with the same dataset.
unlabele
d dataset
unlabele
d dataset
labeled
dataset
New
model
Training a
new model
omni-supervised learning
Data Distillation – MIT & FAIR & UC
Berkley
https://openreview.net/forum?id=Sy4lojC9tm
x = {d, t}
d => features
T => label
Learning
rate is
learnable
෤𝑥
We will train these
tensors. The number
of the the tensors
must be larger than
the “target classes”
𝜃0
The 𝜃0 is sampled
from specific
distribution.
You can sample this
every time or just
using fixed weights.
target
answe
r
predicted
answer
loss
x
𝜃1 loss
Adjust the q
Adjust the ෤𝑥
p(q0):
1. Random init
2. Fixed init
3. pretrained
Data distillation - applications
Poisoning images
Fixed initialization
Random initialization
The Dataset module of Tensorflow
The environment setting
• Tensorflow
– Version : 1.13.0
– CUDA 10
– Python 3.6
• Why Dataset module
– The dataset manipulating often cost 80% of the source code.
– Some skills is regular, such as the “training-validation-test” datasets
creating, dataset mapping, etc.
– These routing operations can be merge into some module
The basic concept of the Dataset module
• Class
– Dataset
• The basic container for storage data for further usage
– Iterator
• Access the data
• Functions
– make_make_one_shot_iterator: the elements will be used only once; needn’t initialization.
– make_initializable_iterator : the dataset can be reused by setting new parameters
– Options
• Providing the information of tf.data.Dataset
– FixedLengthRecordDataset
• Mainly designing for binary filesTFRecordDataset
• Handling the data with TFRecorder
– TextLineDataset
• Handling the text data
Dataset architecture
dataset
Element 1
Element 2
Element 3
……..
Element n
Each element has the same structure, like:
(Img 1, label 1)
(img 2, label 2)
……
(img n, label n)
The Dataset module use
pieces of whole dataset
1. We need to cut the whole
data into small pieces.
2. tf.data.Dataset.from_tensor
_slices help use to
complete this mission
which will unfold the
tensors by dimension 0.
for example:
Shape: (3,4,5)
from_tensor_slices
Shape: (4,5)
Shape: (4,5)
Shape: (4,5)
You can do anything, like
creating data batch or
mapping the piecies into
some functions.
Because this is the
smallest unit.
https://www.tensorflow.org/guide/datasets
https://www.tensorflow.org/api_docs/python/tf/data/Dataset
Dataset 幾個基本操作
定義data source。先製作一個
shape為[3,4,5]的tensor。
切成slice放到dataset物件中。
初始化Dataset的iterator,並定義
取用element的操作子。
使用以前記得初始化Dataset一下
。
實用的進階操作- feedable dataset
可以一次就把所有資料餵進去,再用
dataset來切資料
使用方法都相同,也可以直接設定
batch size。這樣可以一次fetch不只
一個elements。
initial的時候就要提供餵了甚麼資料進
去,這個operator才能啟動。
The other practical operators
• map()
– Transforming the input tensors to other tensor by specific function (usually use lambda simply)
• repeat()
– Since the iterator will stop at the end, if we want to train for many epochs:
dataset = dataset.repeat(10) #repeat dataset 10 times, you can train this for 10 epochs
dataset = dataset.repeat() #repeat infinity times. this would save the work of re-initialize dataset.
• shuffle()
– randomly shuffle dataset would be needed for each epoch, so
dataset = dataset.shuffle(buffer_size=100) # large buffering size makes more random
• tf.contrib.data.shuffle_and_repeat
– repeat() will give infinity accessing right. But shuffle_and_repeat() can give the shuffle function
before the next repeating.
dataset = dataset.apply(tf.contrib.data.shuffle_and_repeat(buffer_size=100))
• batch()
– setting the element fetch numbers
• dataset = dataset.batch(5, True) # fetch 5 elements per time. abandon the last batch
– 因為最後一個Batch常常都是未滿batch size的數量,例如上面的例子就是有可能會少於5個。如果不捨棄就用False(default)
Dataset Prefetch
• The issue to the original dataset module is the computing
resources wasting
https://www.tensorflow.org/guide/performance/datasets
if we asynchronized the thread,
the idle time of CPU/GPU would
be less
How to
dataset = dataset.batch(batch_size=FLAGS.batch_size)
return dataset
dataset = dataset.batch(batch_size=FLAGS.batch_size)
dataset =
dataset.prefetch(buffer_size=FLAGS.prefetch_buffer_size)
return dataset
Machine teaching tbo_20190518

More Related Content

What's hot

Scikit-Learn: Machine Learning in Python
Scikit-Learn: Machine Learning in PythonScikit-Learn: Machine Learning in Python
Scikit-Learn: Machine Learning in PythonMicrosoft
 
GBM package in r
GBM package in rGBM package in r
GBM package in rmark_landry
 
Introduction to neural networks and Keras
Introduction to neural networks and KerasIntroduction to neural networks and Keras
Introduction to neural networks and KerasJie He
 
TensorFlow and Keras: An Overview
TensorFlow and Keras: An OverviewTensorFlow and Keras: An Overview
TensorFlow and Keras: An OverviewPoo Kuan Hoong
 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural NetworksDatabricks
 
Introduction to Machine Learning in Python using Scikit-Learn
Introduction to Machine Learning in Python using Scikit-LearnIntroduction to Machine Learning in Python using Scikit-Learn
Introduction to Machine Learning in Python using Scikit-LearnAmol Agrawal
 
Basic ideas on keras framework
Basic ideas on keras frameworkBasic ideas on keras framework
Basic ideas on keras frameworkAlison Marczewski
 
Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)Oswald Campesato
 
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...Altoros
 
Deep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlowDeep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlowOswald Campesato
 
Introduction to Deep Learning with Python
Introduction to Deep Learning with PythonIntroduction to Deep Learning with Python
Introduction to Deep Learning with Pythonindico data
 
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
An Introduction to Supervised Machine Learning and Pattern Classification: Th...An Introduction to Supervised Machine Learning and Pattern Classification: Th...
An Introduction to Supervised Machine Learning and Pattern Classification: Th...Sebastian Raschka
 
Introduction to Machine Learning with Python and scikit-learn
Introduction to Machine Learning with Python and scikit-learnIntroduction to Machine Learning with Python and scikit-learn
Introduction to Machine Learning with Python and scikit-learnMatt Hagy
 
Deep Learning with PyTorch
Deep Learning with PyTorchDeep Learning with PyTorch
Deep Learning with PyTorchMayur Bhangale
 
Mahoney mlconf-nov13
Mahoney mlconf-nov13Mahoney mlconf-nov13
Mahoney mlconf-nov13MLconf
 
VAE-type Deep Generative Models
VAE-type Deep Generative ModelsVAE-type Deep Generative Models
VAE-type Deep Generative ModelsKenta Oono
 
PyTorch for Deep Learning Practitioners
PyTorch for Deep Learning PractitionersPyTorch for Deep Learning Practitioners
PyTorch for Deep Learning PractitionersBayu Aldi Yansyah
 
Introduction to Neural Networks in Tensorflow
Introduction to Neural Networks in TensorflowIntroduction to Neural Networks in Tensorflow
Introduction to Neural Networks in TensorflowNicholas McClure
 

What's hot (20)

Scikit-Learn: Machine Learning in Python
Scikit-Learn: Machine Learning in PythonScikit-Learn: Machine Learning in Python
Scikit-Learn: Machine Learning in Python
 
GBM package in r
GBM package in rGBM package in r
GBM package in r
 
Introduction to neural networks and Keras
Introduction to neural networks and KerasIntroduction to neural networks and Keras
Introduction to neural networks and Keras
 
TensorFlow and Keras: An Overview
TensorFlow and Keras: An OverviewTensorFlow and Keras: An Overview
TensorFlow and Keras: An Overview
 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural Networks
 
TensorFlow in 3 sentences
TensorFlow in 3 sentencesTensorFlow in 3 sentences
TensorFlow in 3 sentences
 
Introduction to Machine Learning in Python using Scikit-Learn
Introduction to Machine Learning in Python using Scikit-LearnIntroduction to Machine Learning in Python using Scikit-Learn
Introduction to Machine Learning in Python using Scikit-Learn
 
Basic ideas on keras framework
Basic ideas on keras frameworkBasic ideas on keras framework
Basic ideas on keras framework
 
Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)
 
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
Deep Learning with TensorFlow: Understanding Tensors, Computations Graphs, Im...
 
Deep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlowDeep Learning, Keras, and TensorFlow
Deep Learning, Keras, and TensorFlow
 
Introduction to Deep Learning with Python
Introduction to Deep Learning with PythonIntroduction to Deep Learning with Python
Introduction to Deep Learning with Python
 
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
An Introduction to Supervised Machine Learning and Pattern Classification: Th...An Introduction to Supervised Machine Learning and Pattern Classification: Th...
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
 
Introduction to Machine Learning with Python and scikit-learn
Introduction to Machine Learning with Python and scikit-learnIntroduction to Machine Learning with Python and scikit-learn
Introduction to Machine Learning with Python and scikit-learn
 
Deep Learning with PyTorch
Deep Learning with PyTorchDeep Learning with PyTorch
Deep Learning with PyTorch
 
Mahoney mlconf-nov13
Mahoney mlconf-nov13Mahoney mlconf-nov13
Mahoney mlconf-nov13
 
VAE-type Deep Generative Models
VAE-type Deep Generative ModelsVAE-type Deep Generative Models
VAE-type Deep Generative Models
 
PyTorch for Deep Learning Practitioners
PyTorch for Deep Learning PractitionersPyTorch for Deep Learning Practitioners
PyTorch for Deep Learning Practitioners
 
Introduction to Neural Networks in Tensorflow
Introduction to Neural Networks in TensorflowIntroduction to Neural Networks in Tensorflow
Introduction to Neural Networks in Tensorflow
 
Siamese networks
Siamese networksSiamese networks
Siamese networks
 

Similar to Machine teaching tbo_20190518

How to Build a Neural Network and Make Predictions
How to Build a Neural Network and Make PredictionsHow to Build a Neural Network and Make Predictions
How to Build a Neural Network and Make PredictionsDeveloper Helps
 
Analysis using r
Analysis using rAnalysis using r
Analysis using rPriya Mohan
 
UNIT_5_Data Wrangling.pptx
UNIT_5_Data Wrangling.pptxUNIT_5_Data Wrangling.pptx
UNIT_5_Data Wrangling.pptxBhagyasriPatel2
 
CS301-lec01.ppt
CS301-lec01.pptCS301-lec01.ppt
CS301-lec01.pptomair31
 
Machine Learning for Incident Detection: Getting Started
Machine Learning for Incident Detection: Getting StartedMachine Learning for Incident Detection: Getting Started
Machine Learning for Incident Detection: Getting StartedSqrrl
 
Getting started with Machine Learning
Getting started with Machine LearningGetting started with Machine Learning
Getting started with Machine LearningGaurav Bhalotia
 
Data structures cs301 power point slides lecture 01
Data structures   cs301 power point slides lecture 01Data structures   cs301 power point slides lecture 01
Data structures cs301 power point slides lecture 01shaziabibi5
 
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
 
Computer Vision for Beginners
Computer Vision for BeginnersComputer Vision for Beginners
Computer Vision for BeginnersSanghamitra Deb
 
in5490-classification (1).pptx
in5490-classification (1).pptxin5490-classification (1).pptx
in5490-classification (1).pptxMonicaTimber
 
Elag 2012 - Under the hood of 3TU.Datacentrum.
Elag 2012 - Under the hood of 3TU.Datacentrum.Elag 2012 - Under the hood of 3TU.Datacentrum.
Elag 2012 - Under the hood of 3TU.Datacentrum.Egbert Gramsbergen
 
Start machine learning in 5 simple steps
Start machine learning in 5 simple stepsStart machine learning in 5 simple steps
Start machine learning in 5 simple stepsRenjith M P
 
ML crash course
ML crash courseML crash course
ML crash coursemikaelhuss
 

Similar to Machine teaching tbo_20190518 (20)

How to Build a Neural Network and Make Predictions
How to Build a Neural Network and Make PredictionsHow to Build a Neural Network and Make Predictions
How to Build a Neural Network and Make Predictions
 
Analysis using r
Analysis using rAnalysis using r
Analysis using r
 
UNIT_5_Data Wrangling.pptx
UNIT_5_Data Wrangling.pptxUNIT_5_Data Wrangling.pptx
UNIT_5_Data Wrangling.pptx
 
CS301-lec01.ppt
CS301-lec01.pptCS301-lec01.ppt
CS301-lec01.ppt
 
Data Structure Lec #1
Data Structure Lec #1Data Structure Lec #1
Data Structure Lec #1
 
Machine Learning for Incident Detection: Getting Started
Machine Learning for Incident Detection: Getting StartedMachine Learning for Incident Detection: Getting Started
Machine Learning for Incident Detection: Getting Started
 
Getting started with Machine Learning
Getting started with Machine LearningGetting started with Machine Learning
Getting started with Machine Learning
 
ifip2008albashiri.pdf
ifip2008albashiri.pdfifip2008albashiri.pdf
ifip2008albashiri.pdf
 
Data structures cs301 power point slides lecture 01
Data structures   cs301 power point slides lecture 01Data structures   cs301 power point slides lecture 01
Data structures cs301 power point slides lecture 01
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
lec1.ppt
lec1.pptlec1.ppt
lec1.ppt
 
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
 
Computer Vision for Beginners
Computer Vision for BeginnersComputer Vision for Beginners
Computer Vision for Beginners
 
ANN - UNIT 3.pptx
ANN - UNIT 3.pptxANN - UNIT 3.pptx
ANN - UNIT 3.pptx
 
ANN - UNIT 3.pptx
ANN - UNIT 3.pptxANN - UNIT 3.pptx
ANN - UNIT 3.pptx
 
in5490-classification (1).pptx
in5490-classification (1).pptxin5490-classification (1).pptx
in5490-classification (1).pptx
 
Artificial Neural Networks , Recurrent networks , Perceptron's
Artificial Neural Networks , Recurrent networks , Perceptron'sArtificial Neural Networks , Recurrent networks , Perceptron's
Artificial Neural Networks , Recurrent networks , Perceptron's
 
Elag 2012 - Under the hood of 3TU.Datacentrum.
Elag 2012 - Under the hood of 3TU.Datacentrum.Elag 2012 - Under the hood of 3TU.Datacentrum.
Elag 2012 - Under the hood of 3TU.Datacentrum.
 
Start machine learning in 5 simple steps
Start machine learning in 5 simple stepsStart machine learning in 5 simple steps
Start machine learning in 5 simple steps
 
ML crash course
ML crash courseML crash course
ML crash course
 

Recently uploaded

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 

Recently uploaded (20)

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 

Machine teaching tbo_20190518

  • 1. Machine Teaching The inverse problem of machine learning Yi-Fan Liou
  • 2. Distillation • Model distillation – Classical method – Annoying teacher • Dataset distillation – CVPR2018 • FAIR – ICLR2019 • …..a sad story……
  • 3. Machine Teaching “Machine Teaching: An Inverse Problem to Machine Learning and an Approach Toward Optimal Education” D 屬於 𝔻,同時可以透過A投射到Θ。 我們已經知道在Θ有一組參數𝜃 ∗是可以 明確找出在𝔻當中特定的dataset,我們 能不能找出這個A-1 目標: 如果可以找出一組特定資料對應到最佳模型 ,我們就能拿這些資料來訓練出另外一台機 器。
  • 4. Distilling knowledge in a neural network Teacher net student net 劉阿帆 劉阿華 金阿武 Ground truth Results can use: 1. Softmax with temperature 2. Logits (better) results loss loss Teacher nets are thought to lean much “empirical” information which would contain in the categories not activated. Perturbation the logits would be better. “Deep Model Compression: Distilling Knowledge from Noisy Teachers” https://arxiv.org/pdf/1610.09650.pdf
  • 5. Teaching assistant “Improved Knowledge Distillation via Teacher Assistant: Bridging the Gap Between Student and Teacher”, https://arxiv.org/pdf/1902.03393.pdf 1. When the power of teachers increase, the student did not have more power. 2. Enlarging the size of student, the power is still not increased. Teacher net Student net Teaching assistant net 1 Teaching assistant net 2 Traditional method Directly training Using several intermediated size neural networks (TA nets)
  • 6. Dataset Distillation – CVPR2018 The comparism of model distillation and dataset distillation. “Data Distillation: Towards Omni-Supervised Learning”, CVPR2018 Status: If you have only limited labeled dataset, and much unlabeled dataset Labeled dataset Model 1Model 1 Model n Train several models using the same dataset unlabele d dataset Model 1Model 1 Model n Labeling the unlabeled dataset using existing models. Hence, you will have several copy answers with the same dataset. unlabele d dataset unlabele d dataset labeled dataset New model Training a new model omni-supervised learning
  • 7. Data Distillation – MIT & FAIR & UC Berkley https://openreview.net/forum?id=Sy4lojC9tm x = {d, t} d => features T => label Learning rate is learnable ෤𝑥 We will train these tensors. The number of the the tensors must be larger than the “target classes” 𝜃0 The 𝜃0 is sampled from specific distribution. You can sample this every time or just using fixed weights. target answe r predicted answer loss x 𝜃1 loss Adjust the q Adjust the ෤𝑥 p(q0): 1. Random init 2. Fixed init 3. pretrained
  • 8. Data distillation - applications Poisoning images Fixed initialization Random initialization
  • 9. The Dataset module of Tensorflow
  • 10. The environment setting • Tensorflow – Version : 1.13.0 – CUDA 10 – Python 3.6 • Why Dataset module – The dataset manipulating often cost 80% of the source code. – Some skills is regular, such as the “training-validation-test” datasets creating, dataset mapping, etc. – These routing operations can be merge into some module
  • 11. The basic concept of the Dataset module • Class – Dataset • The basic container for storage data for further usage – Iterator • Access the data • Functions – make_make_one_shot_iterator: the elements will be used only once; needn’t initialization. – make_initializable_iterator : the dataset can be reused by setting new parameters – Options • Providing the information of tf.data.Dataset – FixedLengthRecordDataset • Mainly designing for binary filesTFRecordDataset • Handling the data with TFRecorder – TextLineDataset • Handling the text data
  • 12. Dataset architecture dataset Element 1 Element 2 Element 3 …….. Element n Each element has the same structure, like: (Img 1, label 1) (img 2, label 2) …… (img n, label n) The Dataset module use pieces of whole dataset 1. We need to cut the whole data into small pieces. 2. tf.data.Dataset.from_tensor _slices help use to complete this mission which will unfold the tensors by dimension 0. for example: Shape: (3,4,5) from_tensor_slices Shape: (4,5) Shape: (4,5) Shape: (4,5) You can do anything, like creating data batch or mapping the piecies into some functions. Because this is the smallest unit. https://www.tensorflow.org/guide/datasets https://www.tensorflow.org/api_docs/python/tf/data/Dataset
  • 14. 實用的進階操作- feedable dataset 可以一次就把所有資料餵進去,再用 dataset來切資料 使用方法都相同,也可以直接設定 batch size。這樣可以一次fetch不只 一個elements。 initial的時候就要提供餵了甚麼資料進 去,這個operator才能啟動。
  • 15. The other practical operators • map() – Transforming the input tensors to other tensor by specific function (usually use lambda simply) • repeat() – Since the iterator will stop at the end, if we want to train for many epochs: dataset = dataset.repeat(10) #repeat dataset 10 times, you can train this for 10 epochs dataset = dataset.repeat() #repeat infinity times. this would save the work of re-initialize dataset. • shuffle() – randomly shuffle dataset would be needed for each epoch, so dataset = dataset.shuffle(buffer_size=100) # large buffering size makes more random • tf.contrib.data.shuffle_and_repeat – repeat() will give infinity accessing right. But shuffle_and_repeat() can give the shuffle function before the next repeating. dataset = dataset.apply(tf.contrib.data.shuffle_and_repeat(buffer_size=100)) • batch() – setting the element fetch numbers • dataset = dataset.batch(5, True) # fetch 5 elements per time. abandon the last batch – 因為最後一個Batch常常都是未滿batch size的數量,例如上面的例子就是有可能會少於5個。如果不捨棄就用False(default)
  • 16. Dataset Prefetch • The issue to the original dataset module is the computing resources wasting https://www.tensorflow.org/guide/performance/datasets if we asynchronized the thread, the idle time of CPU/GPU would be less How to dataset = dataset.batch(batch_size=FLAGS.batch_size) return dataset dataset = dataset.batch(batch_size=FLAGS.batch_size) dataset = dataset.prefetch(buffer_size=FLAGS.prefetch_buffer_size) return dataset