Packages

  • package root
    Definition Classes
    root
  • package lamp

    Lamp provides utilities to build state of the art machine learning applications

    Lamp provides utilities to build state of the art machine learning applications

    Overview

    Notable types and packages:

    • lamp.STen is a memory managed wrapper around aten.ATen, an off the heap, native n-dimensionl array backed by libtorch.
    • lamp.autograd implements reverse mode automatic differentiation.
    • lamp.nn contains neural network building blocks, see e.g. lamp.nn.Linear.
    • lamp.data.IOLoops implements a training loop and other data related abstractions.
    • lamp.knn implements k-nearest neighbor search on the CPU and GPU
    • lamp.umap.Umap implements the UMAP dimension reduction algorithm
    • lamp.onnx implements serialization of computation graphs into ONNX format
    • lamp.io contains CSV and NPY readers
    How to get data into lamp

    Use one of the file readers in lamp.io or one of the factories in lamp.STen$.

    How to define a custom neural network layer

    See the documentation on lamp.nn.GenericModule

    How to compose neural network layers

    See the documentation on lamp.nn

    How to train models

    See the training loops in lamp.data.IOLoops

    Definition Classes
    root
  • package autograd

    Implements reverse mode automatic differentiaton

    Implements reverse mode automatic differentiaton

    The main types in this package are lamp.autograd.Variable and lamp.autograd.Op. The computational graph built by this package consists of vertices representing values (as lamp.autograd.Variable) and vertices representing operations (as lamp.autograd.Op).

    Variables contain the value of a Rn => Rm function. Variables may also contain the partial derivative of their argument with respect to a single scalar. A Variable whose value is a scalar (m=1) can trigger the computation of partial derivatives of all the intermediate upstream Variables. Computing partial derivatives with respect to non-scalar variables is not supported.

    A constant Variable may be created with the const or param factory method in this package. const may be used for constants which do not need their partial derivatives to be computed. param on the other hand create Variables which will fill in their partial derivatives. Further variables may be created by the methods in this class, eventually expressing more complex Rn => Rm functions.

    Example
    lamp.Scope.root{ implicit scope =>
      // x is constant (depends on no other variables) and won't compute a partial derivative
      val x = lamp.autograd.const(STen.eye(3, STenOptions.d))
      // y is constant but will compute a partial derivative
      val y = lamp.autograd.param(STen.ones(List(3,3), STenOptions.d))
    
      // z is a Variable with x and y dependencies
      val z = x+y
    
      // w is a Variable with z as a direct and x, y as transient dependencies
      val w = z.sum
      // w is a scalar (number of elements is 1), thus we can call backprop() on it.
      // calling backprop will fill out the partial derivatives of the upstream variables
      w.backprop()
    
      // partialDerivative is empty since we created `x` with `const`
      assert(x.partialDerivative.isEmpty)
    
      // `y`'s partial derivatie is defined and is computed
      // it holds `y`'s partial derivative with respect to `w`, the scalar which we called backprop() on
      assert(y.partialDerivative.isDefined)
    
    }

    This package may be used to compute the derivative of any function, provided the function can be composed out of the provided methods. A particular use case is gradient based optimization.

    Definition Classes
    lamp
    See also

    https://arxiv.org/pdf/1811.05031.pdf for a review of the algorithm

    lamp.autograd.Op for how to implement a new operation

  • package data
    Definition Classes
    lamp
  • package distributed
    Definition Classes
    lamp
  • package extratrees
    Definition Classes
    lamp
  • package knn
    Definition Classes
    lamp
  • package nn

    Provides building blocks for neural networks

    Provides building blocks for neural networks

    Notable types:

    Optimizers:

    Modules facilitating composing other modules:

    • nn.Sequential composes a homogenous list of modules (analogous to List)
    • nn.sequence composes a heterogeneous list of modules (analogous to tuples)
    • nn.EitherModule composes two modules in a scala.Either

    Examples of neural network building blocks, layers etc:

    Definition Classes
    lamp
  • package onnx
    Definition Classes
    lamp
  • package saddle
    Definition Classes
    lamp
  • package umap
    Definition Classes
    lamp
  • package util
    Definition Classes
    lamp
  • BufferPair
  • CPU
  • CudaDevice
  • Device
  • DoublePrecision
  • EmptyMovable
  • FloatingPointPrecision
  • HalfPrecision
  • MPS
  • Movable
  • NcclUniqueId
  • STen
  • STenOptions
  • Scope
  • SinglePrecision
  • TensorHelpers

object EmptyMovable

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

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. implicit def ArrayIsMovable[T](implicit arg0: EmptyMovable[T]): EmptyMovable[Array[T]]
    Annotations
    @nowarn()
  5. implicit def BooleanIsMovable: EmptyMovable[Boolean]
  6. implicit def ByteIsMovable: EmptyMovable[Byte]
  7. implicit def CharIsMovable: EmptyMovable[Char]
  8. implicit def DoubleIsMovable: EmptyMovable[Double]
  9. implicit def EitherIsMovable[T1, T2](implicit arg0: EmptyMovable[T1], arg1: EmptyMovable[T2]): EmptyMovable[Either[T1, T2]]
    Annotations
    @nowarn()
  10. implicit def FloatIsMovable: EmptyMovable[Float]
  11. implicit def IntIsMovable: EmptyMovable[Int]
  12. implicit def LongIsMovable: EmptyMovable[Long]
  13. implicit def OptionIsMovable[T](implicit arg0: EmptyMovable[T]): EmptyMovable[Option[T]]
    Annotations
    @nowarn()
  14. implicit def SeqIsMovable[T](implicit arg0: EmptyMovable[T]): EmptyMovable[Seq[T]]
    Annotations
    @nowarn()
  15. implicit def ShortIsMovable: EmptyMovable[Short]
  16. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  17. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  20. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def make[T]: EmptyMovable[T]
  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  27. implicit def stringIsMovable: EmptyMovable[String]
  28. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  29. implicit def t2[T1, T2](implicit arg0: EmptyMovable[T1], arg1: EmptyMovable[T2]): EmptyMovable[(T1, T2)]
    Annotations
    @nowarn()
  30. implicit def t3[T1, T2, T3](implicit arg0: EmptyMovable[T1], arg1: EmptyMovable[T2], arg2: EmptyMovable[T3]): EmptyMovable[(T1, T2, T3)]
    Annotations
    @nowarn()
  31. implicit def t4[T1, T2, T3, T4](implicit arg0: EmptyMovable[T1], arg1: EmptyMovable[T2], arg2: EmptyMovable[T3], arg3: EmptyMovable[T4]): EmptyMovable[(T1, T2, T3, T4)]
    Annotations
    @nowarn()
  32. implicit def t5[T1, T2, T3, T4, T5](implicit arg0: EmptyMovable[T1], arg1: EmptyMovable[T2], arg2: EmptyMovable[T3], arg3: EmptyMovable[T4], arg4: EmptyMovable[T5]): EmptyMovable[(T1, T2, T3, T4, T5)]
    Annotations
    @nowarn()
  33. implicit def t6[T1, T2, T3, T4, T5, T6](implicit arg0: EmptyMovable[T1], arg1: EmptyMovable[T2], arg2: EmptyMovable[T3], arg3: EmptyMovable[T4], arg4: EmptyMovable[T5], arg5: EmptyMovable[T6]): EmptyMovable[(T1, T2, T3, T4, T5, T6)]
    Annotations
    @nowarn()
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. implicit def unitIsMovable: EmptyMovable[Unit]
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

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

    (Since version 9)

Inherited from AnyRef

Inherited from Any

Ungrouped