scalation.analytics

NeuralNet

class NeuralNet extends Predictor with Error

This class supports basic 3-layer (input, hidden and output) Neural Networks. Given several input and output vectors (training data), fit the weights connecting the layers, so that for a new input vector z_i, the net can predict the output vector z_o, i.e., z_i --> z_h = f (w * z_i) --> z_o = g (v * z_h)

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

Instance Constructors

  1. new NeuralNet(x: MatrixD, y: MatrixD, h: Int)

    x

    the input matrix (training data consisting of m input vectors)

    y

    the output matrix (training data consisting of m output vectors)

    h

    the number of neurons in the hidden layer

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def backProp(): Unit

    Use back propogation to adjust the weight matrices w and v to make the predictions more accurate.

    Use back propogation to adjust the weight matrices w and v to make the predictions more accurate. The implementation uses vector operations.

    See also

    http://www4.rgu.ac.uk/files/chapter3%20-%20bp.pdf

  8. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def fit: (MatrixD, MatrixD, VectorD, VectorD)

    Return the fit (weigth matrix w, weigth matrix v, bias vector wb, bias vector vb)

  13. def flaw(method: String, message: String): Unit

    Show the flaw by printing the error message.

    Show the flaw by printing the error message.

    method

    the method where the error occurred

    message

    the error message

    Definition Classes
    Error
  14. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. def predict(z_i: MatrixD): VectorD

    Given several input vectors z_i, predict the output/response vector z_o(0).

    Given several input vectors z_i, predict the output/response vector z_o(0). May use this method if the output is one dimensional or interested in 1st value.

    z_i

    the new input vectors (stored as rows in a matrix)

    Definition Classes
    NeuralNetPredictor
  21. def predict(z_i: VectorD): Double

    Given an input vector z_i, predict the output/response scalar z_o(0).

    Given an input vector z_i, predict the output/response scalar z_o(0). May use this method if the output is one dimensional or interested in 1st value.

    z_i

    the new input vector

    Definition Classes
    NeuralNetPredictor
  22. def predict(z: VectorI): 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
  23. def predictAll(z_i: MatrixD): MatrixD

    Given several input vectors z_i, predict the output/response vectors z_o.

    Given several input vectors z_i, predict the output/response vectors z_o.

    z_i

    the new input vectors (stored as rows in a matrix)

  24. def predictAll(z_i: VectorD): VectorD

    Given an input vector z_i, predict the output/response vector z_o.

    Given an input vector z_i, predict the output/response vector z_o.

    z_i

    the new input vector

  25. def setWeights(i: Int = 0): Unit

    Set the initial weight matrices w and v randomly with a value in (0, 1) before training.

    Set the initial weight matrices w and v randomly with a value in (0, 1) before training.

    i

    the random number stream to use

  26. def setWeights(w0: MatrixD, v0: MatrixD, wb0: VectorD, vb0: VectorD): Unit

    Set the initial weight matrices w and v manually before training.

    Set the initial weight matrices w and v manually before training.

    w0

    the initial weights for w

    v0

    the initial weights for v

    wb0

    the initial bias for wb

    vb0

    the initial bias for vb

  27. def sigmoid(t: VectorD): VectorD

    Return the vector of values of the sigmoid function applied to vector t.

    Return the vector of values of the sigmoid function applied to vector t.

    t

    the sigmoid function vector argument

  28. def sigmoid(t: Double): Double

    Return the value of the sigmoid function at t.

    Return the value of the sigmoid function at t.

    t

    the sigmoid function argument

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. def train(): Unit

    Given training data x and y, fit the weight matrices w and v.

    Given training data x and y, fit the weight matrices w and v.

    Definition Classes
    NeuralNetPredictor
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Error

Inherited from Predictor

Inherited from AnyRef

Inherited from Any