SlideShare a Scribd company logo
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 Python
Microsoft
 
GBM package in r
GBM package in rGBM package in r
GBM package in r
mark_landry
 
Introduction to neural networks and Keras
Introduction to neural networks and KerasIntroduction to neural networks and Keras
Introduction to neural networks and Keras
Jie He
 
TensorFlow and Keras: An Overview
TensorFlow and Keras: An OverviewTensorFlow and Keras: An Overview
TensorFlow and Keras: An Overview
Poo Kuan Hoong
 
Training Neural Networks
Training Neural NetworksTraining Neural Networks
Training Neural Networks
Databricks
 
TensorFlow in 3 sentences
TensorFlow in 3 sentencesTensorFlow in 3 sentences
TensorFlow in 3 sentences
Barbara Fusinska
 
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
Amol Agrawal
 
Basic ideas on keras framework
Basic ideas on keras frameworkBasic ideas on keras framework
Basic ideas on keras framework
Alison 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 TensorFlow
Oswald Campesato
 
Introduction to Deep Learning with Python
Introduction to Deep Learning with PythonIntroduction to Deep Learning with Python
Introduction to Deep Learning with Python
indico 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-learn
Matt Hagy
 
Deep Learning with PyTorch
Deep Learning with PyTorchDeep Learning with PyTorch
Deep Learning with PyTorch
Mayur Bhangale
 
Mahoney mlconf-nov13
Mahoney mlconf-nov13Mahoney mlconf-nov13
Mahoney mlconf-nov13
MLconf
 
VAE-type Deep Generative Models
VAE-type Deep Generative ModelsVAE-type Deep Generative Models
VAE-type Deep Generative Models
Kenta Oono
 
PyTorch for Deep Learning Practitioners
PyTorch for Deep Learning PractitionersPyTorch for Deep Learning Practitioners
PyTorch for Deep Learning Practitioners
Bayu Aldi Yansyah
 
Introduction to Neural Networks in Tensorflow
Introduction to Neural Networks in TensorflowIntroduction to Neural Networks in Tensorflow
Introduction to Neural Networks in Tensorflow
Nicholas McClure
 
Siamese networks
Siamese networksSiamese networks
Siamese networks
Nicholas 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 Predictions
Developer Helps
 
Analysis using r
Analysis using rAnalysis using r
Analysis using r
Priya Mohan
 
UNIT_5_Data Wrangling.pptx
UNIT_5_Data Wrangling.pptxUNIT_5_Data Wrangling.pptx
UNIT_5_Data Wrangling.pptx
BhagyasriPatel2
 
CS301-lec01.ppt
CS301-lec01.pptCS301-lec01.ppt
CS301-lec01.ppt
omair31
 
Data Structure Lec #1
Data Structure Lec #1Data Structure Lec #1
Data Structure Lec #1
University of Gujrat, Pakistan
 
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
Sqrrl
 
Getting started with Machine Learning
Getting started with Machine LearningGetting started with Machine Learning
Getting started with Machine Learning
Gaurav Bhalotia
 
ifip2008albashiri.pdf
ifip2008albashiri.pdfifip2008albashiri.pdf
ifip2008albashiri.pdf
KamalAlbashiri
 
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
shaziabibi5
 
lec1.ppt
lec1.pptlec1.ppt
lec1.ppt
SVasuKrishna1
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
Aun Akbar
 
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
inside-BigData.com
 
Computer Vision for Beginners
Computer Vision for BeginnersComputer Vision for Beginners
Computer Vision for Beginners
Sanghamitra Deb
 
ANN - UNIT 3.pptx
ANN - UNIT 3.pptxANN - UNIT 3.pptx
ANN - UNIT 3.pptx
ANN - UNIT 3.pptxANN - UNIT 3.pptx
in5490-classification (1).pptx
in5490-classification (1).pptxin5490-classification (1).pptx
in5490-classification (1).pptx
MonicaTimber
 
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
SRM institute of Science and Technology
 
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 steps
Renjith M P
 
Data structure and algorithm with java by shikra
Data structure and algorithm  with java by shikraData structure and algorithm  with java by shikra
Data structure and algorithm with java by shikra
jateno3396
 

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
 
lec1.ppt
lec1.pptlec1.ppt
lec1.ppt
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
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
 
Data structure and algorithm with java by shikra
Data structure and algorithm  with java by shikraData structure and algorithm  with java by shikra
Data structure and algorithm with java by shikra
 

Recently uploaded

哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
yokeleetan1
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
ihlasbinance2003
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
University of Maribor
 

Recently uploaded (20)

哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Swimming pool mechanical components design.pptx
Swimming pool  mechanical components design.pptxSwimming pool  mechanical components design.pptx
Swimming pool mechanical components design.pptx
 
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
5214-1693458878915-Unit 6 2023 to 2024 academic year assignment (AutoRecovere...
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...
 

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