Package

com.intel.analytics.bigdl.nn

ops

Permalink

package ops

Visibility
  1. Public
  2. All

Type Members

  1. class All[T] extends Operation[Table, Tensor[Boolean], T]

    Permalink
  2. class Any[T] extends Operation[Table, Tensor[Boolean], T]

    Permalink
  3. class ApproximateEqual[T] extends Compare[T]

    Permalink
  4. class ArgMax[T] extends Operation[Table, Tensor[Int], T]

    Permalink
  5. class BatchMatMul[T, D] extends Operation[Table, Tensor[D], T]

    Permalink

    Multiplies all slices of Tensor x and y (each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same batch size.

    Multiplies all slices of Tensor x and y (each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same batch size. Each of the individual slices can optionally be adjointed (to adjoint a matrix means to transpose and conjugate it) before multiplication by setting the adj_x or adj_y flag to True, which are by default False.

  6. class BucketizedCol[T] extends Operation[Tensor[T], Tensor[Int], T]

    Permalink

    BucketizedCol operation represents discretized dense input.

    BucketizedCol operation represents discretized dense input.

    The Operation can handle single or multi feature column, as long as the boundaries is same between feature columns.

    Buckets include the left boundary, and exclude the right boundary. Namely, boundaries=Array(0, 1, 10) generates buckets (-inf,0),[0,1),[1,10),[10,+inf)

    For example, boundaries = Array(0, 10, 100) and input tensor is an 2D 3x2 DenseTensor: -1, 1 101, 10 5, 100

    the output tensor should be an 2D 3x2 DenseTensor 0, 1 3, 2 1, 3

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  7. class Cast[T, D] extends Operation[Tensor[_], Tensor[D], T]

    Permalink

    Casts a tensor to a new type.

    Casts a tensor to a new type.

    T

    Parameter tensor numeric type. Only support float/double now

    D

    A new type was cast to

  8. class CategoricalColHashBucket[T] extends Operation[Tensor[String], Tensor[Int], T]

    Permalink

    CategoricalColHashBucket operation can convert feature string to a Sparse/Dense Tensor

    CategoricalColHashBucket operation can convert feature string to a Sparse/Dense Tensor

    SparseTensor if isSparse = true DenseTensor if isSparse = false

    the input is a Tensor[String] with shape batch * 1.

    This operation distributes your inputs into a finite number of buckets by hashing

    The Operation support the feature column with single-value or multi-value

    The output_id = Hash(input_feature_string) % hashBucketSize, ranging 0 to hashBucketSize-1

    The missing values in input Tensor can be represented by -1 for int and ' for string

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  9. class CategoricalColVocaList[T] extends Operation[Tensor[String], Tensor[Int], T]

    Permalink

    CategoricalColVocaList operation having an vocabulary mapping feature string to Integer ID

    CategoricalColVocaList operation having an vocabulary mapping feature string to Integer ID

    By default, out-of-vocabulary values are ignored. Use either (but not both) of num_oov_buckets and default_value to specify how to include out-of-vocabulary values.

    if isSetDefault=false && num_oov_buckets=0 the out-of-vocabulary values will be filtered. if isSetDefault enabled, the defalut value len(vocabulary_list) will be set. if num_oov_buckets enabled, all out-of-vocabulary inputs will be assigned IDs in the range [len(vocabulary_list), len(vocabulary_list)+num_oov_buckets) based on a hash of the input value

    A positive num_oov_buckets can not be specified with default_value.

    the input Tensor[String] can be 1-D or 2-D Tensor.

    The Operation support the feature column with single-value or multi-value

    The missing values in input Tensor can be represented by -1 for int and ' for string

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  10. class Ceil[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  11. abstract class Compare[T] extends Operation[Table, Tensor[Boolean], T]

    Permalink
  12. class CrossCol[T] extends Operation[Table, Tensor[Int], T]

    Permalink

    CrossCol operation preforms crosses of categorical features.

    CrossCol operation preforms crosses of categorical features.

    The transformation can be thought of as Hash(cartesian product of features) % hashBucketSize)

    The input Table contains more than or equal to 2 Tensor[String]. Each Tensor[String] represents a categorical feature column. Each row in Tensor[String] represents the string of value, which supports single-value and multi-value joined by strDelimiter.

    As for the SparseTensor, it should be transformed to Tensor[String] before feeding into the Operation

    For example, if the two input tensors with size=3 are: "A,D", "B", "A,C" "1", "2", "3,4"

    the output tensor should be an 2D 3 x maxLength SparseTensor: [0, 0]: Hash32("1", Hash32("D")) % hashBucketSize [0, 1]: Hash32("1", Hash32("A")) % hashBucketSize [1, 0]: Hash32("2", Hash32("B")) % hashBucketSize [2, 0]: Hash32("3", Hash32("C")) % hashBucketSize [2, 1]: Hash32("4", Hash32("C")) % hashBucketSize [2, 2]: Hash32("3", Hash32("A")) % hashBucketSize [2, 3]: Hash32("4", Hash32("A")) % hashBucketSize

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  13. class CrossEntropy[T] extends Operation[Table, Table, T]

    Permalink

    Compute the cross entropy loss and the gradients.

    Compute the cross entropy loss and the gradients.

    T

    Numeric type. Only support float/double now

  14. class DepthwiseConv2D[T] extends Operation[Table, Tensor[T], T]

    Permalink
  15. class Digamma[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  16. class Dilation2D[T, D] extends Operation[Table, Tensor[D], T]

    Permalink

    Computes the grayscale dilation of 4-D input and 3-D filter tensors.

    Computes the grayscale dilation of 4-D input and 3-D filter tensors.

    This layer takes a Table of two tensors as inputs, namely input and filter. The input tensor has shape [batch, in_height, in_width, depth] and the filter tensor has shape [filter_height, filter_width, depth], i.e., each input channel is processed independently of the others with its own structing fucntion. The output tensor has shape [batch, out_height, out_width, depth]. The spatial dimensions of the output tensor depend on the padding algorithm. We currently only support the "NHWC" DataFormat.

    In detail, the grayscale morphological 2-D dilation is the max-sum correlation

    output[b, y, x, c] = max_{dy, dx} input[b, strides[1] * y + rates[1] * dy, strides[2] * x + rates[2] * dx, c] + filter[dy, dx, c]

    Max-pooling is a special case when the filter has size equal to the pooling kernel size and contains all zeros.

    Note on duality: The dilation of input by the filter is equal to the negation of the erosion of -input by the reflected filter.

  17. class Equal[T] extends Compare[T]

    Permalink
  18. class Erf[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  19. class Erfc[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  20. class Exp[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  21. class Expm1[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  22. class Floor[T] extends Operation[Tensor[_], Tensor[_], T]

    Permalink
  23. class FloorDiv[T, D] extends Operation[Table, Tensor[D], T]

    Permalink
  24. class FloorMod[T, D] extends Operation[Table, Tensor[D], T]

    Permalink
  25. class Gather[T, D] extends Operation[Table, Tensor[D], T]

    Permalink

    Gather slices from first input tensor according to the second input tensor.

    Gather slices from first input tensor according to the second input tensor. Input should be two tensors, the first one is the tensor which to gather values; the second one is Index tensor.

  26. class Greater[T] extends Compare[T]

    Permalink
  27. class GreaterEqual[T] extends Compare[T]

    Permalink
  28. class InTopK[T] extends Operation[Table, Tensor[Boolean], T]

    Permalink
  29. class IndicatorCol[T] extends Operation[Tensor[Int], Tensor[T], T]

    Permalink

    Indicator operation represents multi-hot representation of given Tensor.

    Indicator operation represents multi-hot representation of given Tensor.

    The Input Tensor should be a 2-D Sparse Tensor. And used to transform the output tensor of CategoricalCol* ops.

    The output tensor should be a DenseTensor with shape (batch, feaLen).

    For example, A input SparseTensor as follows: indices(0) = Array(0, 0, 1, 2, 2) indices(1) = Array(0, 3, 1, 1, 2) values = Array(1, 2, 2, 3, 3) shape = Array(3, 4)

    the output tensor should be an 2D 3x4 DenseTensor with isCount = true 0.0, 1.0, 1.0, 0.0 0.0, 0.0, 1.0, 0.0 0.0, 0.0, 0.0, 2.0

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  30. class Inv[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  31. class IsFinite[T, D] extends Operation[Tensor[D], Tensor[Boolean], T]

    Permalink
  32. class IsInf[T, D] extends Operation[Tensor[D], Tensor[Boolean], T]

    Permalink
  33. class IsNan[T, D] extends Operation[Tensor[D], Tensor[Boolean], T]

    Permalink
  34. class Kv2Tensor[T, D] extends Operation[Table, Tensor[D], T]

    Permalink

    Kv2Tensor operation convert a kv feature column to a SparseTensor or DenseTensor

    Kv2Tensor operation convert a kv feature column to a SparseTensor or DenseTensor

    DenseTensor if transType = 0 SparseTensor if transType = 1

    The input contains 2 elements which are kvTensor, feaLen: kvTensor shape will be batch*1 and element is a kv string, only support one feature now depth: the length of the value set of the feature

    the output shape will be batch*feaLen if transType = 0 the output shape will be a SparseTensor with dense shape batch*feaLen if transType = 1

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

    D

    Numeric type. Output tensor numeric type. Only support float/double now

  35. class L2Loss[T] extends Operation[Tensor[_], Tensor[_], T]

    Permalink
  36. class Less[T] extends Compare[T]

    Permalink
  37. class LessEqual[T] extends Compare[T]

    Permalink
  38. class Lgamma[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  39. class LogicalAnd[T] extends Operation[Table, Tensor[Boolean], T]

    Permalink
  40. class LogicalNot[T] extends Operation[Tensor[Boolean], Tensor[Boolean], T]

    Permalink
  41. class LogicalOr[T] extends Operation[Table, Tensor[Boolean], T]

    Permalink
  42. class Max[T, D] extends Operation[Table, Tensor[D], T]

    Permalink

    Computes the maximum of elements across dimensions of a tensor.

    Computes the maximum of elements across dimensions of a tensor. The input of Max should be two tensor, the first one is data, the second one is the dimension to compute maximum.

  43. class Maximum[T, D] extends Operation[Table, Tensor[D], T]

    Permalink
  44. class Minimum[T, D] extends Operation[Table, Tensor[D], T]

    Permalink
  45. class MkString[T] extends Operation[Tensor[_], Tensor[String], T]

    Permalink

    MkString operation converts a SparseTensor/DenseTensor to a Dense Tensor[String]

    MkString operation converts a SparseTensor/DenseTensor to a Dense Tensor[String]

    the output shape will be 1-D Tensor[String].

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

  46. class Mod[T, D] extends Operation[Table, Tensor[D], T]

    Permalink
  47. class ModuleToOperation[T] extends Operation[Activity, Activity, T]

    Permalink

    Wrap a nn module to an Operation

    Wrap a nn module to an Operation

    T

    Numeric type. Only support float/double now

  48. class NotEqual[T] extends Operation[Table, Tensor[Boolean], T]

    Permalink
  49. class OneHot[T, D] extends Operation[Table, Tensor[D], T]

    Permalink

    OneHot operation returns a one-hot tensor

    OneHot operation returns a one-hot tensor

    The input contains 4 elements which are indices, depth, onValue and offValue*[]:

    The locations represented by indices in indices take value onValue, while all other locations take value offValue.

    onValue and offValue must have matching data types. If dtype is also provided, they must be the same data type as specified by D.

    If on_value is not provided, it will default to the value 1 with type dtype

    If off_value is not provided, it will default to the value 0 with type dtype

    If the input indices is rank N, the output will have rank N+1. The new axis is created at dimension axis (default: the new axis is appended at the end).

    If indices is a scalar the output shape will be a vector of length depth

    If indices is a vector of length features, the output shape will be: features x depth if axis == -1 depth x features if axis == 0

    If indices is a matrix (batch) with shape [batch, features], the output shape will be:

    batch x features x depth if axis == -1 batch x depth x features if axis == 1 depth x batch x features if axis == 0

    T

    Numeric type. Parameter tensor numeric type. Only support float/double now

    D

    Numeric type. Output tensor numeric type. Only support float/double now

  50. abstract class Operation[A <: Activity, B <: Activity, T] extends AbstractModule[A, B, T]

    Permalink

    Operation is an abstract class which represents a forward only layer.

    Operation is an abstract class which represents a forward only layer. An operations has only forward functions and without backward functions. An operations should be only used in graph and make sure the backward graph won't contain operations.

    A

    Input data type

    T

    Numeric type. Only support float/double now

  51. class Pad[T, D] extends Operation[Table, Tensor[D], T]

    Permalink
  52. class Pow[T] extends Operation[Table, Tensor[_], T]

    Permalink
  53. class Prod[T] extends Operation[Tensor[_], Tensor[_], T]

    Permalink
  54. class RandomUniform[T, D] extends Operation[Tensor[Int], Tensor[D], T] with RandomNode

    Permalink
  55. class RangeOps[T, D] extends Operation[Table, Tensor[D], T]

    Permalink
  56. class Rank[T] extends Operation[Tensor[_], Tensor[Int], T]

    Permalink
  57. class ResizeBilinearOps[T] extends Operation[Activity, Tensor[T], T]

    Permalink
  58. class Rint[T] extends Operation[Tensor[Float], Tensor[Float], T]

    Permalink
  59. class Round[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  60. class SegmentSum[T] extends Operation[Table, Tensor[T], T]

    Permalink

    Computes the sum along segments of a tensor.

  61. class Select[T] extends Operation[Table, Activity, T]

    Permalink

    Selects elements from input, depending on given condition.

    Selects elements from input, depending on given condition. The input is a table (condition, t, e)

    T

    Numeric type. Only support float/double now

  62. class SelectTensor[T] extends Operation[Table, Tensor[T], T]

    Permalink

    Select and copy a Tensor from a Table with a key.

    Select and copy a Tensor from a Table with a key. And do tensor transformation if transformer is defined. If isTensorKey is false, the real key is the value of keyTensor. Otherwise, the real key is keyTensor.

    T

    Numeric type

  63. class Sign[T, D] extends Operation[Tensor[D], Tensor[D], T]

    Permalink
  64. class Slice[T] extends Operation[Tensor[_], Tensor[_], T]

    Permalink

    This operation extracts a slice of size size from a tensor input starting at the location specified by begin.

    This operation extracts a slice of size size from a tensor input starting at the location specified by begin. The slice size is represented as a tensor shape, where size[i] is the number of elements of the 'i'th dimension of input that you want to slice The starting location (begin) for the slice is represented as an offset in each dimension of input. In other words, begin[i] is the offset into the 'i'th dimension of input that you want to slice from.

    T

    Numeric type. Only support float/double now

  65. class SquaredDifference[T] extends Operation[Table, Tensor[_], T]

    Permalink

    Returns (x - y)(x - y) element-wise.

  66. class Substr[T] extends Operation[Table, Tensor[ByteString], T]

    Permalink
  67. class Sum[T, D] extends Operation[Table, Tensor[D], T]

    Permalink
  68. class TensorOp[T] extends Operation[Tensor[T], Tensor[T], T]

    Permalink

    TensorOp is an Operation with Tensor[T]-formatted input and output, which provides shortcuts to build Operations for tensor transformation by closures.

    TensorOp is an Operation with Tensor[T]-formatted input and output, which provides shortcuts to build Operations for tensor transformation by closures.

    TensorOp will make a deep copy of input Tensor before transformation, so transformation will take no side effect. For now, SparseTensors are not supported.

    Chained feature is supported in TensorOp. And common tensor actions are provided with a chained style.

    For instance:

    one case:
       val (transformer1, transformer2, transformer3) = ...
       val (op1, op2, op3) = (TensorOp[Float](transformer1), .., ..)
       val op = op1 -> op2 -> op3
         `equals`
       val op = TensorOp[Float]((t: Tensor[Float], ev: TensorNumeric[Float]) => {
         transformer3(transformer2(transformer1(t, ev), ev), ev)
        })
    
    another case:
       val op = (TensorOp[Float]() * 2.3f + 1.23f) / 1.11f - 0.66f
         `equals`
       val transformer = (t: Tensor[T], _) => t.mul(2.3f).add(1.23f).div(1.11f).sub(0.66f)
       val op = TensorOp[Float](transformer)
    T

    Numeric type

  69. class Tile[T] extends Operation[Table, Tensor[_], T]

    Permalink

    This operation creates a new tensor by replicating input multiples times.

    This operation creates a new tensor by replicating input multiples times. The output tensor's i'th dimension has input.dims(i) * multiples[i] elements, and the values of input are replicated multiples[i] times along the 'i'th dimension.

    For example, tiling [a b c d] by [1, 2] produces [a b c d a b c d].

    T

    Numeric type. Only support float/double now

  70. class TopK[T, D] extends Operation[Tensor[D], Table, T]

    Permalink
  71. class TruncateDiv[T, D] extends Operation[Table, Tensor[D], T]

    Permalink
  72. class TruncatedNormal[T, DataType] extends Operation[Tensor[Int], Tensor[DataType], T]

    Permalink

Value Members

  1. object All extends Serializable

    Permalink
  2. object Any extends Serializable

    Permalink
  3. object ApproximateEqual extends Serializable

    Permalink
  4. object ArgMax extends Serializable

    Permalink
  5. object BatchMatMul extends Serializable

    Permalink
  6. object BucketizedCol extends Serializable

    Permalink
  7. object Cast extends Serializable

    Permalink
  8. object CategoricalColHashBucket extends Serializable

    Permalink
  9. object CategoricalColVocaList extends Serializable

    Permalink
  10. object Ceil extends Serializable

    Permalink
  11. object CrossCol extends Serializable

    Permalink
  12. object CrossEntropy extends Serializable

    Permalink
  13. object DepthwiseConv2D extends Serializable

    Permalink
  14. object Digamma extends Serializable

    Permalink
  15. object Dilation2D extends Serializable

    Permalink
  16. object Equal extends Serializable

    Permalink
  17. object Erf extends Serializable

    Permalink
  18. object Erfc extends Serializable

    Permalink
  19. object Exp extends Serializable

    Permalink
  20. object Expm1 extends Serializable

    Permalink
  21. object Floor extends Serializable

    Permalink
  22. object FloorDiv extends Serializable

    Permalink
  23. object FloorMod extends Serializable

    Permalink
  24. object Gather extends Serializable

    Permalink
  25. object Greater extends Serializable

    Permalink
  26. object GreaterEqual extends Serializable

    Permalink
  27. object InTopK extends Serializable

    Permalink
  28. object IndicatorCol extends Serializable

    Permalink
  29. object Inv extends Serializable

    Permalink
  30. object IsFinite extends Serializable

    Permalink
  31. object IsInf extends Serializable

    Permalink
  32. object IsNan extends Serializable

    Permalink
  33. object Kv2Tensor extends Serializable

    Permalink
  34. object L2Loss extends Serializable

    Permalink
  35. object Less extends Serializable

    Permalink
  36. object LessEqual extends Serializable

    Permalink
  37. object Lgamma extends Serializable

    Permalink
  38. object LogicalAnd extends Serializable

    Permalink
  39. object LogicalNot extends Serializable

    Permalink
  40. object LogicalOr extends Serializable

    Permalink
  41. object Max extends Serializable

    Permalink
  42. object Maximum extends Serializable

    Permalink
  43. object Minimum extends Serializable

    Permalink
  44. object MkString extends Serializable

    Permalink
  45. object Mod extends Serializable

    Permalink
  46. object ModuleToOperation extends Serializable

    Permalink
  47. object NotEqual extends Serializable

    Permalink
  48. object OneHot extends Serializable

    Permalink
  49. object Pad extends Serializable

    Permalink
  50. object Pow extends Serializable

    Permalink
  51. object Prod extends Serializable

    Permalink
  52. object RandomUniform extends ModuleSerializable with Serializable

    Permalink
  53. object RangeOps extends Serializable

    Permalink
  54. object Rank extends Serializable

    Permalink
  55. object ResizeBilinearOps extends Serializable

    Permalink
  56. object Rint extends Serializable

    Permalink
  57. object Round extends Serializable

    Permalink
  58. object SegmentSum extends Serializable

    Permalink
  59. object Select extends Serializable

    Permalink
  60. object SelectTensor extends Serializable

    Permalink
  61. object Sign extends Serializable

    Permalink
  62. object Slice extends Serializable

    Permalink
  63. object SquaredDifference extends Serializable

    Permalink
  64. object Substr extends Serializable

    Permalink
  65. object Sum extends Serializable

    Permalink
  66. object TensorOp extends Serializable

    Permalink
  67. object Tile extends Serializable

    Permalink
  68. object TopK extends Serializable

    Permalink
  69. object TruncateDiv extends Serializable

    Permalink
  70. object TruncatedNormal extends Serializable

    Permalink

Ungrouped