Layers¶
Module that contains various layer like components.
-
breze.arch.component.layer.
simple
(inpt, weights, bias, out_transfer, p_dropout=0, prefix='')¶ Return a dictionary containing computations from a simple layer.
The layer has the following form
\[f((x \cdot d) ^TW + b),\]where \(f\) corresponds to
transfer
, \(x\) toinput
, \(\cdot\) indicates the element-wise product, \(d\) is a vector of Bernoulli samples with parameterp_dropout
, \(W\) is the weight matrixweights
and \(b\) is thebias
.Parameters: inpt : Theano variable
Array of shape
(n, d)
.weights : Theano variable
Array of shape
(d, e)
.bias : Theano variable
Array of shape
(e,)
.transfer : function or string
If a function should given a Theano variable return a Theano variable of the same shape. If string, is used to get a transfer function from
breze.arch.component.transfer
.p_dropout : Theano scalar or float
Needs to be in (0, 1). Indicates the probability that an input is set to zero.
prefix : string, optional [default: ‘’]
Each enty in the returned dictionary will be prefixed with this.
Returns: d : dict
Has the following entries:
output_in
, activation before application oftransfer
.output
, activation after application oftransfer
.