SlideShare a Scribd company logo
1 of 26
Tomomi Research Inc.
Tensor
: Data representation for deep learning
2018/09/21 (Fri)
Dr. Seong-Hun Choe
Tomomi Research Inc.
Agenda
9/22/2018 2©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
1. Tensor : Dimension
2. Tensor : Shape
3. Real world data : Which tensor?
Tomomi Research Inc.
Tensor
WTF is a tensor?
Remember that it is a just container for data.
the data are almost numerical data.
So, Tensor is a container for numbers.
9/22/2018 3©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
Various explanations,
but very hard to understand its concept
?
?
Tomomi Research Inc.
Keywords
9/22/2018 4©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
1. Tensor is a container of numbers.
2. Tensor is a generalization of matrices to an arbitrary number of dimensions.
3. In tensor, dimension is often called axis.
4. number of dimension (=axis) is called ranks.
Tomomi Research Inc.
1. Scalar (0D tensor)
A tensor that contains only one number is called a scalar
9/22/2018 5©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
• example : 12
dimension can be shown with ndim method.
Tomomi Research Inc.
2. Vector (1D tensor)
An array of numbers is called a vector, or 1D tensor
9/22/2018 6©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
• example : [12,3,6,14]
Tomomi Research Inc.
3. Matrix (2D tensor)
An array of vectors is a matrix, or 2D tensor
9/22/2018 7©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
• example : [[1, 3, 5, 7],
[2, 4, 6, 8],
[3 ,6, 9,12]]
Tomomi Research Inc.
4. 3D tensor
It is just nD tensor from 3D tensor.
9/22/2018 8©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
• example :[[[1, 3, 5, 7],
[2, 4, 6, 8],
[3 ,6, 9,12]],
[[1, 3, 5, 7],
[2, 4, 6, 8],
[3 ,6, 9,12]],
[[1, 3, 5, 7],
[2, 4, 6, 8],
[3 ,6, 9,12]]]
Tomomi Research Inc.
Agenda
9/22/2018 9©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
1. Tensor : Dimension
2. Tensor : Shape
3. Real world data : Which tensor?
Tomomi Research Inc.
Key attributes
9/22/2018 10©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
1. Number of dimension(=axes)
2. Shape : how many dimensions in the tensor has along each axis.
3. Data type : dtype in python, (float32, float64, unit8 and so on.)
Shape is very important in deep learning programming.
Tomomi Research Inc.
2.1. Scalar (0D tensor)
Scalar has empty shape.
9/22/2018 11©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
• example : 12
Tomomi Research Inc.
2.2 Vector (1D tensor)
1D tensor has a shape with a single element, such as (4,)
9/22/2018 12©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
• example : [12,3,6,14]
Tomomi Research Inc.
2.3. Matrix (2D tensor)
2D tensor has a shape such as (3,4). it is familiar with matrix
representation.
9/22/2018 13©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
• example : [[1, 3, 5, 7],
[2, 4, 6, 8],
[3 ,6, 9,12]]
Tomomi Research Inc.
2.4. 3D tensor
3D tensor has a shape (3, 3, 4)
9/22/2018 14©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
• example :[[[1, 3, 5, 7],
[2, 4, 6, 8],
[3 ,6, 9,12]],
[[1, 3, 5, 7],
[2, 4, 6, 8],
[3 ,6, 9,12]],
[[1, 3, 5, 7],
[2, 4, 6, 8],
[3 ,6, 9,12]]]
Tomomi Research Inc.
2.5. MNIST example
Keras & Tensorflow
9/22/2018 15©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
• loading the mnist dataset:
• dimension of train images
-> 3D tensor
• shape of train images
-> 3D tensor여서(m,n,p)의 형태
내용은、(28,28)の어레이가 60000개 있습니다. 라는
의미
• data type of train images
-> 8 bit integer
Tomomi Research Inc.
Summary (1) : Tensor
9/22/2018 16©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
dimension 0 1 2 3 4
Name Scalar Vector Matrix 3D tensor 4D tensor
Another name 0D tensor 1D tensor 2D tensor 3D tensor 4D tensor
Example 12 [12,3,6,14] …
Shape
()
empty
(4,) (3,4) (3,3,4) (5,3,3,4)
Tomomi Research Inc.
Agenda
9/22/2018 17©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
1. Tensor : Dimension
2. Tensor : Shape
3. Real world data : Which tensor?
Tomomi Research Inc.
3. Real-World examples of data as tensors
9/22/2018 18©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
Name Tensor Shape
Vector data* 2D tensor (samples, feature)
Timeseries data or
sequence data
3D tensor (samples, timesteps, features)
Images 4D tensor (samples, height, width, channels)
Video 5D tensor (samples, frames, height, width, channels)
Vector data is different with vector. vector is 1D tensor.
Tomomi Research Inc.
3.1. Vector data
2D tensor
9/22/2018 19©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
Samples Age ZIP code Income
1 12 123-324 10k
2 34 234-567 13k
3 12 349-874 20k
…
9,999 45 874-988 30k
10,000 56 888-234 12k
Example : Actual personal data,
3
10,000
Shape : (samples, feature)
= (10,000, 3)
• Numpy array
[[12, 123-324,10k],
[34,234-567,13k],
…
[56 ,888-234, 12k]]
Tomomi Research Inc.
time
(min.)
current price the highest
price
the lowest
price
0
1
2
…
390
time
(min.)
current price the highest
price
the lowest
price
0
1
2
…
390
time
(min.)
current price the highest
price
the lowest
price
0
1
2
…
390
3.2. Timeseries data or sequence data
3D tensor
9/22/2018 20©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
time
(min.)
current price the highest
price
the lowest
price
0
1
2
…
390
Example: stock price dataset (1 year)
3
390
min.
250 days
Shape : (samples, timesteps, features)
= (250, 390, 3)
Tomomi Research Inc.
3.3 Image data
4D tensor
9/22/2018 21©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
Example : A batch of 128 color images of size 256 * 256
Shape : (samples, height, width, channels)
= (128, 256, 256, 3)
Tomomi Research Inc.
3.3 Video data
5D tensor
9/22/2018 22©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
Example : 60 second, 144X 156 Youtube video clip sample at 4 fps would be 240 frames.
A batch of 4 such video clips
Shape : (samples, frames, height, width, channels)
= (4, 240, 144, 156, 3)
total = 4 * 240 * 144 * 156 * 3 = 106,168,320
if dtype of the tensor is float32,
total memory will be 405 MB!
Tomomi Research Inc.
Summary (2) : Real data
9/22/2018 23©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
Vector data
Timeseries data or
sequence data
Image data Video data
Tensor dimension 2D 3D 4D 5D
Example personal data annual stock data batch of color image batch of video frame
Example
Shape
(samples, feature)
= (10,000, 3)
(samples, timesteps, features)
= (250, 390, 3)
(samples, height, width,
channels)
= (128, 256, 256, 3)
(samples, frames, height, width,
channels)
=(4, 240, 144, 156, 3)
Tomomi Research Inc.
Tensor at Sony neural network console
9/22/2018 24©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
(samples, channels, height, width)
= (128, 1, 28, 28)
Tomomi Research Inc.
Tensor at Tensorflow
주로Placeholder를 이용해 input data를 준비할때
9/22/2018 25©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
(samples, timesteps, features)
= (?, 25, 1)
Sample수를 placeholder안에
지정하지 않을때는 、None으로 기입.
Tomomi Research Inc.
Tensor at Keras
9/22/2018 26©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential.
(samples, time_setp, features)
= (176, 25,1)

More Related Content

What's hot

Tensor 1
Tensor  1Tensor  1
Tensor 1BAIJU V
 
Machine learning in image processing
Machine learning in image processingMachine learning in image processing
Machine learning in image processingData Science Thailand
 
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...Edureka!
 
Semi supervised learning machine learning made simple
Semi supervised learning  machine learning made simpleSemi supervised learning  machine learning made simple
Semi supervised learning machine learning made simpleDevansh16
 
Variational Autoencoders For Image Generation
Variational Autoencoders For Image GenerationVariational Autoencoders For Image Generation
Variational Autoencoders For Image GenerationJason Anderson
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learningJunaid Bhat
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Gaurav Mittal
 
Convolutional neural network
Convolutional neural networkConvolutional neural network
Convolutional neural networkItachi SK
 
Image classification on Imagenet (D1L4 2017 UPC Deep Learning for Computer Vi...
Image classification on Imagenet (D1L4 2017 UPC Deep Learning for Computer Vi...Image classification on Imagenet (D1L4 2017 UPC Deep Learning for Computer Vi...
Image classification on Imagenet (D1L4 2017 UPC Deep Learning for Computer Vi...Universitat Politècnica de Catalunya
 
Image Caption Generation using Convolutional Neural Network and LSTM
Image Caption Generation using Convolutional Neural Network and LSTMImage Caption Generation using Convolutional Neural Network and LSTM
Image Caption Generation using Convolutional Neural Network and LSTMOmkar Reddy
 
20211019 When does label smoothing help_shared ver
20211019 When does label smoothing help_shared ver20211019 When does label smoothing help_shared ver
20211019 When does label smoothing help_shared verHsing-chuan Hsieh
 
Computer Vision: Correlation, Convolution, and Gradient
Computer Vision: Correlation, Convolution, and GradientComputer Vision: Correlation, Convolution, and Gradient
Computer Vision: Correlation, Convolution, and GradientAhmed Gad
 
Introduction to Visual transformers
Introduction to Visual transformers Introduction to Visual transformers
Introduction to Visual transformers leopauly
 
Computer graphics presentation
Computer graphics presentationComputer graphics presentation
Computer graphics presentationLOKENDRA PRAJAPATI
 
Generative Adversarial Networks
Generative Adversarial NetworksGenerative Adversarial Networks
Generative Adversarial NetworksMark Chang
 

What's hot (20)

Tensor 1
Tensor  1Tensor  1
Tensor 1
 
Machine learning in image processing
Machine learning in image processingMachine learning in image processing
Machine learning in image processing
 
TENSOR .pptx
TENSOR .pptxTENSOR .pptx
TENSOR .pptx
 
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
Recurrent Neural Networks (RNN) | RNN LSTM | Deep Learning Tutorial | Tensorf...
 
Semi supervised learning machine learning made simple
Semi supervised learning  machine learning made simpleSemi supervised learning  machine learning made simple
Semi supervised learning machine learning made simple
 
Meta learning tutorial
Meta learning tutorialMeta learning tutorial
Meta learning tutorial
 
Variational Autoencoders For Image Generation
Variational Autoencoders For Image GenerationVariational Autoencoders For Image Generation
Variational Autoencoders For Image Generation
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
 
Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)Convolutional Neural Networks (CNN)
Convolutional Neural Networks (CNN)
 
Convolutional neural network
Convolutional neural networkConvolutional neural network
Convolutional neural network
 
Image classification on Imagenet (D1L4 2017 UPC Deep Learning for Computer Vi...
Image classification on Imagenet (D1L4 2017 UPC Deep Learning for Computer Vi...Image classification on Imagenet (D1L4 2017 UPC Deep Learning for Computer Vi...
Image classification on Imagenet (D1L4 2017 UPC Deep Learning for Computer Vi...
 
K Nearest Neighbor Algorithm
K Nearest Neighbor AlgorithmK Nearest Neighbor Algorithm
K Nearest Neighbor Algorithm
 
Image Caption Generation using Convolutional Neural Network and LSTM
Image Caption Generation using Convolutional Neural Network and LSTMImage Caption Generation using Convolutional Neural Network and LSTM
Image Caption Generation using Convolutional Neural Network and LSTM
 
20211019 When does label smoothing help_shared ver
20211019 When does label smoothing help_shared ver20211019 When does label smoothing help_shared ver
20211019 When does label smoothing help_shared ver
 
Ada boost
Ada boostAda boost
Ada boost
 
Computer Vision: Correlation, Convolution, and Gradient
Computer Vision: Correlation, Convolution, and GradientComputer Vision: Correlation, Convolution, and Gradient
Computer Vision: Correlation, Convolution, and Gradient
 
Introduction to Visual transformers
Introduction to Visual transformers Introduction to Visual transformers
Introduction to Visual transformers
 
Computer graphics presentation
Computer graphics presentationComputer graphics presentation
Computer graphics presentation
 
Image Compression
Image CompressionImage Compression
Image Compression
 
Generative Adversarial Networks
Generative Adversarial NetworksGenerative Adversarial Networks
Generative Adversarial Networks
 

Similar to Tensor Dimension and Shape for Deep Learning

IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...
IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...
IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...IRJET Journal
 
[2014년 7월 8일] 3 d 프린터
[2014년 7월 8일] 3 d 프린터[2014년 7월 8일] 3 d 프린터
[2014년 7월 8일] 3 d 프린터gilforum
 
Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...
Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...
Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...Edureka!
 
Effective Compression of Digital Video
Effective Compression of Digital VideoEffective Compression of Digital Video
Effective Compression of Digital VideoIRJET Journal
 
Data Summer Conf 2018, “Architecting IoT system with Machine Learning (ENG)” ...
Data Summer Conf 2018, “Architecting IoT system with Machine Learning (ENG)” ...Data Summer Conf 2018, “Architecting IoT system with Machine Learning (ENG)” ...
Data Summer Conf 2018, “Architecting IoT system with Machine Learning (ENG)” ...Provectus
 
Architecting IoT with Machine Learning
Architecting IoT with Machine LearningArchitecting IoT with Machine Learning
Architecting IoT with Machine LearningRudradeb Mitra
 
Role of 3D printing & 3D model in Complex Total Hip Replacement
Role of 3D printing &  3D model in Complex Total Hip Replacement Role of 3D printing &  3D model in Complex Total Hip Replacement
Role of 3D printing & 3D model in Complex Total Hip Replacement Queen Mary Hospital
 
Inkjet printer's datapath challenges in emerging printing applications
Inkjet printer's datapath challenges in emerging printing applicationsInkjet printer's datapath challenges in emerging printing applications
Inkjet printer's datapath challenges in emerging printing applicationsMeteor Inkjet Ltd
 
Inkjet Datapath Challenges in Emerging Print Applications
Inkjet Datapath Challenges in Emerging Print ApplicationsInkjet Datapath Challenges in Emerging Print Applications
Inkjet Datapath Challenges in Emerging Print ApplicationsMeteor Inkjet Ltd
 
Diamond mixed effects models in Python
Diamond mixed effects models in PythonDiamond mixed effects models in Python
Diamond mixed effects models in PythonPyData
 
Privacy Preserving and Ownership in Cloud Computing using Symmetric Key Encry...
Privacy Preserving and Ownership in Cloud Computing using Symmetric Key Encry...Privacy Preserving and Ownership in Cloud Computing using Symmetric Key Encry...
Privacy Preserving and Ownership in Cloud Computing using Symmetric Key Encry...IRJET Journal
 
Secure Text Transfer Using Diffie-Hellman Key Exchange Based On Cloud
Secure Text Transfer Using Diffie-Hellman Key Exchange Based On CloudSecure Text Transfer Using Diffie-Hellman Key Exchange Based On Cloud
Secure Text Transfer Using Diffie-Hellman Key Exchange Based On CloudIRJET Journal
 
Lecture # 04 Materials for AM Processes
Lecture # 04 Materials for AM ProcessesLecture # 04 Materials for AM Processes
Lecture # 04 Materials for AM ProcessesSolomon Tekeste
 
3 d searching document
3 d searching document3 d searching document
3 d searching documentpriyanka reddy
 
Design and development of DrawBot using image processing
Design and development of DrawBot using image processing Design and development of DrawBot using image processing
Design and development of DrawBot using image processing IJECEIAES
 
Big Data & Machine Learning - TDC2013 São Paulo - 12/0713
Big Data & Machine Learning - TDC2013 São Paulo - 12/0713Big Data & Machine Learning - TDC2013 São Paulo - 12/0713
Big Data & Machine Learning - TDC2013 São Paulo - 12/0713Mathieu DESPRIEE
 
Gp6 gcit1015-new
Gp6 gcit1015-newGp6 gcit1015-new
Gp6 gcit1015-new15226891
 

Similar to Tensor Dimension and Shape for Deep Learning (20)

IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...
IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...
IRJET- Empower Syntactic Exploration Based on Conceptual Graph using Searchab...
 
[2014년 7월 8일] 3 d 프린터
[2014년 7월 8일] 3 d 프린터[2014년 7월 8일] 3 d 프린터
[2014년 7월 8일] 3 d 프린터
 
Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...
Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...
Introduction To TensorFlow | Deep Learning Using TensorFlow | TensorFlow Tuto...
 
Effective Compression of Digital Video
Effective Compression of Digital VideoEffective Compression of Digital Video
Effective Compression of Digital Video
 
ifip2008albashiri.pdf
ifip2008albashiri.pdfifip2008albashiri.pdf
ifip2008albashiri.pdf
 
Data Summer Conf 2018, “Architecting IoT system with Machine Learning (ENG)” ...
Data Summer Conf 2018, “Architecting IoT system with Machine Learning (ENG)” ...Data Summer Conf 2018, “Architecting IoT system with Machine Learning (ENG)” ...
Data Summer Conf 2018, “Architecting IoT system with Machine Learning (ENG)” ...
 
Architecting IoT with Machine Learning
Architecting IoT with Machine LearningArchitecting IoT with Machine Learning
Architecting IoT with Machine Learning
 
Role of 3D printing & 3D model in Complex Total Hip Replacement
Role of 3D printing &  3D model in Complex Total Hip Replacement Role of 3D printing &  3D model in Complex Total Hip Replacement
Role of 3D printing & 3D model in Complex Total Hip Replacement
 
Inkjet printer's datapath challenges in emerging printing applications
Inkjet printer's datapath challenges in emerging printing applicationsInkjet printer's datapath challenges in emerging printing applications
Inkjet printer's datapath challenges in emerging printing applications
 
Inkjet Datapath Challenges in Emerging Print Applications
Inkjet Datapath Challenges in Emerging Print ApplicationsInkjet Datapath Challenges in Emerging Print Applications
Inkjet Datapath Challenges in Emerging Print Applications
 
Diamond mixed effects models in Python
Diamond mixed effects models in PythonDiamond mixed effects models in Python
Diamond mixed effects models in Python
 
Privacy Preserving and Ownership in Cloud Computing using Symmetric Key Encry...
Privacy Preserving and Ownership in Cloud Computing using Symmetric Key Encry...Privacy Preserving and Ownership in Cloud Computing using Symmetric Key Encry...
Privacy Preserving and Ownership in Cloud Computing using Symmetric Key Encry...
 
Secure Text Transfer Using Diffie-Hellman Key Exchange Based On Cloud
Secure Text Transfer Using Diffie-Hellman Key Exchange Based On CloudSecure Text Transfer Using Diffie-Hellman Key Exchange Based On Cloud
Secure Text Transfer Using Diffie-Hellman Key Exchange Based On Cloud
 
Lecture # 04 Materials for AM Processes
Lecture # 04 Materials for AM ProcessesLecture # 04 Materials for AM Processes
Lecture # 04 Materials for AM Processes
 
3 d searching document
3 d searching document3 d searching document
3 d searching document
 
Design and development of DrawBot using image processing
Design and development of DrawBot using image processing Design and development of DrawBot using image processing
Design and development of DrawBot using image processing
 
Fundamentals of Additive Manufacturing
Fundamentals of Additive ManufacturingFundamentals of Additive Manufacturing
Fundamentals of Additive Manufacturing
 
3D Printing
3D Printing3D Printing
3D Printing
 
Big Data & Machine Learning - TDC2013 São Paulo - 12/0713
Big Data & Machine Learning - TDC2013 São Paulo - 12/0713Big Data & Machine Learning - TDC2013 São Paulo - 12/0713
Big Data & Machine Learning - TDC2013 São Paulo - 12/0713
 
Gp6 gcit1015-new
Gp6 gcit1015-newGp6 gcit1015-new
Gp6 gcit1015-new
 

More from Seong-Hun Choe

AIFrienz_Webinar_Tomomi_Research_Inc).pdf
AIFrienz_Webinar_Tomomi_Research_Inc).pdfAIFrienz_Webinar_Tomomi_Research_Inc).pdf
AIFrienz_Webinar_Tomomi_Research_Inc).pdfSeong-Hun Choe
 
Installing tensorflow object detection on raspberry pi
Installing tensorflow object detection on raspberry piInstalling tensorflow object detection on raspberry pi
Installing tensorflow object detection on raspberry piSeong-Hun Choe
 
TD4 Assembly Instruction
TD4 Assembly InstructionTD4 Assembly Instruction
TD4 Assembly InstructionSeong-Hun Choe
 
4bit-CPU : TD4の解説
4bit-CPU : TD4の解説4bit-CPU : TD4の解説
4bit-CPU : TD4の解説Seong-Hun Choe
 
딥러닝 추천교재 및 강좌
딥러닝 추천교재 및 강좌딥러닝 추천교재 및 강좌
딥러닝 추천교재 및 강좌Seong-Hun Choe
 
Python : for文の解説
Python : for文の解説Python : for文の解説
Python : for文の解説Seong-Hun Choe
 
20170315 deeplearning from_scratch_ch01
20170315 deeplearning from_scratch_ch0120170315 deeplearning from_scratch_ch01
20170315 deeplearning from_scratch_ch01Seong-Hun Choe
 
NVIDIA ディープラーニング入門
NVIDIA ディープラーニング入門NVIDIA ディープラーニング入門
NVIDIA ディープラーニング入門Seong-Hun Choe
 
DC-DC-Converter Evaluation Report
DC-DC-Converter Evaluation Report DC-DC-Converter Evaluation Report
DC-DC-Converter Evaluation Report Seong-Hun Choe
 
LTSpice : How to import the transistor spice model
LTSpice : How to import the transistor spice modelLTSpice : How to import the transistor spice model
LTSpice : How to import the transistor spice modelSeong-Hun Choe
 
RF Power Amplifier Tutorial (2) Class A, B and C
RF Power Amplifier Tutorial (2) Class A, B and CRF Power Amplifier Tutorial (2) Class A, B and C
RF Power Amplifier Tutorial (2) Class A, B and CSeong-Hun Choe
 
RF Power Amplifier Tutorial (1)
RF Power Amplifier Tutorial (1)RF Power Amplifier Tutorial (1)
RF Power Amplifier Tutorial (1)Seong-Hun Choe
 
Impedance matching of the RF sputtering system
Impedance matching of the RF sputtering systemImpedance matching of the RF sputtering system
Impedance matching of the RF sputtering systemSeong-Hun Choe
 
Introduction of the Wireless Power Transfer System using Inductive resonant ...
Introduction of the Wireless Power Transfer  System using Inductive resonant ...Introduction of the Wireless Power Transfer  System using Inductive resonant ...
Introduction of the Wireless Power Transfer System using Inductive resonant ...Seong-Hun Choe
 

More from Seong-Hun Choe (15)

AIFrienz_Webinar_Tomomi_Research_Inc).pdf
AIFrienz_Webinar_Tomomi_Research_Inc).pdfAIFrienz_Webinar_Tomomi_Research_Inc).pdf
AIFrienz_Webinar_Tomomi_Research_Inc).pdf
 
Installing tensorflow object detection on raspberry pi
Installing tensorflow object detection on raspberry piInstalling tensorflow object detection on raspberry pi
Installing tensorflow object detection on raspberry pi
 
TD4 Assembly Instruction
TD4 Assembly InstructionTD4 Assembly Instruction
TD4 Assembly Instruction
 
4bit-CPU : TD4の解説
4bit-CPU : TD4の解説4bit-CPU : TD4の解説
4bit-CPU : TD4の解説
 
딥러닝 추천교재 및 강좌
딥러닝 추천교재 및 강좌딥러닝 추천교재 및 강좌
딥러닝 추천교재 및 강좌
 
Python : Class
Python : ClassPython : Class
Python : Class
 
Python : for文の解説
Python : for文の解説Python : for文の解説
Python : for文の解説
 
20170315 deeplearning from_scratch_ch01
20170315 deeplearning from_scratch_ch0120170315 deeplearning from_scratch_ch01
20170315 deeplearning from_scratch_ch01
 
NVIDIA ディープラーニング入門
NVIDIA ディープラーニング入門NVIDIA ディープラーニング入門
NVIDIA ディープラーニング入門
 
DC-DC-Converter Evaluation Report
DC-DC-Converter Evaluation Report DC-DC-Converter Evaluation Report
DC-DC-Converter Evaluation Report
 
LTSpice : How to import the transistor spice model
LTSpice : How to import the transistor spice modelLTSpice : How to import the transistor spice model
LTSpice : How to import the transistor spice model
 
RF Power Amplifier Tutorial (2) Class A, B and C
RF Power Amplifier Tutorial (2) Class A, B and CRF Power Amplifier Tutorial (2) Class A, B and C
RF Power Amplifier Tutorial (2) Class A, B and C
 
RF Power Amplifier Tutorial (1)
RF Power Amplifier Tutorial (1)RF Power Amplifier Tutorial (1)
RF Power Amplifier Tutorial (1)
 
Impedance matching of the RF sputtering system
Impedance matching of the RF sputtering systemImpedance matching of the RF sputtering system
Impedance matching of the RF sputtering system
 
Introduction of the Wireless Power Transfer System using Inductive resonant ...
Introduction of the Wireless Power Transfer  System using Inductive resonant ...Introduction of the Wireless Power Transfer  System using Inductive resonant ...
Introduction of the Wireless Power Transfer System using Inductive resonant ...
 

Recently uploaded

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Tensor Dimension and Shape for Deep Learning

  • 1. Tomomi Research Inc. Tensor : Data representation for deep learning 2018/09/21 (Fri) Dr. Seong-Hun Choe
  • 2. Tomomi Research Inc. Agenda 9/22/2018 2©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. 1. Tensor : Dimension 2. Tensor : Shape 3. Real world data : Which tensor?
  • 3. Tomomi Research Inc. Tensor WTF is a tensor? Remember that it is a just container for data. the data are almost numerical data. So, Tensor is a container for numbers. 9/22/2018 3©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. Various explanations, but very hard to understand its concept ? ?
  • 4. Tomomi Research Inc. Keywords 9/22/2018 4©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. 1. Tensor is a container of numbers. 2. Tensor is a generalization of matrices to an arbitrary number of dimensions. 3. In tensor, dimension is often called axis. 4. number of dimension (=axis) is called ranks.
  • 5. Tomomi Research Inc. 1. Scalar (0D tensor) A tensor that contains only one number is called a scalar 9/22/2018 5©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. • example : 12 dimension can be shown with ndim method.
  • 6. Tomomi Research Inc. 2. Vector (1D tensor) An array of numbers is called a vector, or 1D tensor 9/22/2018 6©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. • example : [12,3,6,14]
  • 7. Tomomi Research Inc. 3. Matrix (2D tensor) An array of vectors is a matrix, or 2D tensor 9/22/2018 7©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. • example : [[1, 3, 5, 7], [2, 4, 6, 8], [3 ,6, 9,12]]
  • 8. Tomomi Research Inc. 4. 3D tensor It is just nD tensor from 3D tensor. 9/22/2018 8©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. • example :[[[1, 3, 5, 7], [2, 4, 6, 8], [3 ,6, 9,12]], [[1, 3, 5, 7], [2, 4, 6, 8], [3 ,6, 9,12]], [[1, 3, 5, 7], [2, 4, 6, 8], [3 ,6, 9,12]]]
  • 9. Tomomi Research Inc. Agenda 9/22/2018 9©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. 1. Tensor : Dimension 2. Tensor : Shape 3. Real world data : Which tensor?
  • 10. Tomomi Research Inc. Key attributes 9/22/2018 10©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. 1. Number of dimension(=axes) 2. Shape : how many dimensions in the tensor has along each axis. 3. Data type : dtype in python, (float32, float64, unit8 and so on.) Shape is very important in deep learning programming.
  • 11. Tomomi Research Inc. 2.1. Scalar (0D tensor) Scalar has empty shape. 9/22/2018 11©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. • example : 12
  • 12. Tomomi Research Inc. 2.2 Vector (1D tensor) 1D tensor has a shape with a single element, such as (4,) 9/22/2018 12©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. • example : [12,3,6,14]
  • 13. Tomomi Research Inc. 2.3. Matrix (2D tensor) 2D tensor has a shape such as (3,4). it is familiar with matrix representation. 9/22/2018 13©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. • example : [[1, 3, 5, 7], [2, 4, 6, 8], [3 ,6, 9,12]]
  • 14. Tomomi Research Inc. 2.4. 3D tensor 3D tensor has a shape (3, 3, 4) 9/22/2018 14©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. • example :[[[1, 3, 5, 7], [2, 4, 6, 8], [3 ,6, 9,12]], [[1, 3, 5, 7], [2, 4, 6, 8], [3 ,6, 9,12]], [[1, 3, 5, 7], [2, 4, 6, 8], [3 ,6, 9,12]]]
  • 15. Tomomi Research Inc. 2.5. MNIST example Keras & Tensorflow 9/22/2018 15©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. • loading the mnist dataset: • dimension of train images -> 3D tensor • shape of train images -> 3D tensor여서(m,n,p)의 형태 내용은、(28,28)の어레이가 60000개 있습니다. 라는 의미 • data type of train images -> 8 bit integer
  • 16. Tomomi Research Inc. Summary (1) : Tensor 9/22/2018 16©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. dimension 0 1 2 3 4 Name Scalar Vector Matrix 3D tensor 4D tensor Another name 0D tensor 1D tensor 2D tensor 3D tensor 4D tensor Example 12 [12,3,6,14] … Shape () empty (4,) (3,4) (3,3,4) (5,3,3,4)
  • 17. Tomomi Research Inc. Agenda 9/22/2018 17©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. 1. Tensor : Dimension 2. Tensor : Shape 3. Real world data : Which tensor?
  • 18. Tomomi Research Inc. 3. Real-World examples of data as tensors 9/22/2018 18©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. Name Tensor Shape Vector data* 2D tensor (samples, feature) Timeseries data or sequence data 3D tensor (samples, timesteps, features) Images 4D tensor (samples, height, width, channels) Video 5D tensor (samples, frames, height, width, channels) Vector data is different with vector. vector is 1D tensor.
  • 19. Tomomi Research Inc. 3.1. Vector data 2D tensor 9/22/2018 19©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. Samples Age ZIP code Income 1 12 123-324 10k 2 34 234-567 13k 3 12 349-874 20k … 9,999 45 874-988 30k 10,000 56 888-234 12k Example : Actual personal data, 3 10,000 Shape : (samples, feature) = (10,000, 3) • Numpy array [[12, 123-324,10k], [34,234-567,13k], … [56 ,888-234, 12k]]
  • 20. Tomomi Research Inc. time (min.) current price the highest price the lowest price 0 1 2 … 390 time (min.) current price the highest price the lowest price 0 1 2 … 390 time (min.) current price the highest price the lowest price 0 1 2 … 390 3.2. Timeseries data or sequence data 3D tensor 9/22/2018 20©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. time (min.) current price the highest price the lowest price 0 1 2 … 390 Example: stock price dataset (1 year) 3 390 min. 250 days Shape : (samples, timesteps, features) = (250, 390, 3)
  • 21. Tomomi Research Inc. 3.3 Image data 4D tensor 9/22/2018 21©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. Example : A batch of 128 color images of size 256 * 256 Shape : (samples, height, width, channels) = (128, 256, 256, 3)
  • 22. Tomomi Research Inc. 3.3 Video data 5D tensor 9/22/2018 22©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. Example : 60 second, 144X 156 Youtube video clip sample at 4 fps would be 240 frames. A batch of 4 such video clips Shape : (samples, frames, height, width, channels) = (4, 240, 144, 156, 3) total = 4 * 240 * 144 * 156 * 3 = 106,168,320 if dtype of the tensor is float32, total memory will be 405 MB!
  • 23. Tomomi Research Inc. Summary (2) : Real data 9/22/2018 23©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. Vector data Timeseries data or sequence data Image data Video data Tensor dimension 2D 3D 4D 5D Example personal data annual stock data batch of color image batch of video frame Example Shape (samples, feature) = (10,000, 3) (samples, timesteps, features) = (250, 390, 3) (samples, height, width, channels) = (128, 256, 256, 3) (samples, frames, height, width, channels) =(4, 240, 144, 156, 3)
  • 24. Tomomi Research Inc. Tensor at Sony neural network console 9/22/2018 24©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. (samples, channels, height, width) = (128, 1, 28, 28)
  • 25. Tomomi Research Inc. Tensor at Tensorflow 주로Placeholder를 이용해 input data를 준비할때 9/22/2018 25©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. (samples, timesteps, features) = (?, 25, 1) Sample수를 placeholder안에 지정하지 않을때는 、None으로 기입.
  • 26. Tomomi Research Inc. Tensor at Keras 9/22/2018 26©2017 Western Digital Corporation or its affiliates. All rights reserved. Confidential. (samples, time_setp, features) = (176, 25,1)