Packages

sealed trait Variable extends AnyRef

A value of a tensor valued function, a vertex in the computational graph.

A Variable may be constant, i.e. depends on no other Variables. Constant variables may or may not need their partial derivatives computed.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Variable
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def op: Option[Op]

    The parent operation of this value in the computational graph.

    The parent operation of this value in the computational graph. Empty for constants.

  2. abstract def partialDerivative: Option[STen]

    The partial derivative, or a placeholder tensor for the partial derivative.

    The partial derivative, or a placeholder tensor for the partial derivative.

    Returns empty iff this Variable needs no gradient computation. Otherwise a placeholder tensor is allocated upfront when the Variable is allocated.

  3. abstract def value: STen

    The actual tensor value of this Variable.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def *[S](other: Double)(implicit arg0: Sc[S]): Variable
  4. def *[S](other: Variable)(implicit arg0: Sc[S]): Variable
  5. def +[S](other: Double)(implicit arg0: Sc[S]): Variable
  6. def +[S](other: Variable)(implicit arg0: Sc[S]): Variable
  7. def -[S](other: Variable)(implicit arg0: Sc[S]): Variable
  8. def /[S](other: Variable)(implicit arg0: Sc[S]): Variable
  9. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def argmax[S](dim: Long, keepDim: Boolean)(implicit arg0: Sc[S]): Variable
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def assign[S](other: Variable)(implicit arg0: Sc[S]): Variable
  13. def atan[S](implicit arg0: Sc[S]): Variable
  14. def backprop(): Unit

    Runs the backpropagation algorithm starting from this value

    Runs the backpropagation algorithm starting from this value

    Only meaningful if this is scalar i.e. the number of elements in the value tensor is 1.

  15. def binaryCrossEntropyWithLogitsLoss[S](target: STen, posWeights: Option[STen] = None, reduction: Reduction = Mean)(implicit arg0: Sc[S]): Variable
  16. def bmm[S](other: Variable)(implicit arg0: Sc[S]): Variable
  17. def cast[S](precision: FloatingPointPrecision)(implicit arg0: Sc[S]): Variable
  18. def cat[S](other: Variable, dim: Long)(implicit arg0: Sc[S]): Variable
  19. def cholesky[S](upper: Boolean = false)(implicit arg0: Sc[S]): Variable
  20. def choleskySolve[S](factor: Variable, upper: Boolean = false)(implicit arg0: Sc[S]): Variable
  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  22. def colSum[S](implicit arg0: Sc[S]): Variable
  23. def cos[S](implicit arg0: Sc[S]): Variable
  24. def cross[S](other: Variable, dim: Int)(implicit arg0: Sc[S]): Variable
  25. def crossEntropy[S](other: Variable)(implicit arg0: Sc[S]): Variable
  26. def detached: Constant

    Returns an other Variable wrapping the same value tensor, without any parent and with needsGrad=false.

  27. def diag[S](diagonal: Long)(implicit arg0: Sc[S]): Variable
  28. def dropout[S](prob: Double, train: Boolean)(implicit arg0: Sc[S]): Variable
  29. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  31. def euclideanDistance[S](b: Variable, dim: Int)(implicit arg0: Sc[S]): Variable
  32. def exp[S](implicit arg0: Sc[S]): Variable
  33. def expandAs[S](other: STen)(implicit arg0: Sc[S]): Variable
  34. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  35. def flatten[S](startDim: Int, endDim: Int)(implicit arg0: Sc[S]): Variable
  36. def flatten[S](startDim: Int)(implicit arg0: Sc[S]): Variable
  37. def flatten[S](implicit arg0: Sc[S]): Variable
  38. def flattenLastDimensions[S](dims: Int)(implicit arg0: Sc[S]): Variable
  39. def gelu[S](implicit arg0: Sc[S]): Variable
  40. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  41. def graphMemoryAllocationReport: GraphMemoryAllocationReport
  42. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  43. val id: UUID

    Returns unique, stable and random UUID.

  44. def indexAdd[S](index: Variable, dim: Int, maxIndex: Long)(implicit arg0: Sc[S]): Variable
  45. def indexAddFromSource[S](index: Variable, dim: Int, source: Variable)(implicit arg0: Sc[S]): Variable
  46. def indexFill[S](index: Variable, dim: Int, fillValue: Double)(implicit arg0: Sc[S]): Variable
  47. def indexSelect[S](dim: Long, index: Variable)(implicit arg0: Sc[S]): Variable
  48. def inv[S](implicit arg0: Sc[S]): Variable
  49. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  50. def l1Loss[S](target: STen, reduction: Reduction = Mean)(implicit arg0: Sc[S]): Variable
  51. def leakyRelu[S](negativeSlope: Double)(implicit arg0: Sc[S]): Variable
  52. def log[S](implicit arg0: Sc[S]): Variable
  53. def log1p[S](implicit arg0: Sc[S]): Variable
  54. def logSoftMax[S](dim: Int)(implicit arg0: Sc[S]): Variable
  55. def logdet[S](implicit arg0: Sc[S]): Variable
  56. def makeBooleanMask[S](q: Long)(implicit arg0: Sc[S]): Variable
  57. def maskFill[S](mask: Variable, fill: Double)(implicit arg0: Sc[S]): Variable
  58. def maskSelect[S](mask: Variable)(implicit arg0: Sc[S]): Variable
  59. def mean[S](dim: List[Int], keepDim: Boolean)(implicit arg0: Sc[S]): Variable
  60. def mean[S](dim: List[Int])(implicit arg0: Sc[S]): Variable
  61. def mm[S](other: Variable)(implicit arg0: Sc[S]): Variable
  62. def mseLoss[S](target: STen, reduction: Reduction = Mean)(implicit arg0: Sc[S]): Variable
  63. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  64. def needsGrad: Boolean

    Returns true if lamp.autograd.Variable.partialDerivative is defined.

  65. def nllLoss[S](target: STen, weights: STen, reduction: Reduction = Mean, ignore: Long = -100L)(implicit arg0: Sc[S]): Variable
  66. def normalize[S](dim: List[Int], eps: Double)(implicit arg0: Sc[S]): Variable
  67. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  68. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  69. def oneHot[S](numClasses: Int)(implicit arg0: Sc[S]): Variable
  70. def options[S](implicit arg0: Sc[S]): STenOptions

    Returns the tensor options of its value.

  71. def pinv[S](rcond: Double = 1e-5)(implicit arg0: Sc[S]): Variable
  72. def pow[S](exponent: Variable)(implicit arg0: Sc[S]): Variable
  73. def pow[S](const: Double)(implicit arg0: Sc[S]): Variable
  74. def relu[S](implicit arg0: Sc[S]): Variable
  75. def repeatInterleave[S](repeats: Variable, dim: Int)(implicit arg0: Sc[S]): Variable
  76. def reshape[S](shape: List[Long])(implicit arg0: Sc[S]): Variable
  77. def rowSum[S](implicit arg0: Sc[S]): Variable
  78. def scatterAdd[S](index: Variable, dim: Int, maxIndex: Long)(implicit arg0: Sc[S]): Variable
  79. def select[S](dim: Long, index: Long)(implicit arg0: Sc[S]): Variable
  80. def shape: List[Long]

    Returns the shape of its value.

  81. def sigmoid[S](implicit arg0: Sc[S]): Variable
  82. def sin[S](implicit arg0: Sc[S]): Variable
  83. val sizes: List[Long]

    Returns the shape of its value.

  84. def softplus[S](beta: Double, threshold: Double)(implicit arg0: Sc[S]): Variable
  85. def squaredFrobenius[S](implicit arg0: Sc[S]): Variable
  86. def sum[S](dim: List[Int], keepDim: Boolean)(implicit arg0: Sc[S]): Variable
  87. def sum[S](implicit arg0: Sc[S]): Variable
  88. def swish1[S](implicit arg0: Sc[S]): Variable
  89. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  90. def t[S](implicit arg0: Sc[S]): Variable

    Returns a new variable with the first two dimensions transposed.

  91. def tan[S](implicit arg0: Sc[S]): Variable
  92. def tanh[S](implicit arg0: Sc[S]): Variable
  93. def toDense[S](implicit arg0: Sc[S]): Variable
  94. def toLongMat: Mat[Long]
  95. def toMat: Mat[Double]
  96. def toString(): String
    Definition Classes
    Variable → AnyRef → Any
  97. def transpose[S](dim1: Int, dim2: Int)(implicit arg0: Sc[S]): Variable

    Returns a new variable with the respective dimensions transposed.

  98. def variance[S](dim: List[Int])(implicit arg0: Sc[S]): Variable
  99. def view[S](shape: List[Long])(implicit arg0: Sc[S]): Variable
  100. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  101. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  102. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  103. lazy val wengert: Seq[Variable]

    Returns the Wengert list

  104. def withGrad[S](implicit arg0: Sc[S]): ConstantWithGrad

    Returns an other Variable wrapping the same value tensor, without any parent and with needsGrad=true.

  105. def zeroGrad(): Unit

    In place zeros out the partial derivative

  106. def zipBackward(fn: (STen, STen) => Unit): (Variable, (STen, STen) => Unit)

    Returns a pair of this instance and the supplied function

Inherited from AnyRef

Inherited from Any

Ungrouped