Python๋ผ๋ ๊ฒ์ ๊ฐ๋จํ๊ฒ ์ดํด๋ณด์๊ณ (ํด๋น๋งํฌ)
ํด๋น ์ธ์ด๋ก ๊ตฌ์ฑ๋์ด ์๋ Tensorflow๋ฅผ ํ์ตํด๋ณด๋ ค๊ณ ํ๋ค.
Tensorflow์ ๊ฐ๋ ์ ๊ณต๋ถํด๋ณด์
Tensorflow ์์ ๋ฅผ ๋๋ ค๋ณด์
๋ด๊ฐ ์ํ๋ ๋ฐ์ดํฐ๋ก ํ์ต์ ์ํค๊ณ ๊ฒฐ๊ณผ๋ฅผ ๋์ถํด๋ณด์
๋ฑ๋ฑํ ์ ์
๋ด๊ฐ ๋ฅ๋ฌ๋์ ํด๋ณด๊ธฐ์ํด ํ์๋ก ์์์ผ๋๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
๋ฐ์ดํฐ ํ๋ก์ฐ ๊ทธ๋ํ(Data Flow Graph)๋?
- ๋ฐ์ดํฐ ํ๋ก์ฐ ๊ทธ๋ํ๋ ์ํ ๊ณ์ฐ๊ณผ ๋ฐ์ดํฐ์ ํ๋ฆ์ ๋ ธ๋(Node)์ ์ฃ์ง(Edge)๋ฅผ ์ฌ์ฉํ
๋ฐฉํฅ ๊ทธ๋ํ(Directed Graph)๋ก ํํ- ๋ ธ๋๋ ์ํ์ ๊ณ์ฐ, ๋ฐ์ดํฐ ์ /์ถ๋ ฅ, ๊ทธ๋ฆฌ๊ณ ๋ฐ์ดํฐ์ ์ฝ๊ธฐ/์ ์ฅ ๋ฑ์ ์์ ์ ์ํ
- ์ฃ์ง๋ ๋ ธ๋๋ค ๊ฐ ๋ฐ์ดํฐ์ ์ ์ถ๋ ฅ ๊ด๊ณ๋ฅผ ๋ํ๋ ๋๋ค.
- ์ฃ์ง๋ Tensor(๋ค์ฐจ์ ๋ฐ์ดํฐ ๋ฐฐ์ด)๋ฅผ ์ค์ด ๋๋ฅด๋๋ฐ, ์ด๊ฒ์ด ๊ณง Tensorflow
Tensorflow๋ฅผ ์ ํํ๊ฒ ์ดํดํ๊ธฐ ์ํด์๋ Tensor๊ฐ ๋ฌด์์ธ์ง ์์์ผํ ๋ฏ?!!
ํ ์(Tensor)๋ฅผ ์ดํดํ๊ธฐ ์ํด Rank, shape, type๋ฅผ ์์์ผ ํ๋ค.
RANK | TYPE | EXAMPLE |
---|---|---|
0 | Scalar | [1] |
1 | Vector | [1,1] |
2 | Matrix | [[1,1],[1,1]] |
3 | 3 Tensor | [[[1,1],[1,1]],[[1,1],[1,1]]] |
4 | N Tensor | [[[[1,1],[1,1]],[[1,1],[1,1]]]................ |
์ด๋ฏธ์ง ์ฐธ์กฐ : https://hiddenbeginner.github.io/deeplearning/2020/01/21/pytorch_tensor.html
์ฐจ์์ ์
RANK | SHAPE | DIMENSION NUMBER | EXAMPLE |
---|---|---|---|
0 | [] | 0-D | A 0-D tensor, A scalar |
1 | [DO] | 1-D | A 1-D tensor with shape[5] |
2 | [DO,D1] | 2-D | A 2-D tensor with shape[3,4] |
3 | [DO,D1,D2] | 3-D | 2-D |
4 | [DO,D1,...Dn-1] | n-D | A tensor with shape[DO,D1,...Dn-1] |
Data Type | Python Type | Descripiton |
---|---|---|
DT_FLOAT | tf.float32 | 32 bits floating point |
DT_DOUBLE | tf.float64 | 64 bits floating point |
DT_INT8 | tf.int8 | 8 bits signed integer |
DT_INT16 | tf.int16 | 16 bits signed integer |
DT_INT32 | tf.int32 | 32 bits signed integer |
DT_INT64 | tf.int64 | 64 bits signed integer |