MCPcopy
hub / github.com/tensorlayer/TensorLayer / get_model

Function get_model

examples/basic_tutorials/tutorial_mnist_mlp_static.py:22–31  ·  view source on GitHub ↗
(inputs_shape)

Source from the content-addressed store, hash-verified

20# speed up computation, so we use identity here.
21# see tf.nn.sparse_softmax_cross_entropy_with_logits()
22def get_model(inputs_shape):
23 ni = Input(inputs_shape)
24 nn = Dropout(keep=0.8)(ni)
25 nn = Dense(n_units=800, act=tf.nn.relu)(nn)
26 nn = Dropout(keep=0.8)(nn)
27 nn = Dense(n_units=800, act=tf.nn.relu)(nn)
28 nn = Dropout(keep=0.8)(nn)
29 nn = Dense(n_units=10, act=tf.nn.relu)(nn)
30 M = Model(inputs=ni, outputs=nn, name="mlp")
31 return M
32
33
34MLP = get_model([None, 784])

Callers 1

Calls 4

InputFunction · 0.90
DropoutClass · 0.90
DenseClass · 0.90
ModelClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…