![article thumbnail image](https://blog.kakaocdn.net/dn/T5QkR/btrJo03x0Rl/SVELXh6AoUetCAxz2XEykK/img.png)
what is tensor?
- 어떻게 바라보아도 그 본질이 변하지 않는 것 (어떤 좌표계로 보더라도 변하지 않는 것)
- https://www.tensorflow.org/guide/tensor?hl=ko “텐서는 일관된 유형(dtype이라고 불림)을 가진 다차원 배열입니다.”
- Rank : tensor의 차원 단위
Tensorflow
- 구글에서 개발한 파이썬 기반 머신러닝 프레임워크
- 텐서(tensor)를 기본 자료구조로 하여 그것의 흐름으로써 수치연산해주는 라이브러리 → 데이터 플로우 그래프
데이터 플로우 그래프(Data Flow Graph)
- 노드 : 덧셈, 곱셈 등 텐서를 처리하는 연산
- 엣지 : 방향에 따른 텐서의 흐름(화살표)
a = tf.constant(5, name='a')
b = tf.constant(3, name='b')
<tf.Tensor: shape=(), dtype=int32, numpy=5>
<tf.Tensor: shape=(), dtype=int32, numpy=3>
c = tf.multiply(a, b, name='c')
d = tf.add(a, b, name='d')
e = tf.add(c, d, name='e')
<tf.Tensor: shape=(), dtype=int32, numpy=15>
<tf.Tensor: shape=(), dtype=int32, numpy=8>
<tf.Tensor: shape=(), dtype=int32, numpy=23>
# 텐서플로우 구버전 (session 정의 후 실행)
# sess = tf.Session()
# print(sess.run(e))
tf.print(e)
23
keras
- tensorflow 위에서 동작하는 딥러닝 라이브러리
- 2021년 6월 업데이트: Tensorflow 2.6 부터 tensorflow 패키지에서 분리, from tensorflow import keras 가 아닌 import keras 를 사용하게 될 것
'인공지능 > 머신러닝-딥러닝' 카테고리의 다른 글
파이토치(PyTorch) 이해하기 with MNIST (0) | 2022.11.24 |
---|---|
텐서플로우(TensorFlow)에서 파이토치(PyTorch)로 환승하기 (1) | 2022.11.24 |
ASAM (pending) (0) | 2022.08.10 |
tensorflow - 함수들 (0) | 2022.08.10 |
01. numpy 기초 (0) | 2021.05.02 |