Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update visualization.md #177

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions sources/visualization.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
## 모델 시각화

케라스는(`graphviz`를 사용해서) 케라스 모델을 그래프로 그리기 위한 유틸리티 함수를 제공합니다.
케라스는 `graphviz`를 통해 케라스 모델을 그래프로 그려주는 유틸리티 함수를 제공합니다.

아래 예시는 모델의 그래프를 그려주고 그 결과를 파일로 저장합니다:
아래는 모델의 그래프를 그리고 파일로 저장하는 예시입니다.
```python
from keras.utils import plot_model
plot_model(model, to_file='model.png')
```

`plot_model`은 네 가지 인자를 전달받습니다:
`plot_model`은 네 가지 인자를 전달받습니다.

- `show_shapes`(기본값은 `False`)는 결과의 형태을 그래프에 나타낼 것인지 조정합니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

형태을 -> 형태를

- `show_layer_names`(기본값은 `True`)는 층의 이름을 그래프에 나타낼 것인지 조정합니다.
- `expand_nested`(기본값은 `False`)는 중첩된 모델을 그래프상에서 클러스터로 확장할 것인지 조정합니다.
- `dpi`(기본값은 96)는 이미지 dpi를 조정합니다.
- `show_shapes`(기본값은 `False`)는 결과의 형태를 그래프에 표시할지를 설정합니다.
- `show_layer_names`(기본값은 `True`)는 층의 이름을 그래프에 표시할지를 설정합니다.
- `expand_nested`(기본값은 `False`)는 중첩된 모델을 그래프상에서 클러스터로 확장할 것인지를 설정합니다.
- `dpi`(기본값은 96)는 이미지 dpi를 설정합니다.

또한 직접 `pydot.Graph`오브젝트를 만들어 사용할 수도 있습니다,
예를들어 ipython notebook에 나타내자면 :
또한 직접 `pydot.Graph`객체를 만들어 사용할 수도 있습니다.
아래는 IPython Notebook에서 나타낸 예시입니다.
```python
from IPython.display import SVG
from keras.utils import model_to_dot
Expand All @@ -26,7 +26,7 @@ SVG(model_to_dot(model).create(prog='dot', format='svg'))

## 학습 히스토리 시각화

케라스 `Model`의 `fit()` 메소드는 `History` 오브젝트를 반환합니다. `History.history` 속성<sub>attribute</sub>은 각 에폭마다 계산된 학습 손실 및 평가 지표가 순서대로 기록된 딕셔너리입니다. 검증 데이터를 적용한 경우에는 해당 손실 및 지표도 함께 기록됩니다. 아래는 `matplotlib`을 사용하여 학습 및 검증의 손실과 정확도 그래프를 그리는 예시입니다.
케라스 `Model`의 `fit()` 메소드는 `History` 객체를 반환합니다. `History.history` 속성<sub>attribute</sub>은 각 에폭마다 계산된 학습 손실 및 평가 지표가 순서대로 기록된 딕셔너리입니다. 검증 데이터를 적용한 경우에는 해당 손실 및 지표도 함께 기록됩니다. 아래는 `matplotlib`을 사용하여 학습 및 검증의 손실과 정확도 그래프를 그리는 예시입니다.

```python
import matplotlib.pyplot as plt
Expand Down