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

4장 신경망구현 예제 질문이요 #47

Open
laminlamin opened this issue Feb 14, 2019 · 1 comment
Open

4장 신경망구현 예제 질문이요 #47

laminlamin opened this issue Feb 14, 2019 · 1 comment

Comments

@laminlamin
Copy link

코드에서 보면 학습결과를 확인할 때
prediction = tf.argmax(model, axis=1)에서
model은 최적화하기 전의 모델이고,
train_op는 최소의 cost값을 갖은 최적화 모델인데
왜 model을 넣어서 예측을 하나요?
train_op을 넣어서도 프로그래밍해보았는데, 실행이 안되더라구요....왜 그러는지 답변 부탁드립니다^^

@ufxpri
Copy link

ufxpri commented Mar 3, 2019

텐서플로우는 모델 기반이라는 점을 먼저 알고 계셔야 합니다.
tf.placeholder, tf.constant, tf.layers… 등의 레이어 들을 정의하고 서로 연결시킴으로써 모델이 만들어지고 이 함수 들을 오퍼레이터 라고 부릅니다. 각자 자신의 역할을 가지고 있거든요

질문하신 내용에서 model 은 레이어들을 쌓아 만든 모델의 끝 부분 입니다. 따라서 모델의 결과를 출력할 땐 model 의 결과를 출력해야하는 것 이죠
그런데 train_op 는 이름에서 알 수 있듯이 학습을 위한 오퍼레이터 입니다. 이 오퍼레이터는 "학습" 의 역할만 가지고있으며 반환값으로 아무것도 돌려주지 않습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants