LoginSignup
6
3

More than 3 years have passed since last update.

テンソル(Tensor)の理解(1) : Dimension

Last updated at Posted at 2020-03-11

1.はじめに

Tensorの理解に必要な情報を、自分用メモとして整理します。
同時に、PythonにおけるTensorの表記法もご紹介します。

*英語の表現が直感的で理解しやすいため、訳さずにそのまま記入致します。

2.テンソルとは?

  1. Tensor is a just a container for data.
  2. The data are almost numerical data
  3. Therefore, Tensor is a container for number.

テンソルは、数字を入れるコンテナです。シンプルですね。
下記の図のようにテンソルに関して様々な説明がされていますが、要は数字を入れるコンテナです。

tensor01.jpg
tensor02.jpg
tensor03.jpg

3.テンソルのキーワード

Tensor, Dimension, Axis, Ranksの意味です。

  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 (=Number of axis) is called ranks.

テンソルは、マトリックスの一般化された表現。

名称 テンソル 表記
Scalar 0 Dimensional Tensor Not Available
Vector 1 Dimensional Tensor (k)
Matrix 2 Dimensional Tensor (j,k)
.. 3 Dimensional tensor (i,j,l)

tensor-keyword.png

4.テンソルのDimension

テンソルの例、Pythonでの記入法を紹介します。
Pythonでは、リストを表すために[ ]を使います。この表現に早く慣れましょう。
numpyのndmi命令で、TensorのDimensionが確認できます。

4.1 Scalar : 0D Tensor

A tensor that contains only one number is called a scalar.

scalar.png

4.2 Vector : 1D Tensor

An array of number is called a vector, or 1D tensor.
Vector.png

4.3 Matrix : 2D Tensor

An array of vecotrs is a matrix, or 2D tensor.
matrix.png

4.4 .. :3D Tensor

It is just nD tensor from 3D tensor.
3dtensor.png

5. まとめ

Tensorとは、数字を入れるコンテナです。
TensorのDimension(=axis)の意味、Pythonでの表現について整理しました。
次回は、TensorのShapeについてご紹介します。

テンソル(Tensor)の理解 (2) : Shape

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3