| 16 | |
| 17 | ## define the network |
| 18 | class 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 | |
| 41 | MLP = CustomModel() |
no outgoing calls
no test coverage detected
searching dependent graphs…