Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cfd1c3b

Browse files
committed
TensorFlow 1.2 적용
1 parent d6305bb commit cfd1c3b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

‎08 - RNN/01 - MNIST.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# RNN 에 학습에 사용할 셀을 생성합니다
3232
# 다음 함수들을 사용하면 다른 구조의 셀로 간단하게 변경할 수 있습니다
3333
# BasicRNNCell,BasicLSTMCell,GRUCell
34-
cell = tf.contrib.rnn.BasicRNNCell(n_hidden)
34+
cell = tf.nn.rnn_cell.BasicRNNCell(n_hidden)
3535

3636
# RNN 신경망을 생성합니다
3737
# 원래는 다음과 같은 과정을 거쳐야 하지만

‎08 - RNN/02 - Autocomplete.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,14 @@ def make_batch(seq_data):
7474
b = tf.Variable(tf.random_normal([n_class]))
7575

7676
# RNN 셀을 생성합니다.
77-
cell1 = tf.contrib.rnn.BasicLSTMCell(n_hidden)
77+
cell1 = tf.nn.rnn_cell.BasicLSTMCell(n_hidden)
7878
# 과적합 방지를 위한 Dropout 기법을 사용합니다.
79-
cell1 = tf.contrib.rnn.DropoutWrapper(cell1, output_keep_prob=0.5)
79+
cell1 = tf.nn.rnn_cell.DropoutWrapper(cell1, output_keep_prob=0.5)
8080
# 여러개의 셀을 조합해서 사용하기 위해 셀을 추가로 생성합니다.
81-
cell2 = tf.contrib.rnn.BasicLSTMCell(n_hidden)
81+
cell2 = tf.nn.rnn_cell.BasicLSTMCell(n_hidden)
8282

8383
# 여러개의 셀을 조합한 RNN 셀을 생성합니다.
84-
multi_cell = tf.contrib.rnn.MultiRNNCell([cell1, cell2])
84+
multi_cell = tf.nn.rnn_cell.MultiRNNCell([cell1, cell2])
8585

8686
# tf.nn.dynamic_rnn 함수를 이용해 순환 신경망을 만듭니다.
8787
# time_major=True

‎08 - RNN/03 - Seq2Seq.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ def make_batch(seq_data):
6363

6464
# 인코더 셀을 구성한다.
6565
with tf.variable_scope('encode'):
66-
enc_cell = tf.contrib.rnn.BasicRNNCell(n_hidden)
67-
enc_cell = tf.contrib.rnn.DropoutWrapper(enc_cell, output_keep_prob=0.5)
66+
enc_cell = tf.nn.rnn_cell.BasicRNNCell(n_hidden)
67+
enc_cell = tf.nn.rnn_cell.DropoutWrapper(enc_cell, output_keep_prob=0.5)
6868

6969
outputs, enc_states = tf.nn.dynamic_rnn(enc_cell, enc_input,
7070
dtype=tf.float32)
7171

7272
# 디코더 셀을 구성한다.
7373
with tf.variable_scope('decode'):
74-
dec_cell = tf.contrib.rnn.BasicRNNCell(n_hidden)
75-
dec_cell = tf.contrib.rnn.DropoutWrapper(dec_cell, output_keep_prob=0.5)
74+
dec_cell = tf.nn.rnn_cell.BasicRNNCell(n_hidden)
75+
dec_cell = tf.nn.rnn_cell.DropoutWrapper(dec_cell, output_keep_prob=0.5)
7676

7777
# Seq2Seq 모델은 인코더 셀의 최종 상태값을
7878
# 디코더 셀의 초기 상태값으로 넣어주는 것이 핵심.

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
## 요구사항
1616

17-
- TensorFlow > 1.0
17+
- TensorFlow 1.2
1818
- Python 3.6
1919
- numpy 1.12
2020
- matplotlib 2.0

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /