|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.retro.neural.BPLayer
| Field Summary | |
protected SNVector |
a
|
protected SNVector |
a1
|
protected SNVector |
b
|
protected java.util.Stack |
bptt_ah
|
protected SNVector |
bptt_db
|
protected SNVector |
bptt_e1
|
protected SNVector |
d
|
protected SNVector |
db
|
protected SNVector |
db1
|
protected java.util.Vector |
dly
|
protected SNVector |
e
|
protected java.util.Vector |
in
|
protected boolean |
marked
|
protected org.retro.neural.BPNetwork |
net
|
protected java.util.Vector |
out
|
protected SNMatrix |
p
|
protected SNMatrix |
sqrerrs
|
| Constructor Summary | |
BPLayer(int siz)
Creates a neural network layer. |
|
| Method Summary | |
double |
actdev(double xact)
Applies first derivative of layer's activation function to activation on unit (not net input). |
double |
actfun(double xnet)
Applies layer's activation function to net input. |
protected void |
actinit()
|
protected void |
actinit(double v)
|
double[] |
activate(BPLayer src,
double[] clmp)
Activates this layer by clamping activations on another and running a forward pass. |
protected void |
activate(BPLayer src,
SNVector clmp)
|
protected void |
activate(int patno)
|
void |
attach(double[][] pattern)
Attaches pattern to layer as input or target. |
protected void |
backprop(int patno)
|
void |
batch(double eta,
double mu)
Runs one step of back-propagation in batch mode. |
void |
batch(int nep,
double eta,
double mu)
Same as batch(nep, eta, mu, report), but with error reporting every second. |
void |
batch(int nep,
double eta,
double mu,
int report)
Trains all layer's in this layer's network, using back-propagation in batch mode. |
protected void |
bptt_delayerr()
|
protected void |
bptt_dwadd()
|
protected void |
bptt_dwavg(int patlen)
|
protected void |
bptt_dwreset()
|
protected void |
bptt_errinit()
|
protected void |
bptt_geta()
|
protected void |
bptt_inita()
|
protected void |
bptt_saverr()
|
protected void |
bptt_seta()
|
void |
bpttPattern()
Steps through one pattern for Back-Prop Thru Time. |
void |
bpttPattern(int n)
Steps through one pattern for Back-Prop Thru Time. |
void |
bpttResetEta()
Resets current weight- and bias-changes for Back-Prop-Through-Time. |
void |
bpttUpdate(double eta,
double mu,
int npat)
Updates weights and bias on layer using the Delta Rule, for Back-Prop-Through-Time. |
void |
connect(BPLayer from)
Makes a normal (full, Sigma) connection to this layer from another layer. |
void |
connect(BPLayer from1,
BPLayer from2)
Makes a Sigma-Pi connection to this layer from two other layers. |
void |
delay(BPLayer from)
Same as delay(from, weight), with weight = 1.0. |
void |
delay(BPLayer from,
double weight)
Makes one-to-one time-delay connection to this layer from the specified layer, using the specified connection strength. |
protected void |
delayact()
|
double |
dontCare()
Returns out-of-bounds value for don't-care condition. |
protected void |
dwadd()
|
protected void |
dwavg(int npat)
|
protected void |
dwreset()
|
protected void |
dwset()
|
protected boolean |
emptyWeights()
|
protected void |
errreset()
|
double[] |
getBias()
Returns the bias on this layer. |
double |
getMaxError()
Returns error of maximum magnitude on layer over all training patterns. |
double |
getRMSError()
Returns Root-Mean-Squared error on layer over all training patterns. |
double[][] |
getSquaredErrors()
Returns squared errors on layer over all training patterns. |
double[][] |
getWeights(BPLayer from)
Returns the weights on this layer from another layer (Sigma connection), as a 2D array. |
double[][][] |
getWeights(BPLayer from1,
BPLayer from2)
Returns the weights on this layer from two other layers (Sigma-Pi connection), as an array of 2D arrays. |
protected boolean |
hasPattern()
|
protected boolean |
isOutput()
|
protected void |
mark()
|
protected double |
maxerr(int patlen)
|
protected void |
mureset()
|
protected boolean |
nosqrerrs()
|
void |
online(int nep,
double eta,
double mu)
Same as online(nep, eta, mu, report), but with error report every second. |
void |
online(int nep,
double eta,
double mu,
int report)
Trains all layers in this layer's network, using back-propagation in on-line mode. |
protected int |
patlen()
|
void |
randomize()
Same as randomize(seed), with arbitrary seed. |
void |
randomize(long seed)
Randomizes biases and weights on this layer. |
void |
randomize(java.util.Random rand)
Randomizes biases and weights on this layer to values normally distributed around zero. |
static void |
reportValue(int iter,
int maxit,
int report,
double value,
java.io.PrintStream stream)
Reports a value in a friendly way. |
void |
resetMu()
Resets previous weight- and bias- changes. |
protected double |
rmserr(int patlen)
|
void |
setBias(double[] v)
Sets bias on this layer to the values in vector. |
void |
setWeights(BPLayer from1,
BPLayer from2,
double[][][] w)
Sets weights on this layer from two others (Sigma-Pi connection) to values in array of 2D arrays. |
void |
setWeights(BPLayer from,
double[][] w)
Sets weights on this layer from another (Sigma connection) to values in 2D array. |
protected int |
size()
|
protected void |
sqrerrinit(int patlen)
|
double[][] |
test()
Tests a (trained) network layer. |
double[][] |
test(int n,
double a)
Tests a (recurrent) network layer without any input. |
protected void |
unmark()
|
protected void |
update(double eta,
double mu,
int npat)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected SNVector a
protected SNVector a1
protected SNVector b
protected SNVector db
protected SNVector db1
protected SNVector e
protected SNVector d
protected SNMatrix p
protected SNVector bptt_db
protected SNVector bptt_e1
protected java.util.Stack bptt_ah
protected boolean marked
protected org.retro.neural.BPNetwork net
protected java.util.Vector in
protected java.util.Vector out
protected java.util.Vector dly
protected SNMatrix sqrerrs
| Constructor Detail |
public BPLayer(int siz)
siz - number of units in the layer| Method Detail |
public double actfun(double xnet)
xnet - net input to activation function
public double actdev(double xact)
xact - activation on unit
public double dontCare()
public void randomize(long seed)
seed - seed for random number generatorpublic void randomize()
public void randomize(java.util.Random rand)
public void setWeights(BPLayer from,
double[][] w)
throws org.retro.neural.BPConnectException,
org.retro.neural.BPSizeException
from - the layer connected fromw - the matrix of weights
BPConnectException - if there is no such conenction
BPSizeException - if array size mismatches layer sizes
public void setWeights(BPLayer from1,
BPLayer from2,
double[][][] w)
throws org.retro.neural.BPConnectException,
org.retro.neural.BPSizeException
from1 - layer connected fromfrom2 - layer connected fromw - array of weights
BPConnectException - if there is no such conenction
BPSizeException - if array size mismatches layer sizes
public void setBias(double[] v)
throws org.retro.neural.BPSizeException
v - the vector of bias values
BPSizeException - if vector size doesn't equal layer size
public double[][] getWeights(BPLayer from)
throws org.retro.neural.BPConnectException,
org.retro.neural.BPInitException
from - the layer connected from
BPConnectException - if there is no such conenction
BPInitException - some network weights are uninitialized
public double[][][] getWeights(BPLayer from1,
BPLayer from2)
throws org.retro.neural.BPConnectException,
org.retro.neural.BPInitException
from1 - layer connected fromfrom2 - layer connected from
BPConnectException - if there is no such conenction
BPInitException - some network weights are uninitialized
public double[] getBias()
throws org.retro.neural.BPInitException
BPInitException - if the bias is uninitialized
public double getRMSError()
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
BPInitException - if the weights are uninitialized
BPSizeException - if number of input and output patterns differs
public double getMaxError()
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
BPInitException - if some network weights are uninitialized
BPSizeException - if number of input and output patterns differs
public double[][] getSquaredErrors()
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
BPInitException - if some network weights are uninitialized
BPSizeException - if number of input and output patterns differspublic void connect(BPLayer from)
from - layer to connect from
public void connect(BPLayer from1,
BPLayer from2)
from1 - layer to connect fromfrom2 - layer to connect from
public void attach(double[][] pattern)
throws org.retro.neural.BPSizeException
pattern - pattern to attach
BPSizeException - on width/size mismatch
public void batch(int nep,
double eta,
double mu,
int report)
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
nep - number of epochs for trainingeta - learning ratemu - momentumreport - number of generations between error reports
BPInitException - if some network weights are uninitialized
BPSizeException - if lengths of patterns differ
public void batch(int nep,
double eta,
double mu)
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
nep - number of epochs for trainingeta - learning ratemu - momentum
BPInitException - if weights hav not been initialized
BPSizeException - if number of input and output patterns differs
public void batch(double eta,
double mu)
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
eta - learning ratemu - momentum
BPInitException - if some network weights haven't been initialized
BPSizeException - if number of input and output patterns differs
public void online(int nep,
double eta,
double mu,
int report)
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
nep - number of passes through dataeta - learning ratemu - momentumreport - number of generations between error reports
BPInitException - if some network weights are uninitialized
BPSizeException - if lengths of patterns differ
public void online(int nep,
double eta,
double mu)
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
nep - number of epochs for trainingeta - learning ratemu - momentum
BPInitException - if weights hav not been initialized
BPSizeException - if number of input and output patterns differs
public double[][] test()
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
BPInitException - if some network weights are uninitialized
BPSizeException - if number of input and output patterns differs
public double[][] test(int n,
double a)
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
n - number of steps to runa - intial activation value
BPInitException - if some network weights are uninitialized
BPSizeException - if number of input and output patterns differs
public void delay(BPLayer from,
double weight)
throws org.retro.neural.BPSizeException
from - layer to delay fromweight - connection strength
BPSizeException - if layers have different sizespublic void delay(BPLayer from)
from - layer to delay frompublic void resetMu()
public void bpttResetEta()
public void bpttUpdate(double eta,
double mu,
int npat)
throws org.retro.neural.BPMomentumException
eta - learning ratemu - momentumnpat - total number of patterns
BPMomentumException - if no momentum has been set on the layer
public double[] activate(BPLayer src,
double[] clmp)
src - "source" layer to clampclmp - vector of clamping values
BPConnectException - if there is no path between the layers
BPInitException - if some network weights are uninitialized
public void bpttPattern(int n)
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException,
java.lang.IllegalArgumentException
n - number of ticks from end of pattern
BPInitException - if some network weights are uninitialized
BPSizeException - if lengths of patterns differ
java.lang.IllegalArgumentException - if n < 0 or n >= current
pattern length
public void bpttPattern()
throws org.retro.neural.BPInitException,
org.retro.neural.BPSizeException
BPInitException - if some network weights are uninitialized
BPSizeException - if lengths of patterns differ
public static void reportValue(int iter,
int maxit,
int report,
double value,
java.io.PrintStream stream)
iter - iteration numbermaxit - maximum number of iterationsreport - reporting intervalvalue - value to reportstream - print stream that reports value
protected void activate(BPLayer src,
SNVector clmp)
throws org.retro.neural.BPConnectException,
org.retro.neural.BPInitException
org.retro.neural.BPConnectException
org.retro.neural.BPInitExceptionprotected void activate(int patno)
protected void mureset()
protected void dwreset()
protected void update(double eta,
double mu,
int npat)
throws org.retro.neural.BPMomentumException
org.retro.neural.BPMomentumExceptionprotected int size()
protected int patlen()
protected boolean hasPattern()
protected boolean isOutput()
protected void dwadd()
protected void dwset()
protected void dwavg(int npat)
protected boolean emptyWeights()
protected void backprop(int patno)
protected void bptt_inita()
protected void bptt_seta()
protected void bptt_geta()
protected void bptt_dwreset()
protected void bptt_dwadd()
protected void bptt_dwavg(int patlen)
protected void bptt_delayerr()
protected void bptt_saverr()
protected void bptt_errinit()
protected void actinit()
protected void actinit(double v)
protected void sqrerrinit(int patlen)
protected void delayact()
protected void errreset()
protected void mark()
protected void unmark()
protected double rmserr(int patlen)
protected double maxerr(int patlen)
protected boolean nosqrerrs()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||