| 17 | |
| 18 | |
| 19 | def 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 | |
| 37 | def batchnorm(input): |
| 38 | with tf.variable_scope(self.name): |