@@ -75,6 +75,7 @@ class Model(object):
7575 >>> from tensorlayer.models import Model
7676
7777 Define static model
78+
7879 >>> class CustomModel(Model):
7980 >>> def __init__(self):
8081 >>> super(CustomModel, self).__init__()
@@ -97,6 +98,7 @@ class Model(object):
9798 >>> M_static = Model(inputs=ni, outputs=nn, name="mlp")
9899
99100 Get network information
101+
100102 >>> print(M_static)
101103 ... Model(
102104 ... (_inputlayer): Input(shape=[None, 784], name='_inputlayer')
@@ -106,21 +108,25 @@ class Model(object):
106108 ... )
107109
108110 Forwarding through this network
111+
109112 >>> data = np.random.normal(size=[16, 784]).astype(np.float32)
110113 >>> outputs_d = M_dynamic(data)
111114 >>> outputs_s = M_static(data)
112115
113116 Save and load weights
117+
114118 >>> M_static.save_weights('./model_weights.h5')
115119 >>> M_static.load_weights('./model_weights.h5')
116120
117121 Save and load the model
122+
118123 >>> M_static.save('./model.h5')
119124 >>> M = Model.load('./model.h5')
120125
121126 Convert model to layer
127+
122128 >>> M_layer = M_static.as_layer()
123-
129+
124130 """
125131
126132 @property
@@ -251,7 +257,7 @@ def __call__(self, inputs, is_train=None, **kwargs):
251257 If 'is_train' == False, this network is set as evaluation mode
252258 kwargs :
253259 For other keyword-only arguments.
254-
260+
255261 """
256262
257263 self ._check_mode (is_train )
@@ -694,7 +700,7 @@ def save(self, filepath, save_weights=True):
694700 >>> net = tl.models.vgg16()
695701 >>> net.save('./model.h5', save_weights=True)
696702 >>> new_net = Model.load('./model.h5', load_weights=True)
697-
703+
698704 """
699705 # TODO: support saving LambdaLayer that includes parametric self defined function with outside variables
700706 if self .outputs is None :
0 commit comments