def build_network(self, input_var=None):
self.network= {}
self.network['input'] = lasagne.layers.InputLayer(shape=(self.batch_size, self.input_size[0]),
input_var=self.x)
# Add a fully-connected layer of 800 units, using the linear rectifier, and
# initializing weights with Glorot's scheme (which is the default anyway):
self.network['FC_1'] = batch_norm(lasagne.layers.DenseLayer(
lasagne.layers.dropout(self.network['input'], p=self.dropout_rates[0]), num_units=self.fc_layers[0],
nonlinearity=lasagne.nonlinearities.tanh,
W=lasagne.init.GlorotUniform()))
# Finally, we'll add the fully-connected output layer, of 10 softmax units:
self.network['prob'] = lasagne.layers.DenseLayer(
lasagne.layers.dropout(self.network['FC_1'], p=self.dropout_rates[1]), num_units=self.fc_layers[1],
nonlinearity=lasagne.nonlinearities.softmax)
# Each layer is linked to its incoming layer(s), so we only need to pass
# the output layer to give access to a network in Lasagne:
return self.network
motionDetector_lasagne.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录