Packages

package tensor

Type Members

  1. abstract class DenseTensor extends TensorData

    A dense subkind of tensor data.

    A dense subkind of tensor data. Guarantees that values in all columns except the last fill the n-dimensional rectangle in lexicographic order, e.g. for a shape [2, 3]: (0, 0, value) (0, 1, value) (0, 2, value) (1, 0, value) (1, 1, value) (1, 2, value)

    Note that this implies that only integral types (INT and LONG) can be used as dimensions in dense tensors.

    Can be backed by byte buffers, java.util collections, Avro, Spark, etc.

  2. abstract class DimensionType extends Serializable with Representable

    Base type for all the dimension types.

  3. class LOLTensorData extends TensorData

    Each list is of the same length and stores a single dimension (similarly to parallel arrays).

    Each list is of the same length and stores a single dimension (similarly to parallel arrays).

    There are as many dimensions as elements in columnTypes minus one. columnTypes describe the primitive type of the corresponding column (a dimension or a value).

    Instances of this class are expected to be only constructed from existing lists (e.g., from Avro or Pegasus), so no corresponding builder class is provided.

  4. sealed abstract class Primitive extends Enum[Primitive] with Serializable with Representable

    Supported primitive types.

    Supported primitive types.

    They serve as basis for scalars - dimensions and values.

    Note: String types should only be used when the dimension is an actual text snippet.

  5. final class PrimitiveDimensionType extends DimensionType

    The most basic type of a dimension.

    The most basic type of a dimension. Only specifies the primitive type and an optional shape ("size"), without any high-level metadata.

  6. trait ReadableTuple extends AnyRef

    A readable tuple of primitives.

  7. trait Representable extends AnyRef

    A scalar with a primitive representation - either a dimension or a value.

    A scalar with a primitive representation - either a dimension or a value. Operators can permute these and return back to the client without understanding them.

  8. class SimpleWriteableTuple[T <: WriteableTuple[T]] extends ColumnUtils with WriteableTuple[T] with ReadableTuple

    An implementation of WriteableTuple which keeps all values in primitive arrays.

    An implementation of WriteableTuple which keeps all values in primitive arrays. This can be used as a scratch space for a single row in a tensor.

  9. class StandaloneReadableTuple extends ReadableTuple

    A readable tuple implementation that stores single tensor row data independent of a tensor aka in standalone manner.

    A readable tuple implementation that stores single tensor row data independent of a tensor aka in standalone manner. This implements equality and hashcode methods so it can be used as a key in maps

  10. sealed abstract final class TensorCategory extends Enum[TensorCategory]

    The category of the tensor type, such as dense, sparse, etc.

    The category of the tensor type, such as dense, sparse, etc. NOTE: at the moment this is stored as is, and no additional validation is guaranteed (such as choosing the right tensor builder based on the tensor category).

  11. trait TensorData extends AnyRef

    A typed container of structured data.

    A typed container of structured data. Maps a (potentially empty) tuple of dimensions to a scalar value. For efficiency, a single object represents the entire data structure. Sequential access is provided via TensorIterator.

    The typical use of TensorData is:

    TensorData td = ...;
    TensorIterator ti = td.iterator();
    ti.start();
    while (ti.isValid()) {
     ti.getInt(0);
     ti.getFloat(1);
     ti.getInt(2);
    // and others getXXX(),
    // the getXXX(dimensionality) corresponding to the value
     ti.next();
    }
    

  12. trait TensorIterator extends ReadableTuple

    TensorIterator is responsible for a range of rows (possibly empty).

    TensorIterator is responsible for a range of rows (possibly empty). At every moment of time, one row is current (zero if the range is empty). Both dimensions and the value of the current row are available via getters. Getters of column values are specialized for primitive types to save on an additional object allocation/dereferencing.

  13. final class TensorType extends Serializable

    Type definition for a TypedTensor, defines the value type, dimension types and dimension names.

  14. final class TensorTypes extends AnyRef

    Utility functions for working with TensorType

  15. final class Tensors extends AnyRef

    Utility methods for converting various collections to tensors.

    Utility methods for converting various collections to tensors. Lists and arrays are represented as dense tensors. Maps are represented as sparse tensors. Sets are represented as sparse tensors with 1f as values.

  16. trait WriteableTuple[T <: WriteableTuple[T]] extends AnyRef

    A writable tuple of primitives.

Ungrouped