MCPcopy Create free account
hub / github.com/MorvanZhou/tutorials / __init__

Method __init__

theanoTUT/theano9_regression_nn/full_code.py:18–26  ·  view source on GitHub ↗
(self, inputs, in_size, out_size, activation_function=None)

Source from the content-addressed store, hash-verified

16
17class 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected