Welcome to SPN’s documentation!¶
SPN is library to build, train and save neural networks based on Theano.
SPN defines a neural network image on hard disk to reuse and modify.
Tutorials¶
User’s Guide¶
API Reference¶
The following is the document extracted from code.
Network¶
-
class
mlbase.network.
Network
[source]¶ Theano based neural network.
-
build
(reload=False)[source]¶ Build the training function and predict function after collecting all the necessary information.
-
getSaveModelName
(dateTime=None)[source]¶ Return default model saving file name, including path prefix.
-
load
(istream)[source]¶ Load the model from input stream. reset() is called to clean up network instance.
-
nextLayer
()[source]¶ Use this method to iterate over all known layers. This is a DAG walker. Guarantee all previous layers are visited for the next visiting layer.
-
reset
()[source]¶ For sequential layerout network, use append().
To add more layers, the first layer is set with setInput(). Network can do this, because it remember which layer to append to by using member variable currentLayer.
-
mlbase.layers
¶
NonLinear |
|
Relu |
|
Elu |
|
ConcatenatedReLU |
|
Sine |
|
Cosine |
SeqLayer |
|
DAGPlan |
|
DAG |
RawInput |
This is THE INPUT Class. |
Cost function¶
-
class
mlbase.cost.
CostFunc
[source]¶ General cost function base class.
Y: result from forward network. tY: the given true result.
-
class
mlbase.cost.
TwoStageCost
[source]¶ Cost function that needs two stage computation.
Step 1: obtain data statistics. Step 2: obtain label for each sample.
-
class
mlbase.cost.
IndependentCost
[source]¶ Cost function for each sample cost known and final cost is a statistics for all sample cost.
-
mlbase.cost.
aggregate
(loss, weights=None, mode='mean')[source]¶ This code is from lasagne/objectives.py
-
class
mlbase.cost.
ImageDiff
[source]¶ This is the base class for cost function for images. The input format is like:
tensor4, (patch, channel, column, row)The channel should be 1 or 3.