Packages

c

scalation.analytics

NeuralNet_2L

class NeuralNet_2L extends NeuralNet

The NeuralNet_2L class supports multi-output, 2-layer (input 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 'bb' connecting the layers, so that for a new input vector 'z', the net can predict the output value, i.e.,

yp_j = f (bb dot z)

where 'f' is the activation function and the parameter matrix 'bb' gives the weights between input and output layers. No batching is used for this algorithm. Note, 'b0' is treated as the bias, so 'x0' must be 1.0.

Linear Supertypes
NeuralNet, Error, Predictor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NeuralNet_2L
  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_2L(x: MatriD, y: MatriD, eta_: Double = hp ("eta"), bSize: Int = hp ("bSize").toInt, maxEpochs: Int = hp ("maxEpochs").toInt, f1: AFF = f_sigmoid)

    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)

    eta_

    the learning/convergence rate

    bSize

    the batch size

    maxEpochs

    the maximum number of training epochs/iterations

    f1

    the activation function family for layers 1->2 (input to output)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val _1: VectorD
    Attributes
    protected
    Definition Classes
    NeuralNet
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. val b: VectoD
    Attributes
    protected
    Definition Classes
    Predictor
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  8. 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_2LNeuralNet
  9. def crossValidate(algor: (MatriD, MatriD) ⇒ NeuralNet, k: Int = 10, rando: Boolean = true): Array[Statistic]
    Definition Classes
    NeuralNet
  10. val e: VectoD
    Attributes
    protected
    Definition Classes
    Predictor
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. var eta: Double
    Attributes
    protected
    Definition Classes
    NeuralNet
  14. 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
  15. 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
  16. 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
  17. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. val fitA: Array[Fit]
    Attributes
    protected
    Definition Classes
    NeuralNet
  19. 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
  20. def fitMap(): Unit

    Show 'fitMap' for each y-column.

    Show 'fitMap' for each y-column.

    Definition Classes
    NeuralNet
  21. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  22. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. val m: Int
    Attributes
    protected
    Definition Classes
    NeuralNet
  26. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. val nx: Int
    Attributes
    protected
    Definition Classes
    NeuralNet
  30. val ny: Int
    Attributes
    protected
    Definition Classes
    NeuralNet
  31. def parameter: VectoD

    Return the vector of parameter/coefficient values.

    Return the vector of parameter/coefficient values.

    Definition Classes
    Predictor
  32. def predict(z: MatriD): MatriD

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

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

    z

    the input matrix

    Definition Classes
    NeuralNet_2LNeuralNet
  33. 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
  34. 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
  35. def predictV(z: VectoD): VectoD

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

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

    z

    the new input vector

    Definition Classes
    NeuralNet_2LNeuralNet
  36. def reset(eta_: Double): Unit

    Reset the learning rate 'eta'.

    Reset the learning rate 'eta'.

    eta_

    the learning rate

    Definition Classes
    NeuralNet
  37. def residual: VectoD

    Return the vector of residuals/errors.

    Return the vector of residuals/errors.

    Definition Classes
    Predictor
  38. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  39. def toString(): String
    Definition Classes
    AnyRef → Any
  40. def train(): NeuralNet_2L

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

    Given training data 'x' and 'y', fit the parameter/weight matrix 'bb'. Minimize the error in the prediction by adjusting the weight matrix '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_2LNeuralNet
  41. 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
  42. def train0(): NeuralNet_2L

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

    Given training data 'x' and 'y', fit the parameter/weight matrix 'bb'. Minimize the error in the prediction by adjusting the weight matrix 'bb'. The error 'ee' is simply the difference between the target value 'y' and the predicted value 'yp'. Minimize the dot product of error with itself using gradient-descent. specifically move in the opposite direction of the gradient. Iterate over several epochs (no batching).

  43. def train2(): NeuralNet_2L

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

    Given training data 'x' and 'y', fit the parameter/weight matrix 'bb'. Minimize the error in the prediction by adjusting the weight matrix 'bb'. Iterate over several epochs, where each epoch divides the training set into 'nbat' batches. Each batch is used to update the weights. This version preforms an interval search for the best 'eta' value.

  44. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  45. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  47. def weights: Array[MatriD]

    Return the weight matrix 'bb' (array of 1).

    Return the weight matrix 'bb' (array of 1).

    Definition Classes
    NeuralNet_2LNeuralNet

Inherited from NeuralNet

Inherited from Error

Inherited from Predictor

Inherited from AnyRef

Inherited from Any

Ungrouped