layer, activation rtd · lineCode/tensorlayer@fe9ebee · GitHub
Skip to content

Commit fe9ebee

Browse files
committed
layer, activation rtd
1 parent 132763a commit fe9ebee

18 files changed

Lines changed: 246 additions & 32 deletions

docs/modules/activation.rst

Lines changed: 17 additions & 3 deletions

docs/modules/files.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@ API - Load, Save Model and Data
22
===================================
33

44
Load benchmark dataset, save and restore model, save and load variables.
5+
TensorFlow provides ``.ckpt`` file format to save and restore the models, while
6+
we suggest to use standard python file format ``.npz`` to save models for the
7+
sake of cross-platform.
8+
9+
10+
.. code-block:: python
11+
12+
# save model as .ckpt
13+
saver = tf.train.Saver()
14+
save_path = saver.save(sess, "model.ckpt")
15+
# restore model from .ckpt
16+
saver = tf.train.Saver()
17+
saver.restore(sess, "model.ckpt")
18+
19+
# save model as .npz
20+
tl.files.save_npz(network.all_params , name='model.npz')
21+
# restore model from .npz
22+
load_params = tl.files.load_npz(path='', name='model.npz')
23+
tl.files.assign_params(sess, load_params, network)
24+
525
626
727
.. automodule:: tensorlayer.files

docs/modules/layers.rst

Lines changed: 185 additions & 0 deletions
898 Bytes
Binary file not shown.
1002 Bytes
Binary file not shown.
10.4 KB
Binary file not shown.
25.2 KB
Binary file not shown.
6.3 KB
Binary file not shown.
63.9 KB
Binary file not shown.
23.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)