case class PaddingParam[T](paddingTensor: Option[Array[Tensor[T]]] = 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
- Alphabetic
- By Inheritance
- PaddingParam
- Product
- Equals
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
PaddingParam(paddingTensor: Option[Array[Tensor[T]]] = None, paddingStrategy: PaddingStrategy = new DefaultPadding)(implicit arg0: ClassTag[T])
- paddingTensor
paddings tensor for the first dimension(by default None, meaning zero padding).
- paddingStrategy
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val paddingStrategy: PaddingStrategy
- val paddingTensor: Option[Array[Tensor[T]]]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )