Object/Class

ml.combust.bundle.dsl

Value

Related Docs: class Value | package dsl

Permalink

object Value extends Serializable

Provides a set of helper methods for easily creating ml.combust.bundle.dsl.Value objects.

Easily create ml.combust.bundle.dsl.Value objects of any type using the helper methods provided here. The helper methods will wrap a Scala value for later serializing into Bundle.ML.

Also provides several helper methods for converting from Bundle.ML protobuf objects back into wrapped Scala objects.

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

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def basicDataType(basic: BasicType): DataType

    Permalink

    Create a basic data type.

    Create a basic data type.

    Basic data types are string, long, double, boolean.

    basic

    string, long, double, or boolean

    returns

    data type for the basic type

  6. def boolean(value: Boolean): Value

    Permalink

    Create a boolean value.

    Create a boolean value.

    value

    value to wrap

    returns

    wrapped value

  7. val booleanDataType: DataType

    Permalink
  8. def booleanList(value: Seq[Boolean]): Value

    Permalink

    Create a list of booleans value.

    Create a list of booleans value.

    value

    Scala boolean list

    returns

    wrapped value

  9. val booleanListDataType: DataType

    Permalink
  10. def bundleValue(dataType: DataType, value: Any)(implicit hr: HasBundleRegistry): bundle.Value.Value

    Permalink

    Converts a Scala value to a protobuf value.

    Converts a Scala value to a protobuf value.

    dataType

    type of Scala value

    value

    Scala value to convert

    hr

    bundle registry for custom types

    returns

    protobuf value of the Scala value

  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def custom[T](value: T)(implicit arg0: ClassTag[T], hr: HasBundleRegistry): Value

    Permalink

    Create a custom value.

    Create a custom value.

    T

    Scala class of the custom value

    value

    value to wrap

    hr

    bundle registry for custom value serializer

    returns

    wrapped custom value

  13. def customDataType[T](implicit arg0: ClassTag[T], hr: HasBundleRegistry): DataType

    Permalink

    Create a custom data type.

    Create a custom data type.

    Custom data types are used to store arbitrary Scala objects.

    T

    Scala class of the custom value

    hr

    bundle registry for custom value serializer

    returns

    data type for the custom value

  14. def customList[T](value: Seq[T])(implicit arg0: ClassTag[T], hr: HasBundleRegistry): Value

    Permalink

    Create a list of custom objects value.

    Create a list of custom objects value.

    T

    Scala class of the custom values

    value

    Scala list of custom objects

    hr

    bundle registry for constructing custom data type

    returns

    wrapped custom list

  15. def customListN[T](n: Int, value: Seq[_])(implicit arg0: ClassTag[T], hr: HasBundleRegistry): Value

    Permalink

    Construct a nested list of custom values.

    Construct a nested list of custom values.

    See Value.listN for example usage.

    T

    Scala class of the custom data

    n

    depth of nesting

    value

    Scala nested list of custom objects

    hr

    bundle registry needed for custom data type

    returns

    wrapped nested list of custom values

  16. def double(value: Double): Value

    Permalink

    Create a double value.

    Create a double value.

    value

    value to wrap

    returns

    wrapped value

  17. val doubleDataType: DataType

    Permalink
  18. def doubleList(value: Seq[Double]): Value

    Permalink

    Create a list of doubles value.

    Create a list of doubles value.

    value

    Scala double list

    returns

    wrapped value

  19. val doubleListDataType: DataType

    Permalink
  20. def doubleVector(value: Seq[Double]): Value

    Permalink

    Create a double vector.

    Create a double vector.

    A double vector is a type of tensor with 1 dimension.

    value

    Scala vector data

    returns

    wrapped double vector

  21. val doubleVectorDataType: DataType

    Permalink
  22. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  25. def fromBundle(dataType: DataType, value: bundle.Value.Value)(implicit hr: HasBundleRegistry): Value

    Permalink

    Convert a ml.bundle.Value.Value into a ml.combust.bundle.dsl.Value.

    dataType

    data type of the protobuf value

    value

    protobuf value to convert

    hr

    bundle registry for custom types

    returns

    wrapped Scala value of protobuf object

  26. def fromListValue(lt: ListType, list: ListValue)(implicit hr: HasBundleRegistry): Any

    Permalink

    Convert a ml.bundle.Value.Value.ListValue into a Scala Seq.

    Convert a ml.bundle.Value.Value.ListValue into a Scala Seq.

    Lists can be of any depth, and so can be decoded to Seq[Seq[Seq[String\]\]\] for example.

    lt

    list type to extract to a Scala value

    list

    protobuf list to extract to Scala value

    hr

    bundle registry for custom types

    returns

    Scala value of protobuf object

  27. def fromTensorValue(base: BasicType, tensor: Tensor): Any

    Permalink

    Convert a ml.bundle.Tensor.Tensor into a Scala object representing the tensor.

    Convert a ml.bundle.Tensor.Tensor into a Scala object representing the tensor.

    base

    base type of the tensor

    tensor

    tensor to convert

    returns

    Scala value of protobuf object

  28. final def getClass(): Class[_]

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

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

    Permalink
    Definition Classes
    Any
  31. def listDataType(base: DataType): DataType

    Permalink

    Create a list data type.

    Create a list data type.

    Use ml.combust.bundle.dsl.Value.listDataTypeN for nested lists.

    base

    type of values held within list

    returns

    list data type for the base type

  32. def listDataTypeN(base: DataType, n: Int): DataType

    Permalink

    Create a nested list data type of any depth.

    Create a nested list data type of any depth.

    To represent a Seq[Seq[Seq[Long\]\]\] from Scala, pass in a longDataType for base and n = 3.

    base

    data type of the nested list

    n

    depth of the nested list

    returns

    data type for a nested list

  33. def listN(base: DataType, n: Int, value: Seq[_]): Value

    Permalink

    Construct a nested list of any value.

    Construct a nested list of any value.

    For custom values use Value.customListN Example to construct a nested list of Double.

    scala> import ml.bundle.BasicType.BasicType
           import ml.bundle.dsl._
           val list: Seq[Seq[Seq[Double]]] = Seq(Seq(
             Seq(45.6, 77.8, 34.5),
             Seq(2.3, 5.6, 44.5)
           ))
    scala> val value = Value.listN(Value.doubleDataType, 3, list)
    value: ml.bundle.dsl.Value = Value(DataType(List(ListType(DataType(List(ListType(DataType(List(ListType(DataType(Basic(DOUBLE))))))))))),List(List(List(45.6, 77.8, 34.5), List(2.3, 5.6, 44.5))))
    base

    data type of the list

    n

    depth of the nested list

    value

    Scala nested list with base values in it

    returns

    wrapped nested list

  34. def listValue(lt: ListType, value: Seq[_])(implicit hr: HasBundleRegistry): ListValue

    Permalink

    Create a list value.

    Create a list value.

    value can be a nested list, as long as lt is also nested. For example, lt can be a list of list of double then value should be a Seq[Seq[Double]].

    lt

    list type

    value

    Scala list

    hr

    bundle registry for custom types

    returns

    list protobuf object of the Scala list

  35. def long(value: Long): Value

    Permalink

    Create a long value.

    Create a long value.

    value

    value to wrap

    returns

    wrapped value

  36. val longDataType: DataType

    Permalink
  37. def longList(value: Seq[Long]): Value

    Permalink

    Create a list of longs value.

    Create a list of longs value.

    value

    Scala long list

    returns

    wrapped value

  38. val longListDataType: DataType

    Permalink
  39. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  40. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. def string(value: String): Value

    Permalink

    Create a string value.

    Create a string value.

    value

    value to wrap

    returns

    wrapped value

  43. val stringDataType: DataType

    Permalink
  44. def stringList(value: Seq[String]): Value

    Permalink

    Create a list of strings value.

    Create a list of strings value.

    value

    Scala string list

    returns

    wrapped value

  45. val stringListDataType: DataType

    Permalink
  46. def stringVector(value: Seq[String]): Value

    Permalink

    Create a string vector.

    Create a string vector.

    A string vector is a type of tensor with 1 dimension.

    value

    Scala vector data

    returns

    wrapped string vector

  47. val stringVectorDataType: DataType

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

    Permalink
    Definition Classes
    AnyRef
  49. def tensor[T](value: Seq[T], dims: Seq[Int])(implicit arg0: ClassTag[T]): Value

    Permalink

    Create a tensor value.

    Create a tensor value.

    Dimensions must have size greater than 0. Use -1 for dimensions that can be any size.

    T

    Scala class of underlying tensor data Double or String

    value

    tensor data

    dims

    dimensional data for tensor

    returns

    tensor value

  50. def tensorDataType(basic: BasicType, dims: Seq[Int]): DataType

    Permalink

    Create a tensor data type.

    Create a tensor data type.

    Supported basic types are double and string.

    Dimensions must be a positive integer for how many values are contained in each of the tensor dimensions. -1 can be used if a dimension can be of arbitrary size.

    basic

    basic data type of the tensor

    dims

    size of each dimension of the tensor

    returns

    tensor data type

  51. def tensorList[T](value: Seq[Seq[T]], dims: Seq[Int])(implicit arg0: ClassTag[T]): Value

    Permalink

    Create a list of tensors.

    Create a list of tensors.

    Dimensions of a tensor indicate how many values are in each dimension. Each dimension must be a positive integer. Use -1 if the dimension can have any number of values in it.

    T

    base type of the tensor, Double or String

    value

    Scala list of tensor data

    dims

    dimensions of the tensor data

    returns

    wrapped list of tensors

  52. def tensorValue(base: BasicType, value: Any): Tensor

    Permalink

    Create a tensor value.

    Create a tensor value.

    value should be a Seq[Double] or Seq[String] depending on the base

    base

    basic type of the tensor

    value

    Scala object holding the tensor data

    returns

    tensor protobuf object of the Scala tensor

  53. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  54. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped