MCPcopy Index your code
hub / github.com/tensorlayer/TensorLayer / CustomModel

Class CustomModel

examples/basic_tutorials/tutorial_mnist_mlp_dynamic.py:18–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17## define the network
18class CustomModel(Model):
19
20 def __init__(self):
21 super(CustomModel, self).__init__()
22 self.dropout1 = Dropout(keep=0.8) #(self.innet)
23 self.dense1 = Dense(n_units=800, act=tf.nn.relu, in_channels=784) #(self.dropout1)
24 self.dropout2 = Dropout(keep=0.8) #(self.dense1)
25 self.dense2 = Dense(n_units=800, act=tf.nn.relu, in_channels=800) #(self.dropout2)
26 self.dropout3 = Dropout(keep=0.8) #(self.dense2)
27 self.dense3 = Dense(n_units=10, act=tf.nn.relu, in_channels=800) #(self.dropout3)
28
29 def forward(self, x, foo=None):
30 z = self.dropout1(x)
31 z = self.dense1(z)
32 z = self.dropout2(z)
33 z = self.dense2(z)
34 z = self.dropout3(z)
35 out = self.dense3(z)
36 if foo is not None:
37 out = tf.nn.relu(out)
38 return out
39
40
41MLP = CustomModel()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…