Skip to content

Commit

Permalink
Update from 4e28c14
Browse files Browse the repository at this point in the history
Edit a typing error
  • Loading branch information
Choiuijin1125 committed Apr 2, 2019
1 parent 4e28c14 commit 61caa15
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 95 deletions.
6 changes: 3 additions & 3 deletions site/ko/tutorials/eager/automatic_differentiation.ipynb
Expand Up @@ -71,7 +71,7 @@
"id": "vDJ4XzMqodTy"
},
"source": [
"이전 튜토리얼에서 우리는 Tensor와 Tensor의 연산들에 대해서 알아보았습니다. 이번 튜토리얼에서는 머신러닝 모델을 최적화할 수 있는 주요 기술 중 하나인 [자동미분(automatic differentiation)](https://en.wikipedia.org/wiki/Automatic_differentiation)에 대해 알아보겠습니다."
"이전 튜토리얼에서 우리는 텐서(tensor)와 텐서의 연산들에 대해서 알아보았습니다. 이번 튜토리얼에서는 머신러닝 모델을 최적화할 수 있는 주요 기술 중 하나인 [자동미분(automatic differentiation)](https://en.wikipedia.org/wiki/Automatic_differentiation)에 대해 알아보겠습니다."
]
},
{
Expand Down Expand Up @@ -286,7 +286,7 @@
"source": [
"## 다음 단계\n",
"\n",
"이번 튜토리얼에서는 텐서플로에서 그래디언트 계산법을 배웠습니다. 이를 통해 우리는 신경망을 구축하고 훈련시키는 데 필요한 기본 요소를 충분히 확보할 수 있습니다."
"이번 튜토리얼에서는 텐서플로에서 그래디언트 계산법을 배웠습니다. 이를 통해 우리는 신경망(neural network)을 구축하고 훈련시키는 데 필요한 기본 요소를 충분히 확보할 수 있습니다."
]
}
],
Expand Down Expand Up @@ -314,7 +314,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.6.7"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions site/ko/tutorials/eager/custom_layers.ipynb
Expand Up @@ -100,7 +100,7 @@
"\n",
"머신러닝을 위한 코드를 작성하는 대부분의 시간에 우리는, 개별적인 연산과 변수를 조작하는 것보다는 고수준의 추상화 수준에서 작업하기를 원합니다.\n",
"\n",
"많은 머신러닝 모델은 비교적 단순한 layer의 구성과 적층(stacking)으로 표현가능합니다. 또한 텐서플로는 여러 표준 레이어 세트를 제공하므로 사용자 고유의 응용 프로그램에 관련된 레이어를 처음부터 작성하거나, 기존 레이어의 구성으로 쉽게 작성할 수 있습니다.\n",
"많은 머신러닝 모델은 비교적 단순한 layer의 구성과 적층(stacking)으로 표현가능합니다. 또한 텐서플로는 여러 표준 layer 세트를 제공하므로 사용자 고유의 응용 프로그램에 관련된 layer를 처음부터 작성하거나, 기존 layer의 구성으로 쉽게 작성할 수 있습니다.\n",
"\n",
"텐서플로는 [Keras](https://keras.io) API 의 풀패키지를 tf.keras package에 포함하고 있습니다. Keras layer는 모델을 구축하는데 매우 유용합니다."
]
Expand Down Expand Up @@ -349,7 +349,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.6.7"
}
},
"nbformat": 4,
Expand Down
14 changes: 7 additions & 7 deletions site/ko/tutorials/eager/custom_training.ipynb
Expand Up @@ -73,7 +73,7 @@
"source": [
"이전 튜토리얼에서 우리는 머신러닝을 위한 기초 빌딩 블록인 자동미분(automatic differentiation)을 위한 텐서플로 API들을 알아보았습니다. 이번 튜토리얼에서는 이전 튜토리얼에서 소개되었던 초기 타입의 텐서플로를 사용하여 간단한 머신러닝을 구축해보겠습니다. \n",
"\n",
"텐서플로는 상용구를 줄이기 위해 유용한 추상화를 제공하는 고수준 신경망 API인 (`tf.keras`)를 포함하고 있습니다. 신경망에 관련하여 일을 하고 있는 사람들에게는 이러한 고수준의 API들을 강하게 추천합니다. 그러나 이번 짧은 튜토리얼에서는 탄탄한 기초를 기르기 위한 신경망 학습을 다루겠습니다. "
"텐서플로는 상용구를 줄이기 위해 유용한 추상화를 제공하는 고수준 신경망(neural network) API인 `tf.keras`를 포함하고 있습니다. 신경망에 관련하여 일을 하고 있는 사람들에게는 이러한 고수준의 API들을 강하게 추천합니다. 그러나 이번 짧은 튜토리얼에서는 탄탄한 기초를 기르기 위한 신경망 학습을 다루겠습니다. "
]
},
{
Expand Down Expand Up @@ -119,7 +119,7 @@
"source": [
"## 변수\n",
"\n",
"텐서플로 안에서 텐서(Tensor)는 상태가 없고, 변경이 불가능한(immutable stateless) 객체입니다. 그러나 머신러닝은 상태가 변경될 필요가 있습니다(stateful). 예를 들어, 모델 학습에서 예측을 계산하기 위한 동일한 코드는 시간이 지남에 따라 다른 양상(희망적으로, 더 낮은 손실로 가는 방향으로)을 보여야 합니다. 이 계산 과정을 통해 변화되어야 하는 상태를 표현하기 위해 상태가 변경 가능한 파이썬 언어에 의존한 선택이 가능합니다. "
"텐서플로 안에서 텐서(Tensor)는 상태가 없고, 변경이 불가능한(immutable stateless) 객체입니다. 그러나 머신러닝은 상태가 변경될(stateful) 필요가 있습니다. 예를 들어, 모델 학습에서 예측을 계산하기 위한 동일한 코드는 시간이 지남에 따라 다른 양상(희망적으로, 더 낮은 손실로 가는 방향으로)을 보여야 합니다. 이 계산 과정을 통해 변화되어야 하는 상태를 표현하기 위해 상태가 변경 가능한 파이썬 언어에 의존한 선택이 가능합니다. "
]
},
{
Expand Down Expand Up @@ -167,7 +167,7 @@
"v.assign(3.0)\n",
"assert v.numpy() == 3.0\n",
"\n",
"# 텐서플로 연산자 내에서 `v` 사용 \n",
"# 텐서플로 연산내에서 `v` 사용 \n",
"v.assign(tf.square(v))\n",
"assert v.numpy() == 9.0"
]
Expand All @@ -181,7 +181,7 @@
"source": [
"변수들을 사용한 계산은 그래디언트가 계산될 때 자동적으로 추적됩니다. 임베딩(embedding)을 나타내는 변수의 경우 초기값으로부터 드물게 업데이트됩니다. 이는 계산과 메모리에 있어 더욱 효율적입니다. \n",
"\n",
"또한 변수를 사용하는 것은 코드를 읽는 과정에서 변경 가능한 상태(state mutable)의 조각을 빠르게 인식하는 방법입니다."
"또한 변수를 사용하는 것은 코드를 읽는 과정에서 상태가 변경 가능한 상태(state mutable)의 조각을 빠르게 인식하는 방법입니다."
]
},
{
Expand Down Expand Up @@ -341,7 +341,7 @@
"plt.scatter(inputs, model(inputs), c='r')\n",
"plt.show()\n",
"\n",
"print('Current loss: '),\n",
"print('현재 손실: '),\n",
"print(loss(model(inputs), outputs).numpy())"
]
},
Expand Down Expand Up @@ -406,7 +406,7 @@
" current_loss = loss(model(inputs), outputs)\n",
"\n",
" train(model, inputs, outputs, learning_rate=0.1)\n",
" print('Epoch %2d: W=%1.2f b=%1.2f, loss=%2.5f' %\n",
" print('에포크 %2d: W=%1.2f b=%1.2f, 손실=%2.5f' %\n",
" (epoch, Ws[-1], bs[-1], current_loss))\n",
"\n",
"# Let's plot it all\n",
Expand Down Expand Up @@ -458,7 +458,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.6.7"
}
},
"nbformat": 4,
Expand Down
285 changes: 226 additions & 59 deletions site/ko/tutorials/eager/custom_training_walkthrough.ipynb

Large diffs are not rendered by default.

55 changes: 33 additions & 22 deletions site/ko/tutorials/eager/eager_basics.ipynb
Expand Up @@ -93,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"cellView": "code",
"colab": {},
Expand All @@ -116,7 +116,7 @@
"source": [
"## 텐서\n",
"\n",
"텐서는 다차원 배열입니다. 넘파이(NumPy) `ndarray` 객체와 비슷하며, `Tensor` 객체는 데이터 타입과 형태를 가지고 있습니다. 또한 텐서는 GPU 같은 가속기내에 상주할 수 있습니다. 텐서플로는 텐서를 생성하고 계산하는 풍부한 연산 라이브러리를 제공합니다. ([tf.add](https://www.tensorflow.org/api_docs/python/tf/add), [tf.matmul](https://www.tensorflow.org/api_docs/python/tf/matmul), [tf.linalg.inv](https://www.tensorflow.org/api_docs/python/tf/linalg/inv) etc.). 이러한 연산자들은 자동적으로 순수 파이썬 타입을 전환합니다. 예를 들어:\n"
"텐서는 다차원 배열입니다. 넘파이(NumPy) `ndarray` 객체와 비슷하며, `Tensor` 객체는 데이터 타입과 형태를 가지고 있습니다. 또한 텐서는 GPU 같은 가속기내에 상주할 수 있습니다. 텐서플로는 텐서를 생성하고 계산하는 풍부한 연산 라이브러리([tf.add](https://www.tensorflow.org/api_docs/python/tf/add), [tf.matmul](https://www.tensorflow.org/api_docs/python/tf/matmul), [tf.linalg.inv](https://www.tensorflow.org/api_docs/python/tf/linalg/inv) etc.)를 제공합니다. 이러한 연산자들은 자동적으로 순수 파이썬 타입을 전환합니다. 예를 들어:\n"
]
},
{
Expand All @@ -136,7 +136,7 @@
"print(tf.reduce_sum([1, 2, 3]))\n",
"print(tf.encode_base64(\"hello world\"))\n",
"\n",
"# Operator overloading is also supported\n",
"# 연산자의 오버로딩 또한 지원합니다.\n",
"print(tf.square(2) + tf.square(3))"
]
},
Expand Down Expand Up @@ -172,7 +172,7 @@
"id": "eBPw8e8vrsom"
},
"source": [
"넘파이 `ndarray`와 `Tensor`의 가장 확실한 차이는 다음과 같습니다:\n",
"넘파이 `ndarray`와 텐서플로 `Tensor`의 가장 확연한 차이는 다음과 같습니다:\n",
"\n",
"1. `Tensor`는 가속기 메모리(GPU, TPU와 같은)의 사용이 가능합니다.\n",
"2. `Tensor`는 불변성(immutable)을 가집니다."
Expand All @@ -189,8 +189,8 @@
"\n",
"`Tensor`와 `ndarray`사이의 전환은 다소 간단합니다.\n",
"\n",
"* 텐서플로 연산는 자동적으로 넘파이 ndarray를 Tensor로 전환합니다.\n",
"* 넘파이 연산는 자동적으로 텐서플로 Tensor를 넘파이 ndarray로 전환합니다.\n",
"* 텐서플로 연산은 자동적으로 넘파이 ndarray를 Tensor로 전환합니다.\n",
"* 넘파이 연산은 자동적으로 텐서플로 Tensor를 넘파이 ndarray로 전환합니다.\n",
"\n",
"Tensor는 `.numpy()` 메서드(method)를 호출하여 넘파이 ndarray로 전환할 수 있습니다.\n",
"가능한 경우, Tensor와 ndarray은 메모리 표현을 공유하기 때문에 이러한 전환은 일반적으로 간단(저렴)합니다. 그러나 Tensor는 GPU 메모리에 저장될 수 있고, 넘파이 ndarray은 항상 호스트 메모리에 백업이 되므로, 이러한 전환이 항상 가능한 것은 아닙니다. 따라서 GPU에서 호스트 메모리로의 복사가 포함됩니다."
Expand All @@ -210,15 +210,15 @@
"\n",
"ndarray = np.ones([3, 3])\n",
"\n",
"print(\"TensorFlow operations convert numpy arrays to Tensors automatically\")\n",
"print(\"텐서플로 연산은 자동적으로 넘파이 배열을 텐서로 전환합니다.\")\n",
"tensor = tf.multiply(ndarray, 42)\n",
"print(tensor)\n",
"\n",
"\n",
"print(\"And NumPy operations convert Tensors to numpy arrays automatically\")\n",
"print(\"그리고 넘파이 연산은 자동적으로 텐서를 넘파이 배열로 전환합니다.\")\n",
"print(np.add(tensor, 1))\n",
"\n",
"print(\"The .numpy() method explicitly converts a Tensor to a numpy array\")\n",
"print(\".numpy() 메서드는 텐서를 넘파이 배열로 전환시킵니다.\")\n",
"print(tensor.numpy())"
]
},
Expand All @@ -236,21 +236,32 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"cellView": "code",
"colab": {},
"colab_type": "code",
"id": "3Twf_Rw-gQFM"
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"GPU를 사용가능한가 : \n",
"False\n",
"텐서가 GPU #0에 있는가 : \n",
"False\n"
]
}
],
"source": [
"x = tf.random_uniform([3, 3])\n",
"\n",
"print(\"Is there a GPU available: \"),\n",
"print(\"GPU 사용이 가능한가 : \"),\n",
"print(tf.test.is_gpu_available())\n",
"\n",
"print(\"Is the Tensor on GPU #0: \"),\n",
"print(\"텐서가 GPU #0에 있는가 : \"),\n",
"print(x.device.endswith('GPU:0'))"
]
},
Expand All @@ -263,7 +274,7 @@
"source": [
"### 장치 이름\n",
"\n",
"`Tensor.device`는 Tensor를 구성하고 있는 호스트 장치의 풀네임을 제공합니다. 이러한 이름은 프로그램이 실행중인 호스트의 네트워크 주소 및 해당 호스트 내의 장치와 같은 많은 세부 정보를 인코딩하며, 이것은 텐서플로 프로그램의 분산 실행에 필요합니다. Tensor가 호스트의 `N`번째 GPU에 놓여지면 문자열은 `GPU:<N>` 끝납니다."
"`Tensor.device`는 Tensor를 구성하고 있는 호스트 장치의 풀네임을 제공합니다. 이러한 이름은 프로그램이 실행중인 호스트의 네트워크 주소 및 해당 호스트 내의 장치와 같은 많은 세부 정보를 인코딩하며, 이것은 텐서플로 프로그램의 분산 실행에 필요합니다. Tensor가 호스트의 `N`번째 GPU에 놓여지면 문자열은 `GPU:<N>`으로 끝납니다."
]
},
{
Expand Down Expand Up @@ -333,7 +344,7 @@
"\n",
"만약 텐서플로 그래프에 익숙하다면, `Dataset` 객체를 생성하기 위한 API는 즉시실행이 활성화 되어도 동일하게 유지됩니다. 하지만 그러나 데이터셋의 요소를 반복하는 프로세스는 약간 더 간단합니다.\n",
"또한 `tf.data.Dataset` 객체를 통하여 파이썬 반복문을 사용할 수 있으며, 명시적으로 `tf.data.Iterator` 객체를 생성할 필요가 없습니다.\n",
"그 결과, [TensorFlow Guide](https://www.tensorflow.org/guide/datasets)의 반복자(iterator)에 관한 논의는 즉시실행이 활성화될 때에는 관계없습니다. "
"그 결과, [텐서플로 가이드](https://www.tensorflow.org/guide/datasets)의 반복자(iterator)에 관한 논의는 즉시실행이 활성화될 때에는 관계없습니다. "
]
},
{
Expand All @@ -343,9 +354,9 @@
"id": "zI0fmOynH-Ne"
},
"source": [
"### `Dataset`소스 생성\n",
"### `Dataset` 소스 생성\n",
"\n",
"굉장히 유용한 함수중 하나인 [`Dataset.from_tensors`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#from_tensors), [`Dataset.from_tensor_slices`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#from_tensor_slices)를 사용하여 데이터셋 소스를 생성하거나 or 파일로부터 읽어들이는 객체인 [`TextLineDataset`](https://www.tensorflow.org/api_docs/python/tf/data/TextLineDataset) 또는 [`TFRecordDataset`](https://www.tensorflow.org/api_docs/python/tf/data/TFRecordDataset)를 사용하여 데이터셋 소스를 생성하세요. 더 많은 정보는 [TensorFlow Guide](https://www.tensorflow.org/guide/datasets#reading_input_data) 를 참조하세요."
"굉장히 유용한 함수중 하나인 [`Dataset.from_tensors`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#from_tensors), [`Dataset.from_tensor_slices`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#from_tensor_slices)를 사용하여 데이터셋 소스를 생성하거나 파일로부터 읽어들이는 객체인 [`TextLineDataset`](https://www.tensorflow.org/api_docs/python/tf/data/TextLineDataset) 또는 [`TFRecordDataset`](https://www.tensorflow.org/api_docs/python/tf/data/TFRecordDataset)를 사용하여 데이터셋 소스를 생성하세요. 더 많은 정보를 위해서 [텐서플로 가이드](https://www.tensorflow.org/guide/datasets#reading_input_data)를 참조하세요."
]
},
{
Expand All @@ -360,7 +371,7 @@
"source": [
"ds_tensors = tf.data.Dataset.from_tensor_slices([1, 2, 3, 4, 5, 6])\n",
"\n",
"# Create a CSV file\n",
"# CSV 파일 생성\n",
"import tempfile\n",
"_, filename = tempfile.mkstemp()\n",
"\n",
Expand All @@ -382,7 +393,7 @@
"source": [
"### 변환 적용\n",
"\n",
"[`map`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#map), [`batch`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#batch), [`shuffle`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#shuffle) 같은 변환 함수를 사용하세요. 또한 데이터셋의 레코드에 변환을 적용하세요. 세부사항은 [API documentation for `tf.data.Dataset`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset)을 참조하세요."
"[`map`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#map), [`batch`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#batch), [`shuffle`](https://www.tensorflow.org/api_docs/python/tf/data/Dataset#shuffle) 같은 변환 함수를 사용하세요. 또한 데이터셋의 레코드에 변환을 적용하세요. 세부사항은 [`tf.data.Dataset`을 위한 API 문서](https://www.tensorflow.org/api_docs/python/tf/data/Dataset)을 참조하세요."
]
},
{
Expand Down Expand Up @@ -422,11 +433,11 @@
},
"outputs": [],
"source": [
"print('Elements of ds_tensors:')\n",
"print('ds_tensors 요소:')\n",
"for x in ds_tensors:\n",
" print(x)\n",
"\n",
"print('\\nElements in ds_file:')\n",
"print('\\nds_file 요소:')\n",
"for x in ds_file:\n",
" print(x)"
]
Expand Down Expand Up @@ -456,7 +467,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
"version": "3.6.7"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions site/ko/tutorials/eager/index.md
Expand Up @@ -14,8 +14,8 @@
[eager execution guide](../../guide/eager).

1. [즉시실행(Eager execution)](eager_basics.ipynb)
2. [Automatic differentiation and gradient tape](automatic_differentiation.ipynb)
3. [사용자 정의 학습 : 기본(Custom training: basics)](custom_training.ipynb)
2. [자동미분과 그래디언트 테이프(Automatic differentiation and gradient tape)](automatic_differentiation.ipynb)
3. [사용자 정의 학습 : 기초(Custom training: basics)](custom_training.ipynb)
4. [사용자 정의 layer(Custom layers)](custom_layers.ipynb)
5. [사용자 정의 학습 : walkthrough(Custom training: walkthrough)](custom_training_walkthrough.ipynb)

0 comments on commit 61caa15

Please sign in to comment.