class NeuralNet_XL extends NeuralNet
The NeuralNet_XL
class supports multi-output, multi-layer (input, multiple hidden and output)
Neural-Networks. It can be used for both classification and prediction,
depending on the activation functions used. Given several input vectors and output
vectors (training data), fit the weight and bias parameters connecting the layers,
so that for a new input vector 'v', the net can predict the output value
This implementation is partially adapted from Michael Nielsen's Python implementation found in
- See also
github.com/MichalDanielDobrzanski/DeepLearningPython35/blob/master/network2.py ------------------------------------------------------------------------------
github.com/mnielsen/neural-networks-and-deep-learning/blob/master/src/network2.py
- Alphabetic
- By Inheritance
- NeuralNet_XL
- NeuralNet
- Error
- Predictor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
NeuralNet_XL(x: MatriD, y: MatriD, nh: Array[Int] = null, eta_: Double = hp ("eta"), bSize: Int = hp ("bSize").toInt, maxEpochs: Int = hp ("maxEpochs").toInt, lambda: Double = 0.0, actfV: Array[FunctionV_2V] = Array (sigmoidV, sigmoidV), actfDM: Array[FunctionM_2M] = Array (sigmoidDM, sigmoidDM))
- x
the m-by-nx input matrix (training data consisting of m input vectors)
- y
the m-by-ny output matrix (training data consisting of m output vectors)
- nh
the number of nodes in each hidden layer, e.g., Array (5, 10) means 2 hidden with sizes 5 and 10
- eta_
the learning/convergence rate (typically less than 1.0)
- bSize
the mini-batch size
- maxEpochs
the maximum number of training epochs/iterations
- lambda
the regularization parameter
- actfV
the array of activation function (mapping vector => vector) between every pair of layers
- actfDM
the array of derivative of the matrix activation functions
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
_1: VectorD
- Attributes
- protected
- Definition Classes
- NeuralNet
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
b: VectoD
- Attributes
- protected
- Definition Classes
- Predictor
-
def
biases: Array[VectoD]
Return the bias vectors.
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
crossVal(k: Int = 10, rando: Boolean = true): Unit
Perform 'k'-fold cross-validation.
Perform 'k'-fold cross-validation.
- k
the number of folds
- rando
whether to use randomized cross-validation
- Definition Classes
- NeuralNet_XL → NeuralNet
-
def
crossValidate(algor: (MatriD, MatriD) ⇒ NeuralNet, k: Int = 10, rando: Boolean = true): Array[Statistic]
- Definition Classes
- NeuralNet
-
val
e: VectoD
- Attributes
- protected
- Definition Classes
- Predictor
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
var
eta: Double
- Attributes
- protected
- Definition Classes
- NeuralNet
-
def
eval(xx: MatriD, yy: MatriD): Unit
Evaluate the quality of the fit for the parameter/weight matrices on the test dataset.
Evaluate the quality of the fit for the parameter/weight matrices on the test dataset.
- xx
the test input data matrix
- yy
the test output response matrix
- Definition Classes
- NeuralNet
-
def
eval(): Unit
Evaluate the quality of the fit for the parameter weight matrices on the the entire dataset or the training dataset.
-
def
eval(xx: MatriD, yy: VectoD): Unit
Compute the error and useful diagnostics for the test dataset.
Compute the error and useful diagnostics for the test dataset.
- xx
the test data matrix
- yy
the test response vector FIX - implement in classes
- Definition Classes
- Predictor
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
val
fitA: Array[Fit]
- Attributes
- protected
- Definition Classes
- NeuralNet
-
def
fitLabel: Seq[String]
Return the labels for the quality of fit measures.
Return the labels for the quality of fit measures.
- Definition Classes
- NeuralNet
-
def
fitMap(): Unit
Show 'fitMap' for each y-column.
Show 'fitMap' for each y-column.
- Definition Classes
- NeuralNet
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
m: Int
- Attributes
- protected
- Definition Classes
- NeuralNet
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
val
nx: Int
- Attributes
- protected
- Definition Classes
- NeuralNet
-
val
ny: Int
- Attributes
- protected
- Definition Classes
- NeuralNet
-
def
parameter: VectoD
Return the vector of parameter/coefficient values.
Return the vector of parameter/coefficient values.
- Definition Classes
- Predictor
-
def
predict(x: MatriD): MatriD
Given an input matrix 'x', predict the output/response matrix 'f(x)'.
Given an input matrix 'x', predict the output/response matrix 'f(x)'.
- x
the input matrix
- Definition Classes
- NeuralNet_XL → NeuralNet
-
def
predict(z: VectoD): Double
Given a new input vector 'z', predict the output/response value 'f(z)'.
-
def
predict(z: VectoI): Double
Given a new discrete data vector z, predict the y-value of f(z).
Given a new discrete data vector z, predict the y-value of f(z).
- z
the vector to use for prediction
- Definition Classes
- Predictor
-
def
predictV(v: VectoD): VectoD
Given a new input vector 'v', predict the output/response vector 'f(v)'.
Given a new input vector 'v', predict the output/response vector 'f(v)'.
- v
the new input vector
- Definition Classes
- NeuralNet_XL → NeuralNet
-
def
reset(eta_: Double): Unit
Reset the learning rate 'eta'.
-
def
residual: VectoD
Return the vector of residuals/errors.
Return the vector of residuals/errors.
- Definition Classes
- Predictor
-
def
setWeights(stream: Int = 0, limit: Double = 1.0 / sqrt (nx)): Unit
Set the initial weight matrices 'aa' and 'bi' with values in (0, limit) before training.
Set the initial weight matrices 'aa' and 'bi' with values in (0, limit) before training.
- stream
the random number stream to use
- limit
the maximum value for any weight
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
train(): NeuralNet_XL
Given training data 'x' and 'y', fit the parameter/weight matrices 'aa' and 'bi'.
Given training data 'x' and 'y', fit the parameter/weight matrices 'aa' and 'bi'. Iterate over several epochs, where each epoch divides the training set into 'nbat' batches. Each batch is used to update the weights.
- Definition Classes
- NeuralNet_XL → NeuralNet
-
def
train(yy: VectoD): NeuralNet
Given training data 'x' and 'yy', fit the parameter/weight matrix.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
weights: Array[MatriD]
Return the weight matrices.
Return the weight matrices.
- Definition Classes
- NeuralNet_XL → NeuralNet