Skip to content

Commit

Permalink
Update getting_started.md
Browse files Browse the repository at this point in the history
Fixed errors on 'Weights persistence' example codes.
  • Loading branch information
Jinsung-L committed Nov 13, 2016
1 parent 0bfd069 commit a9857c1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/templates/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ To get or set the value of these variables, TFLearn models class implement `get_
```python
input_data = tflearn.input_data(shape=[None, 784])
fc1 = tflearn.fully_connected(input_data, 64)
fc2 = tflearn.fully_connected(input_data, 10, activation='softmax')
net = tflearn.regression(fc1)
fc2 = tflearn.fully_connected(fc1, 10, activation='softmax')
net = tflearn.regression(fc2)
model = DNN(net)
# Get weights values of fc1
model.get_weights(fc1.W)
# Assign new random weights to fc1
model.set_weights(fc1.W, numpy.random.rand(64, 10))
# Get weights values of fc2
model.get_weights(fc2.W)
# Assign new random weights to fc2
model.set_weights(fc2.W, numpy.random.rand(64, 10))
```

Note that you can also directly use TensorFlow `eval` or `assign` ops to get or set the value of these variables.
Expand Down

0 comments on commit a9857c1

Please sign in to comment.