본문 바로가기

분류 전체보기105

vector 벡터 벡터보통 벡터(vector)를 ‘크기와 방향을 가진 양’ 으로 정의하고, 크기만 갖고 방향은 없는 양을 스칼라(scalar)라고 정의합니다. 벡터는 집합과 달리 순서를 생각해야 하는데, 집합 A={1, a, 3}와 집합 B={a, 3, 1}을 비교해 보면 순서에 상관없이 들어 있는 원소는 모두 같으므로 두 집합 A와 B는 같은 집합입니다. 하지만 벡터는 순서쌍이기 때문에 순서가 중요합니다. a=(1, a, 3), b=(a, 3, 1)와 같이 벡터는 소괄호를 이용하는데, a와 b는 다른 벡터입니다. 그 이유는 순서가 다르기 때문이다.(7, z, 3) 처럼 3개의 수로 이루어진 순서쌍을 3차원 벡터라고 하고, (y, 9) 처럼 2개의 수로 이루어진 순서쌍을 2차원 벡터라고 합니다. (5) 처럼 1개의 수로 .. 2016. 4. 5.
Feeds (13) Feeds 앞의 예는 텐서를 상수(Constants)와 변수(Variables)에 저장하여 계산그래프안으로 텐서를 끌어옵니다. The examples above introduce tensors into the computation graph by storing them in Constants and Variables. TensorFlow는 그래프 안의 모든 ops에 텐서를 직접 붙이는 feed메커니즘도 제공합니다. TensorFlow also provides a feed mechanism for patching a tensor directly into any operation in the graph. feed는 일시적으로 op의 출력을 텐서 값으로 대체합니다. A feed temporarily repla.. 2016. 3. 31.
Fetch (12) FetchesOps의 출력을 가져오기 위하여, 객체 Session에서 run() call로 그래프를 실행하고, 검색을 위하여 텐서 안으로 전달합니다. To fetch the outputs of operations, execute the graph with a run() call on the Session object and pass in the tensors to retrieve. 앞 예제에서, 단일 node state를 가져왔으나 복수의 tensors도 가져올 수 있습니다: In the previous example we fetched the single node state, but you can also fetch multiple tensors: input1 = tf.constant(3.0)input.. 2016. 3. 31.
변수 Variables (11) Variables Variables는 그래프가 실행되는 동안 state를 유지합니다. Variables maintain state across executions of the graph. 다음 예제는 simple counter 역할을 하는 변수를 보여주고 있습니다. The following example shows a variable serving as a simple counter. 보다 상세한 사항은 Variables를 참조 하세요. See Variables for more details. # 변수 만들기, 변수를 scalar 값 0으로 초기화 state = tf.Variable(0, name="counter") # `state`에 1을 더하는 op 만들기. one = tf.constant(1) ne.. 2016. 3. 31.