DeepLearning/Tensor/RandomCrop
randomly shuffle a Tensor to specified shape
DeepLearning/Tensor/RandomShuffle
randomly shuffle a Tensor along its first dimension
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
RandomCrop(t,shape,opts)
RandomShuffle(t,opts)
t
-
Tensor
shape
list of integers
opts
zero or more options as specified below
name=string
The value of option name specifies an optional name for this Tensor, to be displayed in output and when visualizing the dataflow graph.
seed=integer[8]
The value of option seed specifies an initial seed for the random number generator. It is equivalent to invoking SetRandomSeed(seed). For more information see SetRandomSeed.
The RandomCrop(t,shape,opts) command constructs a Tensor with shape shape by randomly slicing data from t with uniform probability.
The RandomShuffle(t,opts) command randomly shuffles a Tensor along its first dimension.
Crop a random 3x2 slice from a 4x3 Tensor.
with⁡DeepLearning:
C≔Constant⁡3.5,7.9,−0.5,1|−3.8,−4.2,9.5,3|4.,−7.2,−8.2,2
C≔DeepLearning TensorShape: [4, 3]Data Type: float[8]
t1≔RandomCrop⁡C,3,2
t1≔DeepLearning TensorShape: [3, 2]Data Type: float[8]
Shape⁡t1
3,2
Shuffle a Tensor along its first dimension.
t2≔RandomShuffle⁡C
t2≔DeepLearning TensorShape: [4, 3]Data Type: float[8]
The DeepLearning/Tensor/RandomCrop and DeepLearning/Tensor/RandomShuffle commands were introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
See Also
DeepLearning Overview
DeepLearning,RandomTensor
DeepLearning,SetRandomSeed
Download Help Document