Packages

c

scalation.analytics

NeuralNet_3L

class NeuralNet_3L extends NeuralNet

The NeuralNet_3L class supports multi-output, 3-layer (input, 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 weights/parameters 'aa' and 'bb' connecting the layers, so that for a new input vector 'v', the net can predict the output value, i.e.,

yp = f2 (bb * f1V (aa * v))

where 'f1' and 'f2' are the activation functions and the parameter matrices 'aa' and 'bb' gives the weights between input-hidden and hidden-output layers. Note, if 'a0' is to be treated as bias/intercept, 'x0' must be 1.0.

Linear Supertypes
NeuralNet, Error, Predictor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NeuralNet_3L
  2. NeuralNet
  3. Error
  4. Predictor
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new NeuralNet_3L(x: MatriD, y: MatriD, nz: Int = -1, eta: Double = 0.1, bsize: Int = 5, f1: FunctionS2S = sigmoid, f1D: FunctionM_2M = sigmoidDM, f2: FunctionS2S = sigmoid, f2D: FunctionM_2M = 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)

    nz

    the number of nodes in hidden layer

    eta

    the learning/convergence rate (typically less than 1.0)

    f1

    the input-hidden layer activation function (mapping scalar => scalar)

    f1D

    the derivative of the vector activation function

Value Members

  1. def coefficient: VectoD

    Return the vector of coefficient/parameter values.

    Return the vector of coefficient/parameter values.

    Definition Classes
    Predictor
  2. def crossVal(k: Int = 10): Unit

    Perform 'k'-fold cross-validation.

    Perform 'k'-fold cross-validation.

    k

    the number of folds

    Definition Classes
    NeuralNet_3LNeuralNet
  3. def crossValidate(algor: (MatriD, MatriD) ⇒ NeuralNet, k: Int = 10): Array[Statistic]
    Definition Classes
    NeuralNet
  4. var eta: Double
  5. 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
  6. def eval(): Unit

    Evaluate the quality of the fit for the parameter weight matrices on the the entire dataset or the training dataset.

    Evaluate the quality of the fit for the parameter weight matrices on the the entire dataset or the training dataset.

    Definition Classes
    NeuralNetPredictor
  7. 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
  8. 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
  9. def fitMap(): Unit

    Show 'fitMap' for each y-column.

    Show 'fitMap' for each y-column.

    Definition Classes
    NeuralNet
  10. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  11. def predict(x: MatriD): MatriD

    Given a new input matrix 'z', predict the output/response matrix 'f(z)'.

    Given a new input matrix 'z', predict the output/response matrix 'f(z)'.

    Definition Classes
    NeuralNet_3LNeuralNet
  12. def predict(z: VectoD): Double

    Given a new input vector 'z', predict the output/response value 'f(z)'.

    Given a new input vector 'z', predict the output/response value 'f(z)'. Return only the first output variable's value.

    z

    the new input vector

    Definition Classes
    NeuralNetPredictor
  13. 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
  14. 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_3LNeuralNet
  15. def reset(eta_: Double): Unit

    Reset the learning rate 'eta'.

    Reset the learning rate 'eta'.

    eta_

    the learning rate

    Definition Classes
    NeuralNet
  16. def residual: VectoD

    Return the vector of residuals/errors.

    Return the vector of residuals/errors.

    Definition Classes
    Predictor
  17. def setWeights(stream: Int = 0, limit: Double = 1.0 / sqrt (nx)): Unit

    Set the initial weight matrices 'aa' and 'bb' with values in (0, limit) before training.

    Set the initial weight matrices 'aa' and 'bb' with values in (0, limit) before training.

    stream

    the random number stream to use

    limit

    the maximum value for any weight

    Definition Classes
    NeuralNet_3LNeuralNet
  18. def train(): NeuralNet_3L

    Given training data 'x' and 'y', fit the parameter/weight matrices 'aa' and 'bb'.

    Given training data 'x' and 'y', fit the parameter/weight matrices 'aa' and 'bb'. 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_3LNeuralNet
  19. def train(yy: VectoD): NeuralNet

    Given training data 'x' and 'yy', fit the parameter/weight matrix.

    Given training data 'x' and 'yy', fit the parameter/weight matrix.

    yy

    the vector of outputs for the first variable (currently ignored)

    Definition Classes
    NeuralNetPredictor
  20. def weights: Array[MatriD]

    Return the weight matrices 'aa' and 'bb'.

    Return the weight matrices 'aa' and 'bb'.

    Definition Classes
    NeuralNet_3LNeuralNet