@@ -23,7 +23,7 @@ Static model
23
23
nn = Dropout(keep = 0.8 )(nn)
24
24
nn = Dense(n_units = 800 , act = tf.nn.relu)(nn)
25
25
nn = Dropout(keep = 0.8 )(nn)
26
- nn = Dense(n_units = 10 , act = tf.nn.relu )(nn)
26
+ nn = Dense(n_units = 10 , act = None )(nn)
27
27
M = Model(inputs = ni, outputs = nn, name = " mlp" ) # “name" is optional
28
28
return M
29
29
@@ -49,7 +49,7 @@ In this case, you need to manually input the output shape of the previous layer
49
49
self .dropout2 = Dropout(keep = 0.8 )
50
50
self .dense2 = Dense(n_units = 800 , act = tf.nn.relu, in_channels = 800 )
51
51
self .dropout3 = Dropout(keep = 0.8 )
52
- self .dense3 = Dense(n_units = 10 , act = tf.nn.relu , in_channels = 800 )
52
+ self .dense3 = Dense(n_units = 10 , act = None , in_channels = 800 )
53
53
54
54
def forward (self , x , foo = False ):
55
55
z = self .dropout1(x)
@@ -156,7 +156,7 @@ Print model information
156
156
# (dropout_1): Dropout(keep=0.8, name='dropout_1')
157
157
# (dense_1): Dense(n_units=800, relu, in_channels='800', name='dense_1')
158
158
# (dropout_2): Dropout(keep=0.8, name='dropout_2')
159
- # (dense_2): Dense(n_units=10, relu , in_channels='800', name='dense_2')
159
+ # (dense_2): Dense(n_units=10, None , in_channels='800', name='dense_2')
160
160
# )
161
161
162
162
import pprint
@@ -195,7 +195,7 @@ Print model information
195
195
# 'name': 'dropout_3'},
196
196
# 'class': 'Dropout',
197
197
# 'prev_layer': ['dense_2_node_0']},
198
- # {'args': {'act': 'relu' ,
198
+ # {'args': {'act': None ,
199
199
# 'layer_type': 'normal',
200
200
# 'n_units': 10,
201
201
# 'name': 'dense_3'},
0 commit comments