(self, inputs, in_size, out_size, activation_function=None)
| 16 | |
| 17 | class Layer(object): |
| 18 | def __init__(self, inputs, in_size, out_size, activation_function=None): |
| 19 | self.W = theano.shared(np.random.normal(0, 1, (in_size, out_size))) |
| 20 | self.b = theano.shared(np.zeros((out_size, )) + 0.1) |
| 21 | self.Wx_plus_b = T.dot(inputs, self.W) + self.b |
| 22 | self.activation_function = activation_function |
| 23 | if activation_function is None: |
| 24 | self.outputs = self.Wx_plus_b |
| 25 | else: |
| 26 | self.outputs = self.activation_function(self.Wx_plus_b) |
| 27 | |
| 28 | |
| 29 | # Make up some fake data |
nothing calls this directly
no outgoing calls
no test coverage detected