Packages

c

scalation.analytics

RecurrentNeuralNet

class RecurrentNeuralNet extends Error

The RecurrentNeuralNet class feeds input in sequential time into hidden layer. It uses parameter U, W, V in network. where U is parameter for input x, W is for hidden layer z, and V is for output y We have 'St = Activate (U dot x(t) + W dot x(t-1))' and 'y(t) = softmax(V dot St)'

See also

github.com/pangolulu/rnn-from-scratch ----------------------------------------------------------------------------

Linear Supertypes
Error, Throwable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RecurrentNeuralNet
  2. Error
  3. Throwable
  4. Serializable
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RecurrentNeuralNet(data_dim: Int, hidden_dim: Int, bptt_truncate: Int = 4)

    data_dim

    the dimension of the data space

    hidden_dim

    the dimension of the hidden layer

    bptt_truncate

    truncate bptt, clip to constrain the dependcy to avoid gradient vanish/explode

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. final def addSuppressed(arg0: Throwable): Unit
    Definition Classes
    Throwable
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def bptt(x: VectoD, label: VectoD): (MatrixD, MatrixD, MatrixD)

    Use back propogation through time 'bptt' to calculates dl/dV, dl/dU, dl/dW where l is the loss.

    Use back propogation through time 'bptt' to calculates dl/dV, dl/dU, dl/dW where l is the loss.

    x

    the input data

    label

    the class labels (given ouput values)

  7. def calculate_loss(x: VectoD, label: VectoD): Double

    Calculate the loss from the prediction of 'x' and 'label' by adding up the prediction loss among rnn layers.

    Calculate the loss from the prediction of 'x' and 'label' by adding up the prediction loss among rnn layers.

    x

    the input data

    label

    the class labels (given ouput values)

  8. def calculate_total_loss(x: List[VectoD], label: List[VectoD]): Double

    Calculate the total loss.

    Calculate the total loss.

    x

    the input data

    label

    the class labels (given ouput values)

  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def fillInStackTrace(): Throwable
    Definition Classes
    Throwable
  13. def forward_propagation(x: VectoD): List[RecurrentNeuralNetLayer]

    Forward the input and generate several RNN layers.

    Forward the input and generate several RNN layers.

    x

    the data input

  14. def getCause(): Throwable
    Definition Classes
    Throwable
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. def getLocalizedMessage(): String
    Definition Classes
    Throwable
  17. def getMessage(): String
    Definition Classes
    Throwable
  18. def getStackTrace(): Array[StackTraceElement]
    Definition Classes
    Throwable
  19. final def getSuppressed(): Array[Throwable]
    Definition Classes
    Throwable
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. def initCause(arg0: Throwable): Throwable
    Definition Classes
    Throwable
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  26. def printStackTrace(arg0: PrintWriter): Unit
    Definition Classes
    Throwable
  27. def printStackTrace(arg0: PrintStream): Unit
    Definition Classes
    Throwable
  28. def printStackTrace(): Unit
    Definition Classes
    Throwable
  29. var rvm: RandomMatD
  30. def setStackTrace(arg0: Array[StackTraceElement]): Unit
    Definition Classes
    Throwable
  31. def sgd_step(x: VectoD, label: VectoD, learning_rate: Double): MatrixD

    Stochastic gradient descent step.

    Stochastic gradient descent step.

    x

    the input data

    label

    the class labels (given ouput values)

  32. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  33. def toString(): String
    Definition Classes
    Throwable → AnyRef → Any
  34. def train(x: List[VectoD], label: List[VectoD], rate: Double = 500.0, nepoch: Int, eval_loss_after: Int = 5): Unit

    Train the model by iterating throught the training set by sgd and adjusting the learning rate.

    Train the model by iterating throught the training set by sgd and adjusting the learning rate.

    x

    the input data

    label

    the class labels (given ouput values)

    rate

    the initial learning rate (gradient multiplier)

    nepoch

    number of epoch

    eval_loss_after

    number of epoch to conduct evaluation

  35. val u: MatrixD
  36. val v: MatrixD
  37. val w: MatrixD
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  40. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Error

Inherited from Throwable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped