ml.combust.bundle.dsl

Value

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
Learn more about member selection
Visibility
  1. Public
  2. All

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 basicDataType(basic: BasicType): DataType

    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

  8. def boolean(value: Boolean): Value

    Create a boolean value.

    Create a boolean value.

    value

    value to wrap

    returns

    wrapped value

  9. val booleanDataType: DataType

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

    Create a list of booleans value.

    Create a list of booleans value.

    value

    Scala boolean list

    returns

    wrapped value

  11. val booleanListDataType: DataType

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

    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

  13. def byte(value: Byte): Value

    Create a byte value.

    Create a byte value.

    value

    value to wrap

    returns

    wrapped value

  14. val byteDataType: DataType

  15. def byteList(value: Seq[Byte]): Value

    Create a list of byte value.

    Create a list of byte value.

    value

    Scala byte list

    returns

    wrapped value

  16. val byteListDataType: DataType

  17. def byteString(bs: ByteString): Value

    Create a byte string value.

    Create a byte string value.

    bs

    byte string

    returns

    value with byte string

  18. val byteStringDataType: DataType

  19. def byteStringList(bss: Seq[ByteString]): Value

    Create a list of byte string.

    Create a list of byte string.

    bss

    data types

    returns

    value with data types

  20. val byteStringListDataType: DataType

  21. def clone(): AnyRef

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

    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

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

    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

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

    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

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

    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

  26. def dataType(dt: DataType): Value

    Create a data type value.

    Create a data type value.

    dt

    data type to store

    returns

    value with data type

  27. val dataTypeDataType: DataType

  28. def dataTypeList(dts: Seq[DataType]): Value

    Create a list of data types.

    Create a list of data types.

    dts

    data types

    returns

    value with data types

  29. def double(value: Double): Value

    Create a double value.

    Create a double value.

    value

    value to wrap

    returns

    wrapped value

  30. val doubleDataType: DataType

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

    Create a list of doubles value.

    Create a list of doubles value.

    value

    Scala double list

    returns

    wrapped value

  32. val doubleListDataType: DataType

  33. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  36. def float(value: Float): Value

    Create a float value.

    Create a float value.

    value

    value to wrap

    returns

    wrapped value

  37. val floatDataType: DataType

  38. def floatList(value: Seq[Float]): Value

    Create a list of float value.

    Create a list of float value.

    value

    Scala float list

    returns

    wrapped value

  39. val floatListDataType: DataType

  40. def fromBundle(dataType: DataType, value: bundle.Value.Value)(implicit hr: HasBundleRegistry): Value

    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

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

    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

  42. def fromTensorValue(tt: TensorType, tensor: Tensor): Tensor[_]

    Convert from a ml.bundle.Tensor.Tensor to a ml.combust.mleap.tensor.Tensor.

    Convert from a ml.bundle.Tensor.Tensor to a ml.combust.mleap.tensor.Tensor.

    tt

    bundle type of tensor

    tensor

    bundle tensor

    returns

    mleap tensor

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

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

    Definition Classes
    AnyRef → Any
  45. def int(value: Int): Value

    Create an int value.

    Create an int value.

    value

    value to wrap

    returns

    wrapped value

  46. val intDataType: DataType

  47. def intList(value: Seq[Int]): Value

    Create a list of int value.

    Create a list of int value.

    value

    Scala int list

    returns

    wrapped value

  48. val intListDataType: DataType

  49. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  50. def listDataType(base: DataType): DataType

    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

  51. val listDataTypeDataType: DataType

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

    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

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

    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

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

    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

  55. def long(value: Long): Value

    Create a long value.

    Create a long value.

    value

    value to wrap

    returns

    wrapped value

  56. val longDataType: DataType

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

    Create a list of longs value.

    Create a list of longs value.

    value

    Scala long list

    returns

    wrapped value

  58. val longListDataType: DataType

  59. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  62. def short(value: Short): Value

    Create a short value.

    Create a short value.

    value

    value to wrap

    returns

    wrapped value

  63. val shortDataType: DataType

  64. def shortList(value: Seq[Short]): Value

    Create a list of short value.

    Create a list of short value.

    value

    Scala long list

    returns

    wrapped value

  65. val shortListDataType: DataType

  66. def string(value: String): Value

    Create a string value.

    Create a string value.

    value

    value to wrap

    returns

    wrapped value

  67. val stringDataType: DataType

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

    Create a list of strings value.

    Create a list of strings value.

    value

    Scala string list

    returns

    wrapped value

  69. val stringListDataType: DataType

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

    Definition Classes
    AnyRef
  71. def tensor[T](tensor: Tensor[T]): Value

    Create a tensor value.

    Create a tensor value.

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

    tensor

    tensor value

    returns

    tensor value

  72. def tensorDataType(basic: BasicType): DataType

    Create a tensor data type.

    Create a tensor data type.

    basic

    basic data type of the tensor

    returns

    tensor data type

  73. def tensorList[T](tensors: Seq[Tensor[T]])(implicit arg0: ClassTag[T]): Value

    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.

    tensors

    tensors in the list

    returns

    wrapped list of tensors

  74. def tensorValue(tensor: Tensor[_]): Tensor

    Convert ml.combust.mleap.tensor.Tensor to ml.bundle.Tensor.Tensor.

    Convert ml.combust.mleap.tensor.Tensor to ml.bundle.Tensor.Tensor.

    tensor

    mleap tensor

    returns

    bundle tensor

  75. def toString(): String

    Definition Classes
    AnyRef → Any
  76. def vector[T](values: Array[T])(implicit arg0: ClassTag[T]): Value

    Create a tensor value with 1 dimension.

    Create a tensor value with 1 dimension.

    T

    type of vector

    values

    values of vector

    returns

    tensor with vector

  77. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped