MCPcopy
hub / github.com/MrNothing/AI-Blocks / Run

Function Run

Sources/scripts/function.py:19–35  ·  view source on GitHub ↗
(self, x, reuse=False)

Source from the content-addressed store, hash-verified

17
18
19def Run(self, x, reuse=False):
20 Log(self.function)
21
22 if self.function=="sigmoid":
23 return tf.nn.sigmoid(x)
24 elif self.function=="tanh":
25 return tf.nn.tanh(x)
26 elif self.function=="softmax":
27 return tf.nn.softmax(x)
28 elif self.function=="batchnorm":
29 return self.batchnorm(x)
30 elif self.function=="lrelu":
31 return self.lrelu(x)
32 elif self.function=="reshape":
33 return tf.reshape(x, self.shape)
34 else:
35 return tf.nn.relu(x)
36
37def batchnorm(input):
38 with tf.variable_scope(self.name):

Callers

nothing calls this directly

Calls 1

LogFunction · 0.85

Tested by

no test coverage detected