theanet.layer package¶
Submodules¶
theanet.layer.auxillary module¶
theanet.layer.convpool module¶
-
class
theanet.layer.convpool.ConvLayer(inpt, wts, rand_gen, batch_sz, num_prev_maps, in_sz, num_maps, filter_sz, stride, mode='valid', actvn='relu50', reg=())[source]¶ Bases:
theanet.layer.layer.Layer
-
class
theanet.layer.convpool.MeanLayer(inpt, num_maps, in_sz)[source]¶ Bases:
theanet.layer.layer.Layer
-
class
theanet.layer.convpool.PoolLayer(inpt, num_maps, in_sz, pool_sz, ignore_border=False)[source]¶ Bases:
theanet.layer.layer.Layer
theanet.layer.inlayers module¶
-
class
theanet.layer.inlayers.ElasticLayer(inpt, img_sz, num_maps=1, translation=0, zoom=1, magnitude=0, sigma=1, pflip=0, angle=0, rand_gen=None, invert_image=False, nearest=False)[source]¶ Bases:
theanet.layer.layer.Layer
-
class
theanet.layer.inlayers.InputLayer(inpt, img_sz, num_maps=1, rand_gen=None)[source]¶ Bases:
theanet.layer.layer.Layer
theanet.layer.layer module¶
-
class
theanet.layer.layer.Activation(fn, name)[source]¶ Bases:
objectDefines a bunch of activations as callable classes. Useful for printing and specifying activations as strings.
theanet.layer.outlayers module¶
-
class
theanet.layer.outlayers.CenteredOutLayer(inpt, wts, centers, rand_gen=None, n_in=None, n_features=None, n_classes=None, kind='LOGIT', learn_centers=False, junk_dist=<Mock id='140068954974640'>, reg=())[source]¶ Bases:
theanet.layer.hidden.HiddenLayer,theanet.layer.outlayers.OutputLayer
-
class
theanet.layer.outlayers.HingeLayer(inpt, wts, rand_gen=None, n_in=None, n_out=None, reg=(), loss='hinge')[source]¶ Bases:
theanet.layer.hidden.HiddenLayer,theanet.layer.outlayers.OutputLayer
-
class
theanet.layer.outlayers.SoftmaxLayer(inpt, wts, rand_gen=None, n_in=None, n_out=None, reg=(), loss='nll')[source]¶ Bases:
theanet.layer.hidden.HiddenLayer,theanet.layer.outlayers.OutputLayer
theanet.layer.weights module¶
-
theanet.layer.weights.borrow(sharedvar, boro=True)[source]¶ Gets the numpy ndarray underlying a sharedVariable
-
theanet.layer.weights.init_wb(wb, rand_gen, size_w, size_b, fan_in, fan_out, actvn, name)[source]¶ Initialize the weights. If wb is given, the weights are initialized as a copy of the same. If wb is None, they are randomly initialized based on the rest of the arguments.
Parameters: wb (None or ndarray or SharedVariable) – w and b (to be copied or None) The following a are needed only when wb is None.
Parameters: - rand_gen (RandomStream) – A random stream.
- size_w (tuple) – Size of w
- size_b (tuple or int) – Size of b
- fan_in (int) – Number of units coming in.
- fan_out (int) – Number of units going out.
- actvn (str) – The activation that will be applied. See `Activation`s
Returns: The initialized weights
Return type: SharedVariable
Checks if x is SharedVar. Could be a CUDA SharedVar or just a normal Theano SharedVar