Total Complexity | 2 |
Total Lines | 13 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | #!/usr/bin/env python |
||
6 | class Activation(NeuralLayer): |
||
7 | """ |
||
8 | Activation layer. |
||
9 | """ |
||
10 | |||
11 | def __init__(self, activation_type): |
||
12 | from deepy.tensor.activations import get_activation |
||
13 | super(Activation, self).__init__(activation_type) |
||
14 | self._activation = get_activation(activation_type) |
||
15 | |||
16 | def compute_tensor(self, x): |
||
17 | self.activation = self._activation(x) |
||
18 | return self.activation |