- 본 게시글은 홍콩과기대 김성훈 교수님의 "모두를 위한 머신러닝" 강의를 보고 개인 공부용으로 작성된 것입니다.
* Tensorflow의 작동방식
1) Build graph(tensor) using TF operations
- node / placeholder
2) feed data and run gragh (operation)
- sess.run(op, feed_dict={a:[1,3]} )
3) update variables in the graph (and return values)
- 예전에 SAS EM을 다룰 때 이미지로 되어있던 과정과 유사한 듯
* 데이터 입력
1) node1 = tf.constant(3.0, tf.float32)
- 위의 코딩을 통해 3.0이라는 실수를 입력할 수 있다.
2) a = tf.placeholder(tf.float32)
- 다른 노드를 사용해 계산할 때, 미지수로 간주하는 역할을 할 수 있다.
- print(sess.run(adder_node, feed_dict={a:[1,3], b:[2,4]}))
: 다음과 같이 feed_dict 인수를 사용해 어떤 미지수를 대입할 것인가를 결정할 수 있다.
[1,3]과 같이 배열의 형태로 대입할 수 있다.
* Tensor Ranks, Shapes, and Types
1) Rank
(1) rank = 0 : Scalar (magnitude)
(2) rank = 1 : Vector (magnitude and direction)
(3) rank = 2 : Matrix (table of numbers)
(4) rank = 3 : 3-Tensor (cube of numbers)
...
(n+1) rank = n : n-Tensor (idea)
2) Shape
- tensor의 각 element에 몇 개씩 들어가 있는가?
3) Types
- 대부분 tf.float32(- 32bits floating point) 를 사용
'분석 > 통계' 카테고리의 다른 글
[스크랩] 딥러닝 연습을 위한 여러가지 데이터 셋 (0) | 2018.04.05 |
---|---|
learning statistics on YouTube (0) | 2018.04.03 |
통계 관련 구직 인터뷰 (0) | 2018.03.20 |
Ensemble (0) | 2018.02.04 |
pycharm에서 tensorflow를 활용한 머신러닝 배우기(2) (0) | 2018.01.28 |