com.intel.analytics.bigdl.dataset

PaddingParam

case class PaddingParam[T](paddingTensor: Option[Array[Tensor[T]]] = scala.None, paddingStrategy: PaddingStrategy = new DefaultPadding())(implicit evidence$14: ClassTag[T]) extends Serializable with Product

Feature Padding param for MiniBatch.

For constructing a mini batch, we need to make sure all samples' feature and label in this mini batch have the same size. If the size is different, we will pad them to the same size.

By default, we will pad the first dimension to the longest size with zero in the MiniBatch. If you want to specify the padding values, you can set paddingTensor; If you want to specify the padding length, you can use PaddingLongest or FixedLength.

For example, your feature size is n*m*k, you should provide a 2D tensor in a size of m*k. If your feature is 1D, you can provide a one-element 1D tensor.

For example, we have 3 Sample, and convert them into a MiniBatch. Sample1's feature is a 2*3 tensor {1, 2, 3, 4, 5, 6}

Sample2's feature is a 1*3 tensor {7, 8, 9}

Sample3's feature is a 3*3 tensor {10, 11, 12, 13, 14, 15, 16, 17, 18}

And the paddingTensor is {-1, -2, -3}, use FixedLength(Array(4)), the MiniBatch will be a tensor of 3*4*3: {1, 2, 3, 4, 5, 6, -1, -2, -3, -1, -2, -3

7, 8, 9, -1, -2, -3, -1, -2, -3, -1, -2, -3

10, 11, 12, 13, 14, 15, 16, 17, 18 -1, -2, -3}

T

numeric type

paddingTensor

paddings tensor for the first dimension(by default None, meaning zero padding).

paddingStrategy

See PaddingLongest, FixedLength

Linear Supertypes
Product, Equals, Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. PaddingParam
  2. Product
  3. Equals
  4. Serializable
  5. Serializable
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PaddingParam(paddingTensor: Option[Array[Tensor[T]]] = scala.None, paddingStrategy: PaddingStrategy = new DefaultPadding())(implicit arg0: ClassTag[T])

    paddingTensor

    paddings tensor for the first dimension(by default None, meaning zero padding).

    paddingStrategy

    See PaddingLongest, FixedLength

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 clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

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

    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

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

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

    Definition Classes
    AnyRef
  15. val paddingStrategy: PaddingStrategy

    See PaddingLongest, FixedLength

  16. val paddingTensor: Option[Array[Tensor[T]]]

    paddings tensor for the first dimension(by default None, meaning zero padding).

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

    Definition Classes
    AnyRef
  18. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Product

Inherited from Equals

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped