MXNet
-
- ndarray
- ndarray.CachedOp
- ndarray.NDArray
- ndarray.Activation
- ndarray.BatchNorm
- ndarray.BatchNorm_v1
- ndarray.BilinearSampler
- ndarray.BlockGrad
- ndarray.CTCLoss
- ndarray.Cast
- ndarray.Concat
- ndarray.Convolution
- ndarray.Convolution_v1
- ndarray.Correlation
- ndarray.Crop
- ndarray.Custom
- ndarray.Deconvolution
- ndarray.Dropout
- ndarray.ElementWiseSum
- ndarray.Embedding
- ndarray.Flatten
- ndarray.FullyConnected
- ndarray.GridGenerator
- ndarray.GroupNorm
- ndarray.IdentityAttachKLSparseReg
- ndarray.InstanceNorm
- ndarray.L2Normalization
- ndarray.LRN
- ndarray.LayerNorm
- ndarray.LeakyReLU
- ndarray.LinearRegressionOutput
- ndarray.LogisticRegressionOutput
- ndarray.MAERegressionOutput
- ndarray.MakeLoss
- ndarray.Pad
- ndarray.Pooling
- ndarray.Pooling_v1
- ndarray.RNN
- ndarray.ROIPooling
- ndarray.Reshape
- ndarray.SVMOutput
- ndarray.SequenceLast
- ndarray.SequenceMask
- ndarray.SequenceReverse
- ndarray.SliceChannel
- ndarray.Softmax
- ndarray.SoftmaxActivation
- ndarray.SoftmaxOutput
- ndarray.SpatialTransformer
- ndarray.SwapAxis
- ndarray.UpSampling
- ndarray.abs
- ndarray.adam_update
- ndarray.add_n
- ndarray.all_finite
- ndarray.amp_cast
- ndarray.amp_multicast
- ndarray.arccos
- ndarray.arccosh
- ndarray.arcsin
- ndarray.arcsinh
- ndarray.arctan
- ndarray.arctanh
- ndarray.argmax
- ndarray.argmax_channel
- ndarray.argmin
- ndarray.argsort
- ndarray.batch_dot
- ndarray.batch_take
- ndarray.broadcast_add
- ndarray.broadcast_axes
- ndarray.broadcast_axis
- ndarray.broadcast_div
- ndarray.broadcast_equal
- ndarray.broadcast_greater
- ndarray.broadcast_greater_equal
- ndarray.broadcast_hypot
- ndarray.broadcast_lesser
- ndarray.broadcast_lesser_equal
- ndarray.broadcast_like
- ndarray.broadcast_logical_and
- ndarray.broadcast_logical_or
- ndarray.broadcast_logical_xor
- ndarray.broadcast_maximum
- ndarray.broadcast_minimum
- ndarray.broadcast_minus
- ndarray.broadcast_mod
- ndarray.broadcast_mul
- ndarray.broadcast_not_equal
- ndarray.broadcast_plus
- ndarray.broadcast_power
- ndarray.broadcast_sub
- ndarray.broadcast_to
- ndarray.cast
- ndarray.cast_storage
- ndarray.cbrt
- ndarray.ceil
- ndarray.choose_element_0index
- ndarray.clip
- ndarray.col2im
- ndarray.concat
- ndarray.cos
- ndarray.cosh
- ndarray.crop
- ndarray.ctc_loss
- ndarray.cumsum
- ndarray.degrees
- ndarray.depth_to_space
- ndarray.diag
- ndarray.dot
- ndarray.elemwise_add
- ndarray.elemwise_div
- ndarray.elemwise_mul
- ndarray.elemwise_sub
- ndarray.erf
- ndarray.erfinv
- ndarray.exp
- ndarray.expand_dims
- ndarray.expm1
- ndarray.fill_element_0index
- ndarray.fix
- ndarray.flatten
- ndarray.flip
- ndarray.floor
- ndarray.ftml_update
- ndarray.ftrl_update
- ndarray.gamma
- ndarray.gammaln
- ndarray.gather_nd
- ndarray.hard_sigmoid
- ndarray.identity
- ndarray.im2col
- ndarray.khatri_rao
- ndarray.lamb_update_phase1
- ndarray.lamb_update_phase2
- ndarray.linalg_det
- ndarray.linalg_extractdiag
- ndarray.linalg_extracttrian
- ndarray.linalg_gelqf
- ndarray.linalg_gemm
- ndarray.linalg_gemm2
- ndarray.linalg_inverse
- ndarray.linalg_makediag
- ndarray.linalg_maketrian
- ndarray.linalg_potrf
- ndarray.linalg_potri
- ndarray.linalg_slogdet
- ndarray.linalg_sumlogdiag
- ndarray.linalg_syrk
- ndarray.linalg_trmm
- ndarray.linalg_trsm
- ndarray.log
- ndarray.log10
- ndarray.log1p
- ndarray.log2
- ndarray.log_softmax
- ndarray.logical_not
- ndarray.make_loss
- ndarray.max
- ndarray.max_axis
- ndarray.mean
- ndarray.min
- ndarray.min_axis
- ndarray.moments
- ndarray.mp_lamb_update_phase1
- ndarray.mp_lamb_update_phase2
- ndarray.mp_nag_mom_update
- ndarray.mp_sgd_mom_update
- ndarray.mp_sgd_update
- ndarray.multi_all_finite
- ndarray.multi_lars
- ndarray.multi_mp_sgd_mom_update
- ndarray.multi_mp_sgd_update
- ndarray.multi_sgd_mom_update
- ndarray.multi_sgd_update
- ndarray.multi_sum_sq
- ndarray.nag_mom_update
- ndarray.nanprod
- ndarray.nansum
- ndarray.negative
- ndarray.norm
- ndarray.normal
- ndarray.one_hot
- ndarray.ones_like
- ndarray.pad
- ndarray.pick
- ndarray.preloaded_multi_mp_sgd_mom_update
- ndarray.preloaded_multi_mp_sgd_update
- ndarray.preloaded_multi_sgd_mom_update
- ndarray.preloaded_multi_sgd_update
- ndarray.prod
- ndarray.radians
- ndarray.random_exponential
- ndarray.random_gamma
- ndarray.random_generalized_negative_binomial
- ndarray.random_negative_binomial
- ndarray.random_normal
- ndarray.random_pdf_dirichlet
- ndarray.random_pdf_exponential
- ndarray.random_pdf_gamma
- ndarray.random_pdf_generalized_negative_binomial
- ndarray.random_pdf_negative_binomial
- ndarray.random_pdf_normal
- ndarray.random_pdf_poisson
- ndarray.random_pdf_uniform
- ndarray.random_poisson
- ndarray.random_randint
- ndarray.random_uniform
- ndarray.ravel_multi_index
- ndarray.rcbrt
- ndarray.reciprocal
- ndarray.relu
- ndarray.repeat
- ndarray.reset_arrays
- ndarray.reshape
- ndarray.reshape_like
- ndarray.reverse
- ndarray.rint
- ndarray.rmsprop_update
- ndarray.rmspropalex_update
- ndarray.round
- ndarray.rsqrt
- ndarray.sample_exponential
- ndarray.sample_gamma
- ndarray.sample_generalized_negative_binomial
- ndarray.sample_multinomial
- ndarray.sample_negative_binomial
- ndarray.sample_normal
- ndarray.sample_poisson
- ndarray.sample_uniform
- ndarray.scatter_nd
- ndarray.sgd_mom_update
- ndarray.sgd_update
- ndarray.shape_array
- ndarray.shuffle
- ndarray.sigmoid
- ndarray.sign
- ndarray.signsgd_update
- ndarray.signum_update
- ndarray.sin
- ndarray.sinh
- ndarray.size_array
- ndarray.slice
- ndarray.slice_axis
- ndarray.slice_like
- ndarray.smooth_l1
- ndarray.softmax
- ndarray.softmax_cross_entropy
- ndarray.softmin
- ndarray.softsign
- ndarray.sort
- ndarray.space_to_depth
- ndarray.split
- ndarray.sqrt
- ndarray.square
- ndarray.squeeze
- ndarray.stack
- ndarray.stop_gradient
- ndarray.sum
- ndarray.sum_axis
- ndarray.swapaxes
- ndarray.take
- ndarray.tan
- ndarray.tanh
- ndarray.tile
- ndarray.topk
- ndarray.transpose
- ndarray.trunc
- ndarray.uniform
- ndarray.unravel_index
- ndarray.where
- ndarray.zeros_like
- ndarray.concatenate
- ndarray.ones
- ndarray.add
- ndarray.arange
- ndarray.linspace
- ndarray.eye
- ndarray.divide
- ndarray.equal
- ndarray.full
- ndarray.greater
- ndarray.greater_equal
- ndarray.imdecode
- ndarray.lesser
- ndarray.lesser_equal
- ndarray.logical_and
- ndarray.logical_or
- ndarray.logical_xor
- ndarray.maximum
- ndarray.minimum
- ndarray.moveaxis
- ndarray.modulo
- ndarray.multiply
- ndarray.not_equal
- ndarray.onehot_encode
- ndarray.power
- ndarray.subtract
- ndarray.true_divide
- ndarray.waitall
- ndarray.histogram
- ndarray.split_v2
- ndarray.to_dlpack_for_read
- ndarray.to_dlpack_for_write
- ndarray.from_dlpack
- ndarray.from_numpy
- ndarray.zeros
- ndarray.indexing_key_expand_implicit_axes
- ndarray.get_indexing_dispatch_code
- ndarray.get_oshape_of_gather_nd_op
- ndarray.empty
- ndarray.array
- ndarray.load
- ndarray.load_frombuffer
- ndarray.save
-
- ndarray.contrib
- ndarray.contrib.rand_zipfian
- ndarray.contrib.foreach
- ndarray.contrib.while_loop
- ndarray.contrib.cond
- ndarray.contrib.isinf
- ndarray.contrib.isfinite
- ndarray.contrib.isnan
- ndarray.contrib.AdaptiveAvgPooling2D
- ndarray.contrib.BilinearResize2D
- ndarray.contrib.CTCLoss
- ndarray.contrib.DeformableConvolution
- ndarray.contrib.DeformablePSROIPooling
- ndarray.contrib.ModulatedDeformableConvolution
- ndarray.contrib.MultiBoxDetection
- ndarray.contrib.MultiBoxPrior
- ndarray.contrib.MultiBoxTarget
- ndarray.contrib.MultiProposal
- ndarray.contrib.PSROIPooling
- ndarray.contrib.Proposal
- ndarray.contrib.ROIAlign
- ndarray.contrib.RROIAlign
- ndarray.contrib.SparseEmbedding
- ndarray.contrib.SyncBatchNorm
- ndarray.contrib.allclose
- ndarray.contrib.arange_like
- ndarray.contrib.backward_gradientmultiplier
- ndarray.contrib.backward_hawkesll
- ndarray.contrib.backward_index_copy
- ndarray.contrib.backward_quadratic
- ndarray.contrib.bipartite_matching
- ndarray.contrib.boolean_mask
- ndarray.contrib.box_decode
- ndarray.contrib.box_encode
- ndarray.contrib.box_iou
- ndarray.contrib.box_nms
- ndarray.contrib.box_non_maximum_suppression
- ndarray.contrib.calibrate_entropy
- ndarray.contrib.count_sketch
- ndarray.contrib.ctc_loss
- ndarray.contrib.dequantize
- ndarray.contrib.dgl_adjacency
- ndarray.contrib.dgl_csr_neighbor_non_uniform_sample
- ndarray.contrib.dgl_csr_neighbor_uniform_sample
- ndarray.contrib.dgl_graph_compact
- ndarray.contrib.dgl_subgraph
- ndarray.contrib.div_sqrt_dim
- ndarray.contrib.edge_id
- ndarray.contrib.fft
- ndarray.contrib.getnnz
- ndarray.contrib.gradientmultiplier
- ndarray.contrib.group_adagrad_update
- ndarray.contrib.hawkesll
- ndarray.contrib.ifft
- ndarray.contrib.index_array
- ndarray.contrib.index_copy
- ndarray.contrib.interleaved_matmul_encdec_qk
- ndarray.contrib.interleaved_matmul_encdec_valatt
- ndarray.contrib.interleaved_matmul_selfatt_qk
- ndarray.contrib.interleaved_matmul_selfatt_valatt
- ndarray.contrib.quadratic
- ndarray.contrib.quantize
- ndarray.contrib.quantize_v2
- ndarray.contrib.quantized_act
- ndarray.contrib.quantized_batch_norm
- ndarray.contrib.quantized_concat
- ndarray.contrib.quantized_conv
- ndarray.contrib.quantized_elemwise_add
- ndarray.contrib.quantized_elemwise_mul
- ndarray.contrib.quantized_embedding
- ndarray.contrib.quantized_flatten
- ndarray.contrib.quantized_fully_connected
- ndarray.contrib.quantized_pooling
- ndarray.contrib.requantize
- ndarray.contrib.round_ste
- ndarray.contrib.sign_ste
-
- ndarray.image
- ndarray.image.adjust_lighting
- ndarray.image.crop
- ndarray.image.flip_left_right
- ndarray.image.flip_top_bottom
- ndarray.image.normalize
- ndarray.image.random_brightness
- ndarray.image.random_color_jitter
- ndarray.image.random_contrast
- ndarray.image.random_flip_left_right
- ndarray.image.random_flip_top_bottom
- ndarray.image.random_hue
- ndarray.image.random_lighting
- ndarray.image.random_saturation
- ndarray.image.resize
- ndarray.image.to_tensor
-
- ndarray.linalg
- ndarray.linalg.det
- ndarray.linalg.extractdiag
- ndarray.linalg.extracttrian
- ndarray.linalg.gelqf
- ndarray.linalg.gemm
- ndarray.linalg.gemm2
- ndarray.linalg.inverse
- ndarray.linalg.makediag
- ndarray.linalg.maketrian
- ndarray.linalg.potrf
- ndarray.linalg.potri
- ndarray.linalg.slogdet
- ndarray.linalg.sumlogdiag
- ndarray.linalg.syevd
- ndarray.linalg.syrk
- ndarray.linalg.trmm
- ndarray.linalg.trsm
-
- ndarray.op
- ndarray.op.CachedOp
- ndarray.op.Activation
- ndarray.op.BatchNorm
- ndarray.op.BatchNorm_v1
- ndarray.op.BilinearSampler
- ndarray.op.BlockGrad
- ndarray.op.CTCLoss
- ndarray.op.Cast
- ndarray.op.Concat
- ndarray.op.Convolution
- ndarray.op.Convolution_v1
- ndarray.op.Correlation
- ndarray.op.Crop
- ndarray.op.Custom
- ndarray.op.Deconvolution
- ndarray.op.Dropout
- ndarray.op.ElementWiseSum
- ndarray.op.Embedding
- ndarray.op.Flatten
- ndarray.op.FullyConnected
- ndarray.op.GridGenerator
- ndarray.op.GroupNorm
- ndarray.op.IdentityAttachKLSparseReg
- ndarray.op.InstanceNorm
- ndarray.op.L2Normalization
- ndarray.op.LRN
- ndarray.op.LayerNorm
- ndarray.op.LeakyReLU
- ndarray.op.LinearRegressionOutput
- ndarray.op.LogisticRegressionOutput
- ndarray.op.MAERegressionOutput
- ndarray.op.MakeLoss
- ndarray.op.Pad
- ndarray.op.Pooling
- ndarray.op.Pooling_v1
- ndarray.op.RNN
- ndarray.op.ROIPooling
- ndarray.op.Reshape
- ndarray.op.SVMOutput
- ndarray.op.SequenceLast
- ndarray.op.SequenceMask
- ndarray.op.SequenceReverse
- ndarray.op.SliceChannel
- ndarray.op.Softmax
- ndarray.op.SoftmaxActivation
- ndarray.op.SoftmaxOutput
- ndarray.op.SpatialTransformer
- ndarray.op.SwapAxis
- ndarray.op.UpSampling
- ndarray.op.abs
- ndarray.op.adam_update
- ndarray.op.add_n
- ndarray.op.all_finite
- ndarray.op.amp_cast
- ndarray.op.amp_multicast
- ndarray.op.arccos
- ndarray.op.arccosh
- ndarray.op.arcsin
- ndarray.op.arcsinh
- ndarray.op.arctan
- ndarray.op.arctanh
- ndarray.op.argmax
- ndarray.op.argmax_channel
- ndarray.op.argmin
- ndarray.op.argsort
- ndarray.op.batch_dot
- ndarray.op.batch_take
- ndarray.op.broadcast_add
- ndarray.op.broadcast_axes
- ndarray.op.broadcast_axis
- ndarray.op.broadcast_div
- ndarray.op.broadcast_equal
- ndarray.op.broadcast_greater
- ndarray.op.broadcast_greater_equal
- ndarray.op.broadcast_hypot
- ndarray.op.broadcast_lesser
- ndarray.op.broadcast_lesser_equal
- ndarray.op.broadcast_like
- ndarray.op.broadcast_logical_and
- ndarray.op.broadcast_logical_or
- ndarray.op.broadcast_logical_xor
- ndarray.op.broadcast_maximum
- ndarray.op.broadcast_minimum
- ndarray.op.broadcast_minus
- ndarray.op.broadcast_mod
- ndarray.op.broadcast_mul
- ndarray.op.broadcast_not_equal
- ndarray.op.broadcast_plus
- ndarray.op.broadcast_power
- ndarray.op.broadcast_sub
- ndarray.op.broadcast_to
- ndarray.op.cast
- ndarray.op.cast_storage
- ndarray.op.cbrt
- ndarray.op.ceil
- ndarray.op.choose_element_0index
- ndarray.op.clip
- ndarray.op.col2im
- ndarray.op.concat
- ndarray.op.cos
- ndarray.op.cosh
- ndarray.op.crop
- ndarray.op.ctc_loss
- ndarray.op.cumsum
- ndarray.op.degrees
- ndarray.op.depth_to_space
- ndarray.op.diag
- ndarray.op.dot
- ndarray.op.elemwise_add
- ndarray.op.elemwise_div
- ndarray.op.elemwise_mul
- ndarray.op.elemwise_sub
- ndarray.op.erf
- ndarray.op.erfinv
- ndarray.op.exp
- ndarray.op.expand_dims
- ndarray.op.expm1
- ndarray.op.fill_element_0index
- ndarray.op.fix
- ndarray.op.flatten
- ndarray.op.flip
- ndarray.op.floor
- ndarray.op.ftml_update
- ndarray.op.ftrl_update
- ndarray.op.gamma
- ndarray.op.gammaln
- ndarray.op.gather_nd
- ndarray.op.hard_sigmoid
- ndarray.op.identity
- ndarray.op.im2col
- ndarray.op.khatri_rao
- ndarray.op.lamb_update_phase1
- ndarray.op.lamb_update_phase2
- ndarray.op.linalg_det
- ndarray.op.linalg_extractdiag
- ndarray.op.linalg_extracttrian
- ndarray.op.linalg_gelqf
- ndarray.op.linalg_gemm
- ndarray.op.linalg_gemm2
- ndarray.op.linalg_inverse
- ndarray.op.linalg_makediag
- ndarray.op.linalg_maketrian
- ndarray.op.linalg_potrf
- ndarray.op.linalg_potri
- ndarray.op.linalg_slogdet
- ndarray.op.linalg_sumlogdiag
- ndarray.op.linalg_syrk
- ndarray.op.linalg_trmm
- ndarray.op.linalg_trsm
- ndarray.op.log
- ndarray.op.log10
- ndarray.op.log1p
- ndarray.op.log2
- ndarray.op.log_softmax
- ndarray.op.logical_not
- ndarray.op.make_loss
- ndarray.op.max
- ndarray.op.max_axis
- ndarray.op.mean
- ndarray.op.min
- ndarray.op.min_axis
- ndarray.op.moments
- ndarray.op.mp_lamb_update_phase1
- ndarray.op.mp_lamb_update_phase2
- ndarray.op.mp_nag_mom_update
- ndarray.op.mp_sgd_mom_update
- ndarray.op.mp_sgd_update
- ndarray.op.multi_all_finite
- ndarray.op.multi_lars
- ndarray.op.multi_mp_sgd_mom_update
- ndarray.op.multi_mp_sgd_update
- ndarray.op.multi_sgd_mom_update
- ndarray.op.multi_sgd_update
- ndarray.op.multi_sum_sq
- ndarray.op.nag_mom_update
- ndarray.op.nanprod
- ndarray.op.nansum
- ndarray.op.negative
- ndarray.op.norm
- ndarray.op.normal
- ndarray.op.one_hot
- ndarray.op.ones_like
- ndarray.op.pad
- ndarray.op.pick
- ndarray.op.preloaded_multi_mp_sgd_mom_update
- ndarray.op.preloaded_multi_mp_sgd_update
- ndarray.op.preloaded_multi_sgd_mom_update
- ndarray.op.preloaded_multi_sgd_update
- ndarray.op.prod
- ndarray.op.radians
- ndarray.op.random_exponential
- ndarray.op.random_gamma
- ndarray.op.random_generalized_negative_binomial
- ndarray.op.random_negative_binomial
- ndarray.op.random_normal
- ndarray.op.random_pdf_dirichlet
- ndarray.op.random_pdf_exponential
- ndarray.op.random_pdf_gamma
- ndarray.op.random_pdf_generalized_negative_binomial
- ndarray.op.random_pdf_negative_binomial
- ndarray.op.random_pdf_normal
- ndarray.op.random_pdf_poisson
- ndarray.op.random_pdf_uniform
- ndarray.op.random_poisson
- ndarray.op.random_randint
- ndarray.op.random_uniform
- ndarray.op.ravel_multi_index
- ndarray.op.rcbrt
- ndarray.op.reciprocal
- ndarray.op.relu
- ndarray.op.repeat
- ndarray.op.reset_arrays
- ndarray.op.reshape
- ndarray.op.reshape_like
- ndarray.op.reverse
- ndarray.op.rint
- ndarray.op.rmsprop_update
- ndarray.op.rmspropalex_update
- ndarray.op.round
- ndarray.op.rsqrt
- ndarray.op.sample_exponential
- ndarray.op.sample_gamma
- ndarray.op.sample_generalized_negative_binomial
- ndarray.op.sample_multinomial
- ndarray.op.sample_negative_binomial
- ndarray.op.sample_normal
- ndarray.op.sample_poisson
- ndarray.op.sample_uniform
- ndarray.op.scatter_nd
- ndarray.op.sgd_mom_update
- ndarray.op.sgd_update
- ndarray.op.shape_array
- ndarray.op.shuffle
- ndarray.op.sigmoid
- ndarray.op.sign
- ndarray.op.signsgd_update
- ndarray.op.signum_update
- ndarray.op.sin
- ndarray.op.sinh
- ndarray.op.size_array
- ndarray.op.slice
- ndarray.op.slice_axis
- ndarray.op.slice_like
- ndarray.op.smooth_l1
- ndarray.op.softmax
- ndarray.op.softmax_cross_entropy
- ndarray.op.softmin
- ndarray.op.softsign
- ndarray.op.sort
- ndarray.op.space_to_depth
- ndarray.op.split
- ndarray.op.sqrt
- ndarray.op.square
- ndarray.op.squeeze
- ndarray.op.stack
- ndarray.op.stop_gradient
- ndarray.op.sum
- ndarray.op.sum_axis
- ndarray.op.swapaxes
- ndarray.op.take
- ndarray.op.tan
- ndarray.op.tanh
- ndarray.op.tile
- ndarray.op.topk
- ndarray.op.transpose
- ndarray.op.trunc
- ndarray.op.uniform
- ndarray.op.unravel_index
- ndarray.op.where
- ndarray.op.zeros_like
-
- ndarray.random
- ndarray.random.uniform
- ndarray.random.normal
- ndarray.random.randn
- ndarray.random.poisson
- ndarray.random.exponential
- ndarray.random.gamma
- ndarray.random.multinomial
- ndarray.random.negative_binomial
- ndarray.random.generalized_negative_binomial
- ndarray.random.shuffle
- ndarray.random.randint
- ndarray.random.exponential_like
- ndarray.random.gamma_like
- ndarray.random.generalized_negative_binomial_like
- ndarray.random.negative_binomial_like
- ndarray.random.normal_like
- ndarray.random.poisson_like
- ndarray.random.uniform_like
- ndarray.register
-
- ndarray.sparse
- ndarray.sparse.csr_matrix
- ndarray.sparse.row_sparse_array
- ndarray.sparse.add
- ndarray.sparse.subtract
- ndarray.sparse.multiply
- ndarray.sparse.divide
- ndarray.sparse.ElementWiseSum
- ndarray.sparse.Embedding
- ndarray.sparse.FullyConnected
- ndarray.sparse.LinearRegressionOutput
- ndarray.sparse.LogisticRegressionOutput
- ndarray.sparse.MAERegressionOutput
- ndarray.sparse.abs
- ndarray.sparse.adagrad_update
- ndarray.sparse.adam_update
- ndarray.sparse.add_n
- ndarray.sparse.arccos
- ndarray.sparse.arccosh
- ndarray.sparse.arcsin
- ndarray.sparse.arcsinh
- ndarray.sparse.arctan
- ndarray.sparse.arctanh
- ndarray.sparse.broadcast_add
- ndarray.sparse.broadcast_div
- ndarray.sparse.broadcast_minus
- ndarray.sparse.broadcast_mul
- ndarray.sparse.broadcast_plus
- ndarray.sparse.broadcast_sub
- ndarray.sparse.cast_storage
- ndarray.sparse.cbrt
- ndarray.sparse.ceil
- ndarray.sparse.clip
- ndarray.sparse.concat
- ndarray.sparse.cos
- ndarray.sparse.cosh
- ndarray.sparse.degrees
- ndarray.sparse.dot
- ndarray.sparse.elemwise_add
- ndarray.sparse.elemwise_div
- ndarray.sparse.elemwise_mul
- ndarray.sparse.elemwise_sub
- ndarray.sparse.exp
- ndarray.sparse.expm1
- ndarray.sparse.fix
- ndarray.sparse.floor
- ndarray.sparse.ftrl_update
- ndarray.sparse.gamma
- ndarray.sparse.gammaln
- ndarray.sparse.log
- ndarray.sparse.log10
- ndarray.sparse.log1p
- ndarray.sparse.log2
- ndarray.sparse.make_loss
- ndarray.sparse.mean
- ndarray.sparse.negative
- ndarray.sparse.norm
- ndarray.sparse.radians
- ndarray.sparse.relu
- ndarray.sparse.retain
- ndarray.sparse.rint
- ndarray.sparse.round
- ndarray.sparse.rsqrt
- ndarray.sparse.sgd_mom_update
- ndarray.sparse.sgd_update
- ndarray.sparse.sigmoid
- ndarray.sparse.sign
- ndarray.sparse.sin
- ndarray.sparse.sinh
- ndarray.sparse.slice
- ndarray.sparse.sqrt
- ndarray.sparse.square
- ndarray.sparse.stop_gradient
- ndarray.sparse.sum
- ndarray.sparse.tan
- ndarray.sparse.tanh
- ndarray.sparse.trunc
- ndarray.sparse.where
- ndarray.sparse.zeros_like
- ndarray.sparse.BaseSparseNDArray
- ndarray.sparse.CSRNDArray
- ndarray.sparse.RowSparseNDArray
-
- gluon.Block
- gluon.Block.apply
- gluon.Block.cast
- gluon.Block.collect_params
- gluon.Block.forward
- gluon.Block.hybridize
- gluon.Block.initialize
- gluon.Block.load_parameters
- gluon.Block.load_params
- gluon.Block.name_scope
- gluon.Block.register_child
- gluon.Block.register_forward_hook
- gluon.Block.register_forward_pre_hook
- gluon.Block.register_op_hook
- gluon.Block.save_parameters
- gluon.Block.save_params
- gluon.Block.summary
-
- gluon.HybridBlock
- gluon.HybridBlock.apply
- gluon.HybridBlock.cast
- gluon.HybridBlock.collect_params
- gluon.HybridBlock.export
- gluon.HybridBlock.forward
- gluon.HybridBlock.hybrid_forward
- gluon.HybridBlock.hybridize
- gluon.HybridBlock.infer_shape
- gluon.HybridBlock.infer_type
- gluon.HybridBlock.initialize
- gluon.HybridBlock.load_parameters
- gluon.HybridBlock.load_params
- gluon.HybridBlock.name_scope
- gluon.HybridBlock.optimize_for
- gluon.HybridBlock.register_child
- gluon.HybridBlock.register_forward_hook
- gluon.HybridBlock.register_forward_pre_hook
- gluon.HybridBlock.register_op_hook
- gluon.HybridBlock.save_parameters
- gluon.HybridBlock.save_params
- gluon.HybridBlock.summary
-
- gluon.SymbolBlock
- gluon.SymbolBlock.apply
- gluon.SymbolBlock.cast
- gluon.SymbolBlock.collect_params
- gluon.SymbolBlock.export
- gluon.SymbolBlock.forward
- gluon.SymbolBlock.hybrid_forward
- gluon.SymbolBlock.hybridize
- gluon.SymbolBlock.imports
- gluon.SymbolBlock.infer_shape
- gluon.SymbolBlock.infer_type
- gluon.SymbolBlock.initialize
- gluon.SymbolBlock.load_parameters
- gluon.SymbolBlock.load_params
- gluon.SymbolBlock.name_scope
- gluon.SymbolBlock.optimize_for
- gluon.SymbolBlock.register_child
- gluon.SymbolBlock.register_forward_hook
- gluon.SymbolBlock.register_forward_pre_hook
- gluon.SymbolBlock.register_op_hook
- gluon.SymbolBlock.save_parameters
- gluon.SymbolBlock.save_params
- gluon.SymbolBlock.summary
-
- gluon.Constant
- gluon.Constant.cast
- gluon.Constant.data
- gluon.Constant.grad
- gluon.Constant.initialize
- gluon.Constant.list_ctx
- gluon.Constant.list_data
- gluon.Constant.list_grad
- gluon.Constant.list_row_sparse_data
- gluon.Constant.reset_ctx
- gluon.Constant.row_sparse_data
- gluon.Constant.set_data
- gluon.Constant.var
- gluon.Constant.zero_grad
-
- gluon.Parameter
- gluon.Parameter.cast
- gluon.Parameter.data
- gluon.Parameter.grad
- gluon.Parameter.initialize
- gluon.Parameter.list_ctx
- gluon.Parameter.list_data
- gluon.Parameter.list_grad
- gluon.Parameter.list_row_sparse_data
- gluon.Parameter.reset_ctx
- gluon.Parameter.row_sparse_data
- gluon.Parameter.set_data
- gluon.Parameter.var
- gluon.Parameter.zero_grad
-
- gluon.ParameterDict
- gluon.ParameterDict.get
- gluon.ParameterDict.get_constant
- gluon.ParameterDict.initialize
- gluon.ParameterDict.list_ctx
- gluon.ParameterDict.load
- gluon.ParameterDict.load_dict
- gluon.ParameterDict.reset_ctx
- gluon.ParameterDict.save
- gluon.ParameterDict.setattr
- gluon.ParameterDict.update
- gluon.ParameterDict.zero_grad
- gluon.contrib
-
- gluon.data
- gluon.data.vision.datasets
- gluon.data.vision.transforms
- gluon.data.Dataset
- gluon.data.ArrayDataset
- gluon.data.RecordFileDataset
- gluon.data.SimpleDataset
- gluon.data.BatchSampler
- gluon.data.DataLoader
- gluon.data.FilterSampler
- gluon.data.RandomSampler
- gluon.data.Sampler
- gluon.data.SequentialSampler
-
- gluon.loss
- gluon.loss.Loss
- gluon.loss.L2Loss
- gluon.loss.L1Loss
- gluon.loss.SigmoidBinaryCrossEntropyLoss
- gluon.loss.SigmoidBCELoss
- gluon.loss.SoftmaxCrossEntropyLoss
- gluon.loss.SoftmaxCELoss
- gluon.loss.KLDivLoss
- gluon.loss.CTCLoss
- gluon.loss.HuberLoss
- gluon.loss.HingeLoss
- gluon.loss.SquaredHingeLoss
- gluon.loss.LogisticLoss
- gluon.loss.TripletLoss
- gluon.loss.PoissonNLLLoss
- gluon.loss.CosineEmbeddingLoss
- gluon.loss.SDMLLoss
- gluon.nn
- gluon.rnn
- initializer
- initializer.Bilinear
- initializer.Constant
- initializer.FusedRNN
- initializer.InitDesc
- initializer.Initializer
- initializer.LSTMBias
- initializer.Load
- initializer.MSRAPrelu
- initializer.Mixed
- initializer.Normal
- initializer.One
- initializer.Orthogonal
- initializer.Uniform
- initializer.Xavier
- initializer.Zero
- optimizer
- optimizer.AdaDelta
- optimizer.AdaGrad
- optimizer.Adam
- optimizer.Adamax
- optimizer.DCASGD
- optimizer.FTML
- optimizer.Ftrl
- optimizer.LARS
- optimizer.LBSGD
- optimizer.NAG
- optimizer.Nadam
- optimizer.Optimizer
- optimizer.RMSProp
- optimizer.SGD
- optimizer.SGLD
- optimizer.Signum
- optimizer.LAMB
- optimizer.Test
- optimizer.Updater
- optimizer.ccSGD
- metric
- metric.Accuracy
- metric.Caffe
- metric.CompositeEvalMetric
- metric.CrossEntropy
- metric.CustomMetric
- metric.EvalMetric
- metric.F1
- metric.Loss
- metric.MAE
- metric.MCC
- metric.MSE
- metric.NegativeLogLikelihood
- metric.PCC
- metric.PearsonCorrelation
- metric.Perplexity
- metric.RMSE
- metric.TopKAccuracy
- metric.Torch
- symbol
-
- symbol.contrib
- symbol.contrib.rand_zipfian
- symbol.contrib.foreach
- symbol.contrib.while_loop
- symbol.contrib.cond
- symbol.contrib.AdaptiveAvgPooling2D
- symbol.contrib.BilinearResize2D
- symbol.contrib.CTCLoss
- symbol.contrib.DeformableConvolution
- symbol.contrib.DeformablePSROIPooling
- symbol.contrib.ModulatedDeformableConvolution
- symbol.contrib.MultiBoxDetection
- symbol.contrib.MultiBoxPrior
- symbol.contrib.MultiBoxTarget
- symbol.contrib.MultiProposal
- symbol.contrib.PSROIPooling
- symbol.contrib.Proposal
- symbol.contrib.ROIAlign
- symbol.contrib.RROIAlign
- symbol.contrib.SparseEmbedding
- symbol.contrib.SyncBatchNorm
- symbol.contrib.allclose
- symbol.contrib.arange_like
- symbol.contrib.backward_gradientmultiplier
- symbol.contrib.backward_hawkesll
- symbol.contrib.backward_index_copy
- symbol.contrib.backward_quadratic
- symbol.contrib.bipartite_matching
- symbol.contrib.boolean_mask
- symbol.contrib.box_decode
- symbol.contrib.box_encode
- symbol.contrib.box_iou
- symbol.contrib.box_nms
- symbol.contrib.box_non_maximum_suppression
- symbol.contrib.calibrate_entropy
- symbol.contrib.count_sketch
- symbol.contrib.ctc_loss
- symbol.contrib.dequantize
- symbol.contrib.dgl_adjacency
- symbol.contrib.dgl_csr_neighbor_non_uniform_sample
- symbol.contrib.dgl_csr_neighbor_uniform_sample
- symbol.contrib.dgl_graph_compact
- symbol.contrib.dgl_subgraph
- symbol.contrib.div_sqrt_dim
- symbol.contrib.edge_id
- symbol.contrib.fft
- symbol.contrib.getnnz
- symbol.contrib.gradientmultiplier
- symbol.contrib.group_adagrad_update
- symbol.contrib.hawkesll
- symbol.contrib.ifft
- symbol.contrib.index_array
- symbol.contrib.index_copy
- symbol.contrib.interleaved_matmul_encdec_qk
- symbol.contrib.interleaved_matmul_encdec_valatt
- symbol.contrib.interleaved_matmul_selfatt_qk
- symbol.contrib.interleaved_matmul_selfatt_valatt
- symbol.contrib.quadratic
- symbol.contrib.quantize
- symbol.contrib.quantize_v2
- symbol.contrib.quantized_act
- symbol.contrib.quantized_batch_norm
- symbol.contrib.quantized_concat
- symbol.contrib.quantized_conv
- symbol.contrib.quantized_elemwise_add
- symbol.contrib.quantized_elemwise_mul
- symbol.contrib.quantized_embedding
- symbol.contrib.quantized_flatten
- symbol.contrib.quantized_fully_connected
- symbol.contrib.quantized_pooling
- symbol.contrib.requantize
- symbol.contrib.round_ste
- symbol.contrib.sign_ste
-
- symbol.image
- symbol.image.adjust_lighting
- symbol.image.crop
- symbol.image.flip_left_right
- symbol.image.flip_top_bottom
- symbol.image.normalize
- symbol.image.random_brightness
- symbol.image.random_color_jitter
- symbol.image.random_contrast
- symbol.image.random_flip_left_right
- symbol.image.random_flip_top_bottom
- symbol.image.random_hue
- symbol.image.random_lighting
- symbol.image.random_saturation
- symbol.image.resize
- symbol.image.to_tensor
-
- symbol.linalg
- symbol.linalg.det
- symbol.linalg.extractdiag
- symbol.linalg.extracttrian
- symbol.linalg.gelqf
- symbol.linalg.gemm
- symbol.linalg.gemm2
- symbol.linalg.inverse
- symbol.linalg.makediag
- symbol.linalg.maketrian
- symbol.linalg.potrf
- symbol.linalg.potri
- symbol.linalg.slogdet
- symbol.linalg.sumlogdiag
- symbol.linalg.syevd
- symbol.linalg.syrk
- symbol.linalg.trmm
- symbol.linalg.trsm
-
- symbol.op
- symbol.op.Activation
- symbol.op.BatchNorm
- symbol.op.BatchNorm_v1
- symbol.op.BilinearSampler
- symbol.op.BlockGrad
- symbol.op.CTCLoss
- symbol.op.Cast
- symbol.op.Concat
- symbol.op.Convolution
- symbol.op.Convolution_v1
- symbol.op.Correlation
- symbol.op.Crop
- symbol.op.Custom
- symbol.op.Deconvolution
- symbol.op.Dropout
- symbol.op.ElementWiseSum
- symbol.op.Embedding
- symbol.op.Flatten
- symbol.op.FullyConnected
- symbol.op.GridGenerator
- symbol.op.GroupNorm
- symbol.op.IdentityAttachKLSparseReg
- symbol.op.InstanceNorm
- symbol.op.L2Normalization
- symbol.op.LRN
- symbol.op.LayerNorm
- symbol.op.LeakyReLU
- symbol.op.LinearRegressionOutput
- symbol.op.LogisticRegressionOutput
- symbol.op.MAERegressionOutput
- symbol.op.MakeLoss
- symbol.op.Pad
- symbol.op.Pooling
- symbol.op.Pooling_v1
- symbol.op.RNN
- symbol.op.ROIPooling
- symbol.op.Reshape
- symbol.op.SVMOutput
- symbol.op.SequenceLast
- symbol.op.SequenceMask
- symbol.op.SequenceReverse
- symbol.op.SliceChannel
- symbol.op.Softmax
- symbol.op.SoftmaxActivation
- symbol.op.SoftmaxOutput
- symbol.op.SpatialTransformer
- symbol.op.SwapAxis
- symbol.op.UpSampling
- symbol.op.abs
- symbol.op.adam_update
- symbol.op.add_n
- symbol.op.all_finite
- symbol.op.amp_cast
- symbol.op.amp_multicast
- symbol.op.arccos
- symbol.op.arccosh
- symbol.op.arcsin
- symbol.op.arcsinh
- symbol.op.arctan
- symbol.op.arctanh
- symbol.op.argmax
- symbol.op.argmax_channel
- symbol.op.argmin
- symbol.op.argsort
- symbol.op.batch_dot
- symbol.op.batch_take
- symbol.op.broadcast_add
- symbol.op.broadcast_axes
- symbol.op.broadcast_axis
- symbol.op.broadcast_div
- symbol.op.broadcast_equal
- symbol.op.broadcast_greater
- symbol.op.broadcast_greater_equal
- symbol.op.broadcast_hypot
- symbol.op.broadcast_lesser
- symbol.op.broadcast_lesser_equal
- symbol.op.broadcast_like
- symbol.op.broadcast_logical_and
- symbol.op.broadcast_logical_or
- symbol.op.broadcast_logical_xor
- symbol.op.broadcast_maximum
- symbol.op.broadcast_minimum
- symbol.op.broadcast_minus
- symbol.op.broadcast_mod
- symbol.op.broadcast_mul
- symbol.op.broadcast_not_equal
- symbol.op.broadcast_plus
- symbol.op.broadcast_power
- symbol.op.broadcast_sub
- symbol.op.broadcast_to
- symbol.op.cast_storage
- symbol.op.cbrt
- symbol.op.ceil
- symbol.op.choose_element_0index
- symbol.op.clip
- symbol.op.col2im
- symbol.op.cos
- symbol.op.cosh
- symbol.op.ctc_loss
- symbol.op.cumsum
- symbol.op.degrees
- symbol.op.depth_to_space
- symbol.op.diag
- symbol.op.dot
- symbol.op.elemwise_add
- symbol.op.elemwise_div
- symbol.op.elemwise_mul
- symbol.op.elemwise_sub
- symbol.op.erf
- symbol.op.erfinv
- symbol.op.exp
- symbol.op.expand_dims
- symbol.op.expm1
- symbol.op.fill_element_0index
- symbol.op.fix
- symbol.op.flip
- symbol.op.floor
- symbol.op.ftml_update
- symbol.op.ftrl_update
- symbol.op.gamma
- symbol.op.gammaln
- symbol.op.gather_nd
- symbol.op.hard_sigmoid
- symbol.op.identity
- symbol.op.im2col
- symbol.op.khatri_rao
- symbol.op.lamb_update_phase1
- symbol.op.lamb_update_phase2
- symbol.op.linalg_det
- symbol.op.linalg_extractdiag
- symbol.op.linalg_extracttrian
- symbol.op.linalg_gelqf
- symbol.op.linalg_gemm
- symbol.op.linalg_gemm2
- symbol.op.linalg_inverse
- symbol.op.linalg_makediag
- symbol.op.linalg_maketrian
- symbol.op.linalg_potrf
- symbol.op.linalg_potri
- symbol.op.linalg_slogdet
- symbol.op.linalg_sumlogdiag
- symbol.op.linalg_syrk
- symbol.op.linalg_trmm
- symbol.op.linalg_trsm
- symbol.op.log
- symbol.op.log10
- symbol.op.log1p
- symbol.op.log2
- symbol.op.log_softmax
- symbol.op.logical_not
- symbol.op.make_loss
- symbol.op.max
- symbol.op.max_axis
- symbol.op.mean
- symbol.op.min
- symbol.op.min_axis
- symbol.op.moments
- symbol.op.mp_lamb_update_phase1
- symbol.op.mp_lamb_update_phase2
- symbol.op.mp_nag_mom_update
- symbol.op.mp_sgd_mom_update
- symbol.op.mp_sgd_update
- symbol.op.multi_all_finite
- symbol.op.multi_lars
- symbol.op.multi_mp_sgd_mom_update
- symbol.op.multi_mp_sgd_update
- symbol.op.multi_sgd_mom_update
- symbol.op.multi_sgd_update
- symbol.op.multi_sum_sq
- symbol.op.nag_mom_update
- symbol.op.nanprod
- symbol.op.nansum
- symbol.op.negative
- symbol.op.norm
- symbol.op.normal
- symbol.op.one_hot
- symbol.op.ones_like
- symbol.op.pick
- symbol.op.preloaded_multi_mp_sgd_mom_update
- symbol.op.preloaded_multi_mp_sgd_update
- symbol.op.preloaded_multi_sgd_mom_update
- symbol.op.preloaded_multi_sgd_update
- symbol.op.prod
- symbol.op.radians
- symbol.op.random_exponential
- symbol.op.random_gamma
- symbol.op.random_generalized_negative_binomial
- symbol.op.random_negative_binomial
- symbol.op.random_normal
- symbol.op.random_pdf_dirichlet
- symbol.op.random_pdf_exponential
- symbol.op.random_pdf_gamma
- symbol.op.random_pdf_generalized_negative_binomial
- symbol.op.random_pdf_negative_binomial
- symbol.op.random_pdf_normal
- symbol.op.random_pdf_poisson
- symbol.op.random_pdf_uniform
- symbol.op.random_poisson
- symbol.op.random_randint
- symbol.op.random_uniform
- symbol.op.ravel_multi_index
- symbol.op.rcbrt
- symbol.op.reciprocal
- symbol.op.relu
- symbol.op.repeat
- symbol.op.reset_arrays
- symbol.op.reshape_like
- symbol.op.reverse
- symbol.op.rint
- symbol.op.rmsprop_update
- symbol.op.rmspropalex_update
- symbol.op.round
- symbol.op.rsqrt
- symbol.op.sample_exponential
- symbol.op.sample_gamma
- symbol.op.sample_generalized_negative_binomial
- symbol.op.sample_multinomial
- symbol.op.sample_negative_binomial
- symbol.op.sample_normal
- symbol.op.sample_poisson
- symbol.op.sample_uniform
- symbol.op.scatter_nd
- symbol.op.sgd_mom_update
- symbol.op.sgd_update
- symbol.op.shape_array
- symbol.op.shuffle
- symbol.op.sigmoid
- symbol.op.sign
- symbol.op.signsgd_update
- symbol.op.signum_update
- symbol.op.sin
- symbol.op.sinh
- symbol.op.size_array
- symbol.op.slice
- symbol.op.slice_axis
- symbol.op.slice_like
- symbol.op.smooth_l1
- symbol.op.softmax_cross_entropy
- symbol.op.softmin
- symbol.op.softsign
- symbol.op.sort
- symbol.op.space_to_depth
- symbol.op.split
- symbol.op.sqrt
- symbol.op.square
- symbol.op.squeeze
- symbol.op.stack
- symbol.op.stop_gradient
- symbol.op.sum
- symbol.op.sum_axis
- symbol.op.swapaxes
- symbol.op.take
- symbol.op.tan
- symbol.op.tanh
- symbol.op.tile
- symbol.op.topk
- symbol.op.transpose
- symbol.op.trunc
- symbol.op.uniform
- symbol.op.unravel_index
- symbol.op.where
- symbol.op.zeros_like
-
- symbol.random
- symbol.random.uniform
- symbol.random.normal
- symbol.random.randn
- symbol.random.poisson
- symbol.random.exponential
- symbol.random.gamma
- symbol.random.multinomial
- symbol.random.negative_binomial
- symbol.random.generalized_negative_binomial
- symbol.random.shuffle
- symbol.random.randint
- symbol.random.exponential_like
- symbol.random.gamma_like
- symbol.random.generalized_negative_binomial_like
- symbol.random.negative_binomial_like
- symbol.random.normal_like
- symbol.random.poisson_like
- symbol.random.uniform_like
- symbol.register
-
- symbol.sparse
- symbol.sparse.ElementWiseSum
- symbol.sparse.Embedding
- symbol.sparse.FullyConnected
- symbol.sparse.LinearRegressionOutput
- symbol.sparse.LogisticRegressionOutput
- symbol.sparse.MAERegressionOutput
- symbol.sparse.abs
- symbol.sparse.adagrad_update
- symbol.sparse.adam_update
- symbol.sparse.add_n
- symbol.sparse.arccos
- symbol.sparse.arccosh
- symbol.sparse.arcsin
- symbol.sparse.arcsinh
- symbol.sparse.arctan
- symbol.sparse.arctanh
- symbol.sparse.broadcast_add
- symbol.sparse.broadcast_div
- symbol.sparse.broadcast_minus
- symbol.sparse.broadcast_mul
- symbol.sparse.broadcast_plus
- symbol.sparse.broadcast_sub
- symbol.sparse.cast_storage
- symbol.sparse.cbrt
- symbol.sparse.ceil
- symbol.sparse.clip
- symbol.sparse.concat
- symbol.sparse.cos
- symbol.sparse.cosh
- symbol.sparse.degrees
- symbol.sparse.dot
- symbol.sparse.elemwise_add
- symbol.sparse.elemwise_div
- symbol.sparse.elemwise_mul
- symbol.sparse.elemwise_sub
- symbol.sparse.exp
- symbol.sparse.expm1
- symbol.sparse.fix
- symbol.sparse.floor
- symbol.sparse.ftrl_update
- symbol.sparse.gamma
- symbol.sparse.gammaln
- symbol.sparse.log
- symbol.sparse.log10
- symbol.sparse.log1p
- symbol.sparse.log2
- symbol.sparse.make_loss
- symbol.sparse.mean
- symbol.sparse.negative
- symbol.sparse.norm
- symbol.sparse.radians
- symbol.sparse.relu
- symbol.sparse.retain
- symbol.sparse.rint
- symbol.sparse.round
- symbol.sparse.rsqrt
- symbol.sparse.sgd_mom_update
- symbol.sparse.sgd_update
- symbol.sparse.sigmoid
- symbol.sparse.sign
- symbol.sparse.sin
- symbol.sparse.sinh
- symbol.sparse.slice
- symbol.sparse.sqrt
- symbol.sparse.square
- symbol.sparse.stop_gradient
- symbol.sparse.sum
- symbol.sparse.tan
- symbol.sparse.tanh
- symbol.sparse.trunc
- symbol.sparse.where
- symbol.sparse.zeros_like
- symbol.Activation
- symbol.BatchNorm
- symbol.BatchNorm_v1
- symbol.BilinearSampler
- symbol.BlockGrad
- symbol.CTCLoss
- symbol.Cast
- symbol.Concat
- symbol.Convolution
- symbol.Convolution_v1
- symbol.Correlation
- symbol.Crop
- symbol.Custom
- symbol.Deconvolution
- symbol.Dropout
- symbol.ElementWiseSum
- symbol.Embedding
- symbol.Flatten
- symbol.FullyConnected
- symbol.GridGenerator
- symbol.GroupNorm
- symbol.IdentityAttachKLSparseReg
- symbol.InstanceNorm
- symbol.L2Normalization
- symbol.LRN
- symbol.LayerNorm
- symbol.LeakyReLU
- symbol.LinearRegressionOutput
- symbol.LogisticRegressionOutput
- symbol.MAERegressionOutput
- symbol.MakeLoss
- symbol.Pad
- symbol.Pooling
- symbol.Pooling_v1
- symbol.RNN
- symbol.ROIPooling
- symbol.Reshape
- symbol.SVMOutput
- symbol.SequenceLast
- symbol.SequenceMask
- symbol.SequenceReverse
- symbol.SliceChannel
- symbol.Softmax
- symbol.SoftmaxActivation
- symbol.SoftmaxOutput
- symbol.SpatialTransformer
- symbol.SwapAxis
- symbol.UpSampling
- symbol.abs
- symbol.adam_update
- symbol.add_n
- symbol.all_finite
- symbol.amp_cast
- symbol.amp_multicast
- symbol.arccos
- symbol.arccosh
- symbol.arcsin
- symbol.arcsinh
- symbol.arctan
- symbol.arctanh
- symbol.argmax
- symbol.argmax_channel
- symbol.argmin
- symbol.argsort
- symbol.batch_dot
- symbol.batch_take
- symbol.broadcast_add
- symbol.broadcast_axes
- symbol.broadcast_axis
- symbol.broadcast_div
- symbol.broadcast_equal
- symbol.broadcast_greater
- symbol.broadcast_greater_equal
- symbol.broadcast_hypot
- symbol.broadcast_lesser
- symbol.broadcast_lesser_equal
- symbol.broadcast_like
- symbol.broadcast_logical_and
- symbol.broadcast_logical_or
- symbol.broadcast_logical_xor
- symbol.broadcast_maximum
- symbol.broadcast_minimum
- symbol.broadcast_minus
- symbol.broadcast_mod
- symbol.broadcast_mul
- symbol.broadcast_not_equal
- symbol.broadcast_plus
- symbol.broadcast_power
- symbol.broadcast_sub
- symbol.broadcast_to
- symbol.cast_storage
- symbol.cbrt
- symbol.ceil
- symbol.choose_element_0index
- symbol.clip
- symbol.col2im
- symbol.cos
- symbol.cosh
- symbol.ctc_loss
- symbol.cumsum
- symbol.degrees
- symbol.depth_to_space
- symbol.diag
- symbol.dot
- symbol.elemwise_add
- symbol.elemwise_div
- symbol.elemwise_mul
- symbol.elemwise_sub
- symbol.erf
- symbol.erfinv
- symbol.exp
- symbol.expand_dims
- symbol.expm1
- symbol.fill_element_0index
- symbol.fix
- symbol.flip
- symbol.floor
- symbol.ftml_update
- symbol.ftrl_update
- symbol.gamma
- symbol.gammaln
- symbol.gather_nd
- symbol.hard_sigmoid
- symbol.identity
- symbol.im2col
- symbol.khatri_rao
- symbol.lamb_update_phase1
- symbol.lamb_update_phase2
- symbol.linalg_det
- symbol.linalg_extractdiag
- symbol.linalg_extracttrian
- symbol.linalg_gelqf
- symbol.linalg_gemm
- symbol.linalg_gemm2
- symbol.linalg_inverse
- symbol.linalg_makediag
- symbol.linalg_maketrian
- symbol.linalg_potrf
- symbol.linalg_potri
- symbol.linalg_slogdet
- symbol.linalg_sumlogdiag
- symbol.linalg_syrk
- symbol.linalg_trmm
- symbol.linalg_trsm
- symbol.log
- symbol.log10
- symbol.log1p
- symbol.log2
- symbol.log_softmax
- symbol.logical_not
- symbol.make_loss
- symbol.max
- symbol.max_axis
- symbol.mean
- symbol.min
- symbol.min_axis
- symbol.moments
- symbol.mp_lamb_update_phase1
- symbol.mp_lamb_update_phase2
- symbol.mp_nag_mom_update
- symbol.mp_sgd_mom_update
- symbol.mp_sgd_update
- symbol.multi_all_finite
- symbol.multi_lars
- symbol.multi_mp_sgd_mom_update
- symbol.multi_mp_sgd_update
- symbol.multi_sgd_mom_update
- symbol.multi_sgd_update
- symbol.multi_sum_sq
- symbol.nag_mom_update
- symbol.nanprod
- symbol.nansum
- symbol.negative
- symbol.norm
- symbol.normal
- symbol.one_hot
- symbol.ones_like
- symbol.pick
- symbol.preloaded_multi_mp_sgd_mom_update
- symbol.preloaded_multi_mp_sgd_update
- symbol.preloaded_multi_sgd_mom_update
- symbol.preloaded_multi_sgd_update
- symbol.prod
- symbol.radians
- symbol.random_exponential
- symbol.random_gamma
- symbol.random_generalized_negative_binomial
- symbol.random_negative_binomial
- symbol.random_normal
- symbol.random_pdf_dirichlet
- symbol.random_pdf_exponential
- symbol.random_pdf_gamma
- symbol.random_pdf_generalized_negative_binomial
- symbol.random_pdf_negative_binomial
- symbol.random_pdf_normal
- symbol.random_pdf_poisson
- symbol.random_pdf_uniform
- symbol.random_poisson
- symbol.random_randint
- symbol.random_uniform
- symbol.ravel_multi_index
- symbol.rcbrt
- symbol.reciprocal
- symbol.relu
- symbol.repeat
- symbol.reset_arrays
- symbol.reshape_like
- symbol.reverse
- symbol.rint
- symbol.rmsprop_update
- symbol.rmspropalex_update
- symbol.round
- symbol.rsqrt
- symbol.sample_exponential
- symbol.sample_gamma
- symbol.sample_generalized_negative_binomial
- symbol.sample_multinomial
- symbol.sample_negative_binomial
- symbol.sample_normal
- symbol.sample_poisson
- symbol.sample_uniform
- symbol.scatter_nd
- symbol.sgd_mom_update
- symbol.sgd_update
- symbol.shape_array
- symbol.shuffle
- symbol.sigmoid
- symbol.sign
- symbol.signsgd_update
- symbol.signum_update
- symbol.sin
- symbol.sinh
- symbol.size_array
- symbol.slice
- symbol.slice_axis
- symbol.slice_like
- symbol.smooth_l1
- symbol.softmax_cross_entropy
- symbol.softmin
- symbol.softsign
- symbol.sort
- symbol.space_to_depth
- symbol.split
- symbol.sqrt
- symbol.square
- symbol.squeeze
- symbol.stack
- symbol.stop_gradient
- symbol.sum
- symbol.sum_axis
- symbol.swapaxes
- symbol.take
- symbol.tan
- symbol.tanh
- symbol.tile
- symbol.topk
- symbol.transpose
- symbol.trunc
- symbol.uniform
- symbol.unravel_index
- symbol.where
- symbol.zeros_like
- symbol.var
- symbol.Variable
- symbol.Group
- symbol.load
- symbol.load_json
- symbol.pow
- symbol.power
- symbol.maximum
- symbol.minimum
- symbol.hypot
- symbol.eye
- symbol.zeros
- symbol.ones
- symbol.full
- symbol.arange
- symbol.linspace
- symbol.histogram
- symbol.split_v2
-
- contrib.ndarray
- contrib.ndarray.AdaptiveAvgPooling2D
- contrib.ndarray.BilinearResize2D
- contrib.ndarray.CTCLoss
- contrib.ndarray.DeformableConvolution
- contrib.ndarray.DeformablePSROIPooling
- contrib.ndarray.ModulatedDeformableConvolution
- contrib.ndarray.MultiBoxDetection
- contrib.ndarray.MultiBoxPrior
- contrib.ndarray.MultiBoxTarget
- contrib.ndarray.MultiProposal
- contrib.ndarray.PSROIPooling
- contrib.ndarray.Proposal
- contrib.ndarray.ROIAlign
- contrib.ndarray.RROIAlign
- contrib.ndarray.SparseEmbedding
- contrib.ndarray.SyncBatchNorm
- contrib.ndarray.allclose
- contrib.ndarray.arange_like
- contrib.ndarray.backward_gradientmultiplier
- contrib.ndarray.backward_hawkesll
- contrib.ndarray.backward_index_copy
- contrib.ndarray.backward_quadratic
- contrib.ndarray.bipartite_matching
- contrib.ndarray.boolean_mask
- contrib.ndarray.box_decode
- contrib.ndarray.box_encode
- contrib.ndarray.box_iou
- contrib.ndarray.box_nms
- contrib.ndarray.box_non_maximum_suppression
- contrib.ndarray.calibrate_entropy
- contrib.ndarray.count_sketch
- contrib.ndarray.ctc_loss
- contrib.ndarray.dequantize
- contrib.ndarray.dgl_adjacency
- contrib.ndarray.dgl_csr_neighbor_non_uniform_sample
- contrib.ndarray.dgl_csr_neighbor_uniform_sample
- contrib.ndarray.dgl_graph_compact
- contrib.ndarray.dgl_subgraph
- contrib.ndarray.div_sqrt_dim
- contrib.ndarray.edge_id
- contrib.ndarray.fft
- contrib.ndarray.getnnz
- contrib.ndarray.gradientmultiplier
- contrib.ndarray.group_adagrad_update
- contrib.ndarray.hawkesll
- contrib.ndarray.ifft
- contrib.ndarray.index_array
- contrib.ndarray.index_copy
- contrib.ndarray.interleaved_matmul_encdec_qk
- contrib.ndarray.interleaved_matmul_encdec_valatt
- contrib.ndarray.interleaved_matmul_selfatt_qk
- contrib.ndarray.interleaved_matmul_selfatt_valatt
- contrib.ndarray.quadratic
- contrib.ndarray.quantize
- contrib.ndarray.quantize_v2
- contrib.ndarray.quantized_act
- contrib.ndarray.quantized_batch_norm
- contrib.ndarray.quantized_concat
- contrib.ndarray.quantized_conv
- contrib.ndarray.quantized_elemwise_add
- contrib.ndarray.quantized_elemwise_mul
- contrib.ndarray.quantized_embedding
- contrib.ndarray.quantized_flatten
- contrib.ndarray.quantized_fully_connected
- contrib.ndarray.quantized_pooling
- contrib.ndarray.requantize
- contrib.ndarray.round_ste
- contrib.ndarray.sign_ste
-
- contrib.symbol
- contrib.symbol.AdaptiveAvgPooling2D
- contrib.symbol.BilinearResize2D
- contrib.symbol.CTCLoss
- contrib.symbol.DeformableConvolution
- contrib.symbol.DeformablePSROIPooling
- contrib.symbol.ModulatedDeformableConvolution
- contrib.symbol.MultiBoxDetection
- contrib.symbol.MultiBoxPrior
- contrib.symbol.MultiBoxTarget
- contrib.symbol.MultiProposal
- contrib.symbol.PSROIPooling
- contrib.symbol.Proposal
- contrib.symbol.ROIAlign
- contrib.symbol.RROIAlign
- contrib.symbol.SparseEmbedding
- contrib.symbol.SyncBatchNorm
- contrib.symbol.allclose
- contrib.symbol.arange_like
- contrib.symbol.backward_gradientmultiplier
- contrib.symbol.backward_hawkesll
- contrib.symbol.backward_index_copy
- contrib.symbol.backward_quadratic
- contrib.symbol.bipartite_matching
- contrib.symbol.boolean_mask
- contrib.symbol.box_decode
- contrib.symbol.box_encode
- contrib.symbol.box_iou
- contrib.symbol.box_nms
- contrib.symbol.box_non_maximum_suppression
- contrib.symbol.calibrate_entropy
- contrib.symbol.count_sketch
- contrib.symbol.ctc_loss
- contrib.symbol.dequantize
- contrib.symbol.dgl_adjacency
- contrib.symbol.dgl_csr_neighbor_non_uniform_sample
- contrib.symbol.dgl_csr_neighbor_uniform_sample
- contrib.symbol.dgl_graph_compact
- contrib.symbol.dgl_subgraph
- contrib.symbol.div_sqrt_dim
- contrib.symbol.edge_id
- contrib.symbol.fft
- contrib.symbol.getnnz
- contrib.symbol.gradientmultiplier
- contrib.symbol.group_adagrad_update
- contrib.symbol.hawkesll
- contrib.symbol.ifft
- contrib.symbol.index_array
- contrib.symbol.index_copy
- contrib.symbol.interleaved_matmul_encdec_qk
- contrib.symbol.interleaved_matmul_encdec_valatt
- contrib.symbol.interleaved_matmul_selfatt_qk
- contrib.symbol.interleaved_matmul_selfatt_valatt
- contrib.symbol.quadratic
- contrib.symbol.quantize
- contrib.symbol.quantize_v2
- contrib.symbol.quantized_act
- contrib.symbol.quantized_batch_norm
- contrib.symbol.quantized_concat
- contrib.symbol.quantized_conv
- contrib.symbol.quantized_elemwise_add
- contrib.symbol.quantized_elemwise_mul
- contrib.symbol.quantized_embedding
- contrib.symbol.quantized_flatten
- contrib.symbol.quantized_fully_connected
- contrib.symbol.quantized_pooling
- contrib.symbol.requantize
- contrib.symbol.round_ste
- contrib.symbol.sign_ste
- contrib.text
- mxnet.attribute
- mxnet.base
- mxnet.callback
- mxnet.context
- mxnet.engine
- mxnet.executor
- mxnet.executor_manager
- mxnet.image
- mxnet.io
- mxnet.kvstore_server
- mxnet.libinfo
- mxnet.log
- mxnet.model
- mxnet.monitor
- mxnet.name
- mxnet.notebook
- mxnet.operator
- mxnet.profiler
- mxnet.random
- mxnet.recordio
- mxnet.registry
- mxnet.rtc
- mxnet.runtime
- mxnet.test_utils
- mxnet.torch
- mxnet.util
- mxnet.visualization
mxnet / mxnet.io
mxnet.io¶
Data iterators for common data formats and utility functions.
Functions
|
b”Returns the CSV file iterator.nnIn this function, the data_shape parameter is used to set the shape of each line of the input data.nIf a row in an input file is 1,2,3,4,5,6` and data_shape is (3,2), that rownwill be reshaped, yielding the array [[1,2],[3,4],[5,6]] of shape (3,2).nnBy default, the CSVIter has round_batch parameter set to |
|
b’Create iterator for image detection dataset packed in recordio.’ |
|
b”Iterating on image RecordIO filesnn.. note:: |
|
b’Iterates on image RecordIO filesnnReads batches of images from .rec RecordIO files. One can use |
|
b’Iterating on image RecordIO filesnn.. note::nn |
|
b”Iterating on image RecordIO filesnn.. note:: ImageRecordUInt8Iter is deprecated. Use ImageRecordIter(dtype=’uint8’) instead.nnThis iterator is identical to |
|
b’Iterating on image RecordIO filesnn.. note::nn |
|
b”Returns the LibSVM iterator which returns data with csrnstorage type. This iterator is experimental and should be used with care.nnThe input data is stored in a format similar to LibSVM file format, except that the indicesnare expected to be zero-based instead of one-based, and the column indices for each row arenexpected to be sorted in ascending order. Details of the LibSVM format are availablen`here. <https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/>`_nnnThe data_shape parameter is used to set the shape of each line of the data.nThe dimension of both data_shape and label_shape are expected to be 1.nnThe data_libsvm parameter is used to set the path input LibSVM file.nWhen it is set to a directory, all the files in the directory will be read.nnWhen label_libsvm is set to |
|
b’Iterating on the MNIST dataset.nnOne can download the dataset from http://yann.lecun.com/exdb/mnist/nnnnDefined in src/io/iter_mnist.cc:L265’ |
Classes
|
A data batch. |
DataDesc is used to store name, shape, type and layout information of the data or the label. |
|
|
The base class for an MXNet data iterator. |
|
A python wrapper a C++ data iterator. |
|
Returns an iterator for |
|
Performs pre-fetch for other data iterators. |
|
Resize a data iterator to a given number of batches. |
-
mxnet.io.
CSVIter
(*args, **kwargs)¶ b”Returns the CSV file iterator.nnIn this function, the data_shape parameter is used to set the shape of each line of the input data.nIf a row in an input file is 1,2,3,4,5,6` and data_shape is (3,2), that rownwill be reshaped, yielding the array [[1,2],[3,4],[5,6]] of shape (3,2).nnBy default, the CSVIter has round_batch parameter set to
True
. So, if batch_sizenis 3 and there are 4 total rows in CSV file, 2 more examplesnare consumed at the first round. If reset function is called after first round,nthe call is ignored and remaining examples are returned in the second round.nnIf one wants all the instances in the second round after calling reset, make surento set round_batch to False.nnIfdata_csv = 'data/'
is set, then all the files in this directory will be read.nn``reset()`` is expected to be called only after a complete pass of data.nnBy default, the CSVIter parses all entries in the data file as float32 data type,nif dtype argument is set to be ‘int32’ or ‘int64’ then CSVIter will parse all entries in the filenas int32 or int64 data type accordingly.nnExamples::nn // Contents of CSV filedata/data.csv
.n 1,2,3n 2,3,4n 3,4,5n 4,5,6nn // Creates a CSVIter with batch_size`=2 and default `round_batch`=True.n CSVIter = mx.io.CSVIter(data_csv = ‘data/data.csv’, data_shape = (3,),n batch_size = 2)nn // Two batches read from the above iterator are as follows:n [[ 1. 2. 3.]n [ 2. 3. 4.]]n [[ 3. 4. 5.]n [ 4. 5. 6.]]nn // Creates a `CSVIter with default round_batch set to True.n CSVIter = mx.io.CSVIter(data_csv = ‘data/data.csv’, data_shape = (3,),n batch_size = 3)nn // Two batches read from the above iterator in the first pass are as follows:n [[1. 2. 3.]n [2. 3. 4.]n [3. 4. 5.]]nn [[4. 5. 6.]n [1. 2. 3.]n [2. 3. 4.]]nn // Now, reset method is called.n CSVIter.reset()nn // Batch read from the above iterator in the second pass is as follows:n [[ 3. 4. 5.]n [ 4. 5. 6.]n [ 1. 2. 3.]]nn // Creates a CSVIter with round_batch`=False.n CSVIter = mx.io.CSVIter(data_csv = ‘data/data.csv’, data_shape = (3,),n batch_size = 3, round_batch=False)nn // Contents of two batches read from the above iterator in both passes, after callingn // `reset method before second pass, is as follows:n [[1. 2. 3.]n [2. 3. 4.]n [3. 4. 5.]]nn [[4. 5. 6.]n [2. 3. 4.]n [3. 4. 5.]]nn // Creates a ‘CSVIter’ with dtype`=’int32’n CSVIter = mx.io.CSVIter(data_csv = ‘data/data.csv’, data_shape = (3,),n batch_size = 3, round_batch=False, dtype=’int32’)nn // Contents of two batches read from the above iterator in both passes, after callingn // `reset method before second pass, is as follows:n [[1 2 3]n [2 3 4]n [3 4 5]]nn [[4 5 6]n [2 3 4]n [3 4 5]]nnnnDefined in src/io/iter_csv.cc:L308”- Parameters
data_csv (string, required) – The input CSV file or a directory path.
data_shape (Shape(tuple), required) – The shape of one example.
label_csv (string, optional, default='NULL') – The input CSV file or a directory path. If NULL, all labels will be returned as 0.
label_shape (Shape(tuple), optional, default=[1]) – The shape of one label.
batch_size (int (non-negative), required) – Batch size.
round_batch (boolean, optional, default=1) – Whether to use round robin to handle overflow batch or not.
prefetch_buffer (long (non-negative), optional, default=4) – Maximum number of batches to prefetch.
ctx ({'cpu', 'gpu'},optional, default='gpu') – Context data loader optimized for.
dtype ({None, 'bfloat16', 'float16', 'float32', 'float64', 'int32', 'int64', 'int8', 'uint8'},optional, default='None') – Output data type.
None
means no change.
- Returns
The result iterator.
- Return type
-
class
mxnet.io.
DataBatch
(data, label=None, pad=None, index=None, bucket_key=None, provide_data=None, provide_label=None)[source]¶ Bases:
object
A data batch.
MXNet’s data iterator returns a batch of data for each next call. This data contains batch_size number of examples.
If the input data consists of images, then shape of these images depend on the layout attribute of DataDesc object in provide_data parameter.
If layout is set to ‘NCHW’ then, images should be stored in a 4-D matrix of shape
(batch_size, num_channel, height, width)
. If layout is set to ‘NHWC’ then, images should be stored in a 4-D matrix of shape(batch_size, height, width, num_channel)
. The channels are often in RGB order.- Parameters
data (list of NDArray, each array containing batch_size examples.) – A list of input data.
label (list of NDArray, each array often containing a 1-dimensional array. optional) – A list of input labels.
pad (int, optional) – The number of examples padded at the end of a batch. It is used when the total number of examples read is not divisible by the batch_size. These extra padded examples are ignored in prediction.
index (numpy.array, optional) – The example indices in this batch.
bucket_key (int, optional) – The bucket key, used for bucketing module.
provide_data (list of DataDesc, optional) – A list of DataDesc objects. DataDesc is used to store name, shape, type and layout information of the data. The i-th element describes the name and shape of
data[i]
.provide_label (list of DataDesc, optional) – A list of DataDesc objects. DataDesc is used to store name, shape, type and layout information of the label. The i-th element describes the name and shape of
label[i]
.
-
class
mxnet.io.
DataDesc
[source]¶ Bases:
mxnet.io.io.DataDesc
DataDesc is used to store name, shape, type and layout information of the data or the label.
The layout describes how the axes in shape should be interpreted, for example for image data setting layout=NCHW indicates that the first axis is number of examples in the batch(N), C is number of channels, H is the height and W is the width of the image.
For sequential data, by default layout is set to
NTC
, where N is number of examples in the batch, T the temporal axis representing time and C is the number of channels.- Parameters
cls (DataDesc) – The class.
name (str) – Data name.
shape (tuple of int) – Data shape.
dtype (np.dtype, optional) – Data type.
layout (str, optional) – Data layout.
Methods
get_batch_axis
(layout)Get the dimension that corresponds to the batch size.
get_list
(shapes, types)Get DataDesc list from attribute lists.
-
static
get_batch_axis
(layout)[source]¶ Get the dimension that corresponds to the batch size.
When data parallelism is used, the data will be automatically split and concatenated along the batch-size dimension. Axis can be -1, which means the whole array will be copied for each data-parallelism device.
- Parameters
layout (str) – layout string. For example, “NCHW”.
- Returns
An axis indicating the batch_size dimension.
- Return type
int
-
class
mxnet.io.
DataIter
(batch_size=0)[source]¶ Bases:
object
The base class for an MXNet data iterator.
All I/O in MXNet is handled by specializations of this class. Data iterators in MXNet are similar to standard-iterators in Python. On each call to next they return a DataBatch which represents the next batch of data. When there is no more data to return, it raises a StopIteration exception.
- Parameters
batch_size (int, optional) – The batch size, namely the number of items in the batch.
Methods
getdata
()Get data of current batch.
getindex
()Get index of the current batch.
getlabel
()Get label of the current batch.
getpad
()Get the number of padding examples in the current batch.
Move to the next batch.
next
()Get next data batch from iterator.
reset
()Reset the iterator to the begin of the data.
See also
NDArrayIter
Data-iterator for MXNet NDArray or numpy-ndarray objects.
CSVIter
Data-iterator for csv data.
LibSVMIter
Data-iterator for libsvm data.
ImageIter
Data-iterator for images.
-
getdata
()[source]¶ Get data of current batch.
- Returns
The data of the current batch.
- Return type
list of NDArray
-
getindex
()[source]¶ Get index of the current batch.
- Returns
index – The indices of examples in the current batch.
- Return type
numpy.array
-
getlabel
()[source]¶ Get label of the current batch.
- Returns
The label of the current batch.
- Return type
list of NDArray
-
getpad
()[source]¶ Get the number of padding examples in the current batch.
- Returns
Number of padding examples in the current batch.
- Return type
int
-
iter_next
()[source]¶ Move to the next batch.
- Returns
Whether the move is successful.
- Return type
boolean
-
mxnet.io.
ImageDetRecordIter
(*args, **kwargs)¶ b’Create iterator for image detection dataset packed in recordio.’
- Parameters
path_imglist (string, optional, default='') – Dataset Param: Path to image list.
path_imgrec (string, optional, default='./data/imgrec.rec') – Dataset Param: Path to image record file.
aug_seq (string, optional, default='det_aug_default') – Augmentation Param: the augmenter names to represent sequence of augmenters to be applied, seperated by comma. Additional keyword parameters will be seen by these augmenters. Make sure you don’t use normal augmenters for detection tasks.
label_width (int, optional, default='-1') – Dataset Param: How many labels for an image, -1 for variable label size.
data_shape (Shape(tuple), required) – Dataset Param: Shape of each instance generated by the DataIter.
preprocess_threads (int, optional, default='4') – Backend Param: Number of thread to do preprocessing.
verbose (boolean, optional, default=1) – Auxiliary Param: Whether to output parser information.
num_parts (int, optional, default='1') – partition the data into multiple parts
part_index (int, optional, default='0') – the index of the part will read
shuffle_chunk_size (long (non-negative), optional, default=0) – the size(MB) of the shuffle chunk, used with shuffle=True, it can enable global shuffling
shuffle_chunk_seed (int, optional, default='0') – the seed for chunk shuffling
label_pad_width (int, optional, default='0') – pad output label width if set larger than 0, -1 for auto estimate
label_pad_value (float, optional, default=-1) – label padding value if enabled
shuffle (boolean, optional, default=0) – Augmentation Param: Whether to shuffle data.
seed (int, optional, default='0') – Augmentation Param: Random Seed.
batch_size (int (non-negative), required) – Batch size.
round_batch (boolean, optional, default=1) – Whether to use round robin to handle overflow batch or not.
prefetch_buffer (long (non-negative), optional, default=4) – Maximum number of batches to prefetch.
ctx ({'cpu', 'gpu'},optional, default='gpu') – Context data loader optimized for.
dtype ({None, 'bfloat16', 'float16', 'float32', 'float64', 'int32', 'int64', 'int8', 'uint8'},optional, default='None') – Output data type.
None
means no change.resize (int, optional, default='-1') – Augmentation Param: scale shorter edge to size before applying other augmentations, -1 to disable.
rand_crop_prob (float, optional, default=0) – Augmentation Param: Probability of random cropping, <= 0 to disable
min_crop_scales (tuple of <float>, optional, default=[0]) – Augmentation Param: Min crop scales.
max_crop_scales (tuple of <float>, optional, default=[1]) – Augmentation Param: Max crop scales.
min_crop_aspect_ratios (tuple of <float>, optional, default=[1]) – Augmentation Param: Min crop aspect ratios.
max_crop_aspect_ratios (tuple of <float>, optional, default=[1]) – Augmentation Param: Max crop aspect ratios.
min_crop_overlaps (tuple of <float>, optional, default=[0]) – Augmentation Param: Minimum crop IOU between crop_box and ground-truths.
max_crop_overlaps (tuple of <float>, optional, default=[1]) – Augmentation Param: Maximum crop IOU between crop_box and ground-truth.
min_crop_sample_coverages (tuple of <float>, optional, default=[0]) – Augmentation Param: Minimum ratio of intersect/crop_area between crop box and ground-truths.
max_crop_sample_coverages (tuple of <float>, optional, default=[1]) – Augmentation Param: Maximum ratio of intersect/crop_area between crop box and ground-truths.
min_crop_object_coverages (tuple of <float>, optional, default=[0]) – Augmentation Param: Minimum ratio of intersect/gt_area between crop box and ground-truths.
max_crop_object_coverages (tuple of <float>, optional, default=[1]) – Augmentation Param: Maximum ratio of intersect/gt_area between crop box and ground-truths.
num_crop_sampler (int, optional, default='1') – Augmentation Param: Number of crop samplers.
crop_emit_mode ({'center', 'overlap'},optional, default='center') – Augmentation Param: Emition mode for invalid ground-truths after crop. center: emit if centroid of object is out of crop region; overlap: emit if overlap is less than emit_overlap_thresh.
emit_overlap_thresh (float, optional, default=0.300000012) – Augmentation Param: Emit overlap thresh for emit mode overlap only.
max_crop_trials (Shape(tuple), optional, default=[25]) – Augmentation Param: Skip cropping if fail crop trail count exceeds this number.
rand_pad_prob (float, optional, default=0) – Augmentation Param: Probability for random padding.
max_pad_scale (float, optional, default=1) – Augmentation Param: Maximum padding scale.
max_random_hue (int, optional, default='0') – Augmentation Param: Maximum random value of H channel in HSL color space.
random_hue_prob (float, optional, default=0) – Augmentation Param: Probability to apply random hue.
max_random_saturation (int, optional, default='0') – Augmentation Param: Maximum random value of S channel in HSL color space.
random_saturation_prob (float, optional, default=0) – Augmentation Param: Probability to apply random saturation.
max_random_illumination (int, optional, default='0') – Augmentation Param: Maximum random value of L channel in HSL color space.
random_illumination_prob (float, optional, default=0) – Augmentation Param: Probability to apply random illumination.
max_random_contrast (float, optional, default=0) – Augmentation Param: Maximum random value of delta contrast.
random_contrast_prob (float, optional, default=0) – Augmentation Param: Probability to apply random contrast.
rand_mirror_prob (float, optional, default=0) – Augmentation Param: Probability to apply horizontal flip aka. mirror.
fill_value (int, optional, default='127') – Augmentation Param: Filled color value while padding.
inter_method (int, optional, default='1') – Augmentation Param: 0-NN 1-bilinear 2-cubic 3-area 4-lanczos4 9-auto 10-rand.
resize_mode ({'fit', 'force', 'shrink'},optional, default='force') – Augmentation Param: How image data fit in data_shape. force: force reshape to data_shape regardless of aspect ratio; shrink: ensure each side fit in data_shape, preserve aspect ratio; fit: fit image to data_shape, preserve ratio, will upscale if applicable.
mean_img (string, optional, default='') – Augmentation Param: Mean Image to be subtracted.
mean_r (float, optional, default=0) – Augmentation Param: Mean value on R channel.
mean_g (float, optional, default=0) – Augmentation Param: Mean value on G channel.
mean_b (float, optional, default=0) – Augmentation Param: Mean value on B channel.
mean_a (float, optional, default=0) – Augmentation Param: Mean value on Alpha channel.
std_r (float, optional, default=0) – Augmentation Param: Standard deviation on R channel.
std_g (float, optional, default=0) – Augmentation Param: Standard deviation on G channel.
std_b (float, optional, default=0) – Augmentation Param: Standard deviation on B channel.
std_a (float, optional, default=0) – Augmentation Param: Standard deviation on Alpha channel.
scale (float, optional, default=1) – Augmentation Param: Scale in color space.
- Returns
The result iterator.
- Return type
-
mxnet.io.
ImageRecordInt8Iter
(*args, **kwargs)¶ b”Iterating on image RecordIO filesnn.. note::
ImageRecordInt8Iter
is deprecated. Use ImageRecordIter(dtype=’int8’) instead.nnThis iterator is identical toImageRecordIter
except for usingint8
asnthe data type instead offloat
.nnnnDefined in src/io/iter_image_recordio_2.cc:L941”- Parameters
path_imglist (string, optional, default='') – Path to the image list (.lst) file. Generally created with tools/im2rec.py. Format (Tab separated): <index of record> <one or more labels> <relative path from root folder>.
path_imgrec (string, optional, default='') – Path to the image RecordIO (.rec) file or a directory path. Created with tools/im2rec.py.
path_imgidx (string, optional, default='') – Path to the image RecordIO index (.idx) file. Created with tools/im2rec.py.
aug_seq (string, optional, default='aug_default') – The augmenter names to represent sequence of augmenters to be applied, seperated by comma. Additional keyword parameters will be seen by these augmenters.
label_width (int, optional, default='1') – The number of labels per image.
data_shape (Shape(tuple), required) – The shape of one output image in (channels, height, width) format.
preprocess_threads (int, optional, default='4') – The number of threads to do preprocessing.
verbose (boolean, optional, default=1) – If or not output verbose information.
num_parts (int, optional, default='1') – Virtually partition the data into these many parts.
part_index (int, optional, default='0') – The i-th virtual partition to be read.
device_id (int, optional, default='0') – The device id used to create context for internal NDArray. Setting device_id to -1 will create Context::CPU(0). Setting device_id to valid positive device id will create Context::CPUPinned(device_id). Default is 0.
shuffle_chunk_size (long (non-negative), optional, default=0) – The data shuffle buffer size in MB. Only valid if shuffle is true.
shuffle_chunk_seed (int, optional, default='0') – The random seed for shuffling
seed_aug (int or None, optional, default='None') – Random seed for augmentations.
shuffle (boolean, optional, default=0) – Whether to shuffle data randomly or not.
seed (int, optional, default='0') – The random seed.
batch_size (int (non-negative), required) – Batch size.
round_batch (boolean, optional, default=1) – Whether to use round robin to handle overflow batch or not.
prefetch_buffer (long (non-negative), optional, default=4) – Maximum number of batches to prefetch.
ctx ({'cpu', 'gpu'},optional, default='gpu') – Context data loader optimized for.
dtype ({None, 'bfloat16', 'float16', 'float32', 'float64', 'int32', 'int64', 'int8', 'uint8'},optional, default='None') – Output data type.
None
means no change.resize (int, optional, default='-1') – Down scale the shorter edge to a new size before applying other augmentations.
rand_crop (boolean, optional, default=0) – If or not randomly crop the image
random_resized_crop (boolean, optional, default=0) – If or not perform random resized cropping on the image, as a standard preprocessing for resnet training on ImageNet data.
max_rotate_angle (int, optional, default='0') – Rotate by a random degree in
[-v, v]
max_aspect_ratio (float, optional, default=0) – Change the aspect (namely width/height) to a random value. If min_aspect_ratio is None then the aspect ratio ins sampled from [1 - max_aspect_ratio, 1 + max_aspect_ratio], else it is in
[min_aspect_ratio, max_aspect_ratio]
min_aspect_ratio (float or None, optional, default=None) – Change the aspect (namely width/height) to a random value in
[min_aspect_ratio, max_aspect_ratio]
max_shear_ratio (float, optional, default=0) – Apply a shear transformation (namely
(x,y)->(x+my,y)
) withm
randomly chose from[-max_shear_ratio, max_shear_ratio]
max_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.min_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.max_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]
. Ignored ifrandom_resized_crop
is True.min_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]``Ignored if ``random_resized_crop
is True.max_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.min_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.max_img_size (float, optional, default=1e+10) – Set the maximal width and height after all resize and rotate argumentation are applied
min_img_size (float, optional, default=0) – Set the minimal width and height after all resize and rotate argumentation are applied
brightness (float, optional, default=0) – Add a random value in
[-brightness, brightness]
to the brightness of image.contrast (float, optional, default=0) – Add a random value in
[-contrast, contrast]
to the contrast of image.saturation (float, optional, default=0) – Add a random value in
[-saturation, saturation]
to the saturation of image.pca_noise (float, optional, default=0) – Add PCA based noise to the image.
random_h (int, optional, default='0') – Add a random value in
[-random_h, random_h]
to the H channel in HSL color space.random_s (int, optional, default='0') – Add a random value in
[-random_s, random_s]
to the S channel in HSL color space.random_l (int, optional, default='0') – Add a random value in
[-random_l, random_l]
to the L channel in HSL color space.rotate (int, optional, default='-1') – Rotate by an angle. If set, it overwrites the
max_rotate_angle
option.fill_value (int, optional, default='255') – Set the padding pixels value to
fill_value
.inter_method (int, optional, default='1') – The interpolation method: 0-NN 1-bilinear 2-cubic 3-area 4-lanczos4 9-auto 10-rand.
pad (int, optional, default='0') – Change size from
[width, height]
into[pad + width + pad, pad + height + pad]
by padding pixes
- Returns
The result iterator.
- Return type
-
mxnet.io.
ImageRecordIter
(*args, **kwargs)¶ b’Iterates on image RecordIO filesnnReads batches of images from .rec RecordIO files. One can use
im2rec.py
tooln(in tools/) to pack raw image files into RecordIO files. This iterator is lessnflexible to customization but is fast and has lot of language bindings. Toniterate over raw images directly useImageIter
instead (in Python).nnExample::nn data_iter = mx.io.ImageRecordIter(n path_imgrec=”./sample.rec”, # The target record file.n data_shape=(3, 227, 227), # Output data shape; 227x227 region will be cropped from the original image.n batch_size=4, # Number of items per batch.n resize=256 # Resize the shorter edge to 256 before cropping.n # You can specify more augmentation options. Use help(mx.io.ImageRecordIter) to see all the options.n )n # You can now use the data_iter to access batches of images.n batch = data_iter.next() # first batch.n images = batch.data[0] # This will contain 4 (=batch_size) images each of 3x227x227.n # process the imagesn …n data_iter.reset() # To restart the iterator from the beginning.nnnnDefined in src/io/iter_image_recordio_2.cc:L904’- Parameters
path_imglist (string, optional, default='') – Path to the image list (.lst) file. Generally created with tools/im2rec.py. Format (Tab separated): <index of record> <one or more labels> <relative path from root folder>.
path_imgrec (string, optional, default='') – Path to the image RecordIO (.rec) file or a directory path. Created with tools/im2rec.py.
path_imgidx (string, optional, default='') – Path to the image RecordIO index (.idx) file. Created with tools/im2rec.py.
aug_seq (string, optional, default='aug_default') – The augmenter names to represent sequence of augmenters to be applied, seperated by comma. Additional keyword parameters will be seen by these augmenters.
label_width (int, optional, default='1') – The number of labels per image.
data_shape (Shape(tuple), required) – The shape of one output image in (channels, height, width) format.
preprocess_threads (int, optional, default='4') – The number of threads to do preprocessing.
verbose (boolean, optional, default=1) – If or not output verbose information.
num_parts (int, optional, default='1') – Virtually partition the data into these many parts.
part_index (int, optional, default='0') – The i-th virtual partition to be read.
device_id (int, optional, default='0') – The device id used to create context for internal NDArray. Setting device_id to -1 will create Context::CPU(0). Setting device_id to valid positive device id will create Context::CPUPinned(device_id). Default is 0.
shuffle_chunk_size (long (non-negative), optional, default=0) – The data shuffle buffer size in MB. Only valid if shuffle is true.
shuffle_chunk_seed (int, optional, default='0') – The random seed for shuffling
seed_aug (int or None, optional, default='None') – Random seed for augmentations.
shuffle (boolean, optional, default=0) – Whether to shuffle data randomly or not.
seed (int, optional, default='0') – The random seed.
batch_size (int (non-negative), required) – Batch size.
round_batch (boolean, optional, default=1) – Whether to use round robin to handle overflow batch or not.
prefetch_buffer (long (non-negative), optional, default=4) – Maximum number of batches to prefetch.
ctx ({'cpu', 'gpu'},optional, default='gpu') – Context data loader optimized for.
dtype ({None, 'bfloat16', 'float16', 'float32', 'float64', 'int32', 'int64', 'int8', 'uint8'},optional, default='None') – Output data type.
None
means no change.resize (int, optional, default='-1') – Down scale the shorter edge to a new size before applying other augmentations.
rand_crop (boolean, optional, default=0) – If or not randomly crop the image
random_resized_crop (boolean, optional, default=0) – If or not perform random resized cropping on the image, as a standard preprocessing for resnet training on ImageNet data.
max_rotate_angle (int, optional, default='0') – Rotate by a random degree in
[-v, v]
max_aspect_ratio (float, optional, default=0) – Change the aspect (namely width/height) to a random value. If min_aspect_ratio is None then the aspect ratio ins sampled from [1 - max_aspect_ratio, 1 + max_aspect_ratio], else it is in
[min_aspect_ratio, max_aspect_ratio]
min_aspect_ratio (float or None, optional, default=None) – Change the aspect (namely width/height) to a random value in
[min_aspect_ratio, max_aspect_ratio]
max_shear_ratio (float, optional, default=0) – Apply a shear transformation (namely
(x,y)->(x+my,y)
) withm
randomly chose from[-max_shear_ratio, max_shear_ratio]
max_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.min_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.max_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]
. Ignored ifrandom_resized_crop
is True.min_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]``Ignored if ``random_resized_crop
is True.max_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.min_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.max_img_size (float, optional, default=1e+10) – Set the maximal width and height after all resize and rotate argumentation are applied
min_img_size (float, optional, default=0) – Set the minimal width and height after all resize and rotate argumentation are applied
brightness (float, optional, default=0) – Add a random value in
[-brightness, brightness]
to the brightness of image.contrast (float, optional, default=0) – Add a random value in
[-contrast, contrast]
to the contrast of image.saturation (float, optional, default=0) – Add a random value in
[-saturation, saturation]
to the saturation of image.pca_noise (float, optional, default=0) – Add PCA based noise to the image.
random_h (int, optional, default='0') – Add a random value in
[-random_h, random_h]
to the H channel in HSL color space.random_s (int, optional, default='0') – Add a random value in
[-random_s, random_s]
to the S channel in HSL color space.random_l (int, optional, default='0') – Add a random value in
[-random_l, random_l]
to the L channel in HSL color space.rotate (int, optional, default='-1') – Rotate by an angle. If set, it overwrites the
max_rotate_angle
option.fill_value (int, optional, default='255') – Set the padding pixels value to
fill_value
.inter_method (int, optional, default='1') – The interpolation method: 0-NN 1-bilinear 2-cubic 3-area 4-lanczos4 9-auto 10-rand.
pad (int, optional, default='0') – Change size from
[width, height]
into[pad + width + pad, pad + height + pad]
by padding pixesmirror (boolean, optional, default=0) – Whether to mirror the image or not. If true, images are flipped along the horizontal axis.
rand_mirror (boolean, optional, default=0) – Whether to randomly mirror images or not. If true, 50% of the images will be randomly mirrored (flipped along the horizontal axis)
mean_img (string, optional, default='') – Filename of the mean image.
mean_r (float, optional, default=0) – The mean value to be subtracted on the R channel
mean_g (float, optional, default=0) – The mean value to be subtracted on the G channel
mean_b (float, optional, default=0) – The mean value to be subtracted on the B channel
mean_a (float, optional, default=0) – The mean value to be subtracted on the alpha channel
std_r (float, optional, default=1) – Augmentation Param: Standard deviation on R channel.
std_g (float, optional, default=1) – Augmentation Param: Standard deviation on G channel.
std_b (float, optional, default=1) – Augmentation Param: Standard deviation on B channel.
std_a (float, optional, default=1) – Augmentation Param: Standard deviation on Alpha channel.
scale (float, optional, default=1) – Multiply the image with a scale value.
max_random_contrast (float, optional, default=0) – Change the contrast with a value randomly chosen from
[-max_random_contrast, max_random_contrast]
max_random_illumination (float, optional, default=0) – Change the illumination with a value randomly chosen from
[-max_random_illumination, max_random_illumination]
- Returns
The result iterator.
- Return type
-
mxnet.io.
ImageRecordIter_v1
(*args, **kwargs)¶ b’Iterating on image RecordIO filesnn.. note::nn
ImageRecordIter_v1
is deprecated. UseImageRecordIter
instead.nnnRead images batches from RecordIO files with a rich of data augmentationnoptions.nnOne can usetools/im2rec.py
to pack individual image files into RecordIOnfiles.nnnnDefined in src/io/iter_image_recordio.cc:L352’- Parameters
path_imglist (string, optional, default='') – Path to the image list (.lst) file. Generally created with tools/im2rec.py. Format (Tab separated): <index of record> <one or more labels> <relative path from root folder>.
path_imgrec (string, optional, default='') – Path to the image RecordIO (.rec) file or a directory path. Created with tools/im2rec.py.
path_imgidx (string, optional, default='') – Path to the image RecordIO index (.idx) file. Created with tools/im2rec.py.
aug_seq (string, optional, default='aug_default') – The augmenter names to represent sequence of augmenters to be applied, seperated by comma. Additional keyword parameters will be seen by these augmenters.
label_width (int, optional, default='1') – The number of labels per image.
data_shape (Shape(tuple), required) – The shape of one output image in (channels, height, width) format.
preprocess_threads (int, optional, default='4') – The number of threads to do preprocessing.
verbose (boolean, optional, default=1) – If or not output verbose information.
num_parts (int, optional, default='1') – Virtually partition the data into these many parts.
part_index (int, optional, default='0') – The i-th virtual partition to be read.
device_id (int, optional, default='0') – The device id used to create context for internal NDArray. Setting device_id to -1 will create Context::CPU(0). Setting device_id to valid positive device id will create Context::CPUPinned(device_id). Default is 0.
shuffle_chunk_size (long (non-negative), optional, default=0) – The data shuffle buffer size in MB. Only valid if shuffle is true.
shuffle_chunk_seed (int, optional, default='0') – The random seed for shuffling
seed_aug (int or None, optional, default='None') – Random seed for augmentations.
shuffle (boolean, optional, default=0) – Whether to shuffle data randomly or not.
seed (int, optional, default='0') – The random seed.
batch_size (int (non-negative), required) – Batch size.
round_batch (boolean, optional, default=1) – Whether to use round robin to handle overflow batch or not.
prefetch_buffer (long (non-negative), optional, default=4) – Maximum number of batches to prefetch.
ctx ({'cpu', 'gpu'},optional, default='gpu') – Context data loader optimized for.
dtype ({None, 'bfloat16', 'float16', 'float32', 'float64', 'int32', 'int64', 'int8', 'uint8'},optional, default='None') – Output data type.
None
means no change.resize (int, optional, default='-1') – Down scale the shorter edge to a new size before applying other augmentations.
rand_crop (boolean, optional, default=0) – If or not randomly crop the image
random_resized_crop (boolean, optional, default=0) – If or not perform random resized cropping on the image, as a standard preprocessing for resnet training on ImageNet data.
max_rotate_angle (int, optional, default='0') – Rotate by a random degree in
[-v, v]
max_aspect_ratio (float, optional, default=0) – Change the aspect (namely width/height) to a random value. If min_aspect_ratio is None then the aspect ratio ins sampled from [1 - max_aspect_ratio, 1 + max_aspect_ratio], else it is in
[min_aspect_ratio, max_aspect_ratio]
min_aspect_ratio (float or None, optional, default=None) – Change the aspect (namely width/height) to a random value in
[min_aspect_ratio, max_aspect_ratio]
max_shear_ratio (float, optional, default=0) – Apply a shear transformation (namely
(x,y)->(x+my,y)
) withm
randomly chose from[-max_shear_ratio, max_shear_ratio]
max_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.min_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.max_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]
. Ignored ifrandom_resized_crop
is True.min_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]``Ignored if ``random_resized_crop
is True.max_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.min_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.max_img_size (float, optional, default=1e+10) – Set the maximal width and height after all resize and rotate argumentation are applied
min_img_size (float, optional, default=0) – Set the minimal width and height after all resize and rotate argumentation are applied
brightness (float, optional, default=0) – Add a random value in
[-brightness, brightness]
to the brightness of image.contrast (float, optional, default=0) – Add a random value in
[-contrast, contrast]
to the contrast of image.saturation (float, optional, default=0) – Add a random value in
[-saturation, saturation]
to the saturation of image.pca_noise (float, optional, default=0) – Add PCA based noise to the image.
random_h (int, optional, default='0') – Add a random value in
[-random_h, random_h]
to the H channel in HSL color space.random_s (int, optional, default='0') – Add a random value in
[-random_s, random_s]
to the S channel in HSL color space.random_l (int, optional, default='0') – Add a random value in
[-random_l, random_l]
to the L channel in HSL color space.rotate (int, optional, default='-1') – Rotate by an angle. If set, it overwrites the
max_rotate_angle
option.fill_value (int, optional, default='255') – Set the padding pixels value to
fill_value
.inter_method (int, optional, default='1') – The interpolation method: 0-NN 1-bilinear 2-cubic 3-area 4-lanczos4 9-auto 10-rand.
pad (int, optional, default='0') – Change size from
[width, height]
into[pad + width + pad, pad + height + pad]
by padding pixesmirror (boolean, optional, default=0) – Whether to mirror the image or not. If true, images are flipped along the horizontal axis.
rand_mirror (boolean, optional, default=0) – Whether to randomly mirror images or not. If true, 50% of the images will be randomly mirrored (flipped along the horizontal axis)
mean_img (string, optional, default='') – Filename of the mean image.
mean_r (float, optional, default=0) – The mean value to be subtracted on the R channel
mean_g (float, optional, default=0) – The mean value to be subtracted on the G channel
mean_b (float, optional, default=0) – The mean value to be subtracted on the B channel
mean_a (float, optional, default=0) – The mean value to be subtracted on the alpha channel
std_r (float, optional, default=1) – Augmentation Param: Standard deviation on R channel.
std_g (float, optional, default=1) – Augmentation Param: Standard deviation on G channel.
std_b (float, optional, default=1) – Augmentation Param: Standard deviation on B channel.
std_a (float, optional, default=1) – Augmentation Param: Standard deviation on Alpha channel.
scale (float, optional, default=1) – Multiply the image with a scale value.
max_random_contrast (float, optional, default=0) – Change the contrast with a value randomly chosen from
[-max_random_contrast, max_random_contrast]
max_random_illumination (float, optional, default=0) – Change the illumination with a value randomly chosen from
[-max_random_illumination, max_random_illumination]
- Returns
The result iterator.
- Return type
-
mxnet.io.
ImageRecordUInt8Iter
(*args, **kwargs)¶ b”Iterating on image RecordIO filesnn.. note:: ImageRecordUInt8Iter is deprecated. Use ImageRecordIter(dtype=’uint8’) instead.nnThis iterator is identical to
ImageRecordIter
except for usinguint8
asnthe data type instead offloat
.nnnnDefined in src/io/iter_image_recordio_2.cc:L923”- Parameters
path_imglist (string, optional, default='') – Path to the image list (.lst) file. Generally created with tools/im2rec.py. Format (Tab separated): <index of record> <one or more labels> <relative path from root folder>.
path_imgrec (string, optional, default='') – Path to the image RecordIO (.rec) file or a directory path. Created with tools/im2rec.py.
path_imgidx (string, optional, default='') – Path to the image RecordIO index (.idx) file. Created with tools/im2rec.py.
aug_seq (string, optional, default='aug_default') – The augmenter names to represent sequence of augmenters to be applied, seperated by comma. Additional keyword parameters will be seen by these augmenters.
label_width (int, optional, default='1') – The number of labels per image.
data_shape (Shape(tuple), required) – The shape of one output image in (channels, height, width) format.
preprocess_threads (int, optional, default='4') – The number of threads to do preprocessing.
verbose (boolean, optional, default=1) – If or not output verbose information.
num_parts (int, optional, default='1') – Virtually partition the data into these many parts.
part_index (int, optional, default='0') – The i-th virtual partition to be read.
device_id (int, optional, default='0') – The device id used to create context for internal NDArray. Setting device_id to -1 will create Context::CPU(0). Setting device_id to valid positive device id will create Context::CPUPinned(device_id). Default is 0.
shuffle_chunk_size (long (non-negative), optional, default=0) – The data shuffle buffer size in MB. Only valid if shuffle is true.
shuffle_chunk_seed (int, optional, default='0') – The random seed for shuffling
seed_aug (int or None, optional, default='None') – Random seed for augmentations.
shuffle (boolean, optional, default=0) – Whether to shuffle data randomly or not.
seed (int, optional, default='0') – The random seed.
batch_size (int (non-negative), required) – Batch size.
round_batch (boolean, optional, default=1) – Whether to use round robin to handle overflow batch or not.
prefetch_buffer (long (non-negative), optional, default=4) – Maximum number of batches to prefetch.
ctx ({'cpu', 'gpu'},optional, default='gpu') – Context data loader optimized for.
dtype ({None, 'bfloat16', 'float16', 'float32', 'float64', 'int32', 'int64', 'int8', 'uint8'},optional, default='None') – Output data type.
None
means no change.resize (int, optional, default='-1') – Down scale the shorter edge to a new size before applying other augmentations.
rand_crop (boolean, optional, default=0) – If or not randomly crop the image
random_resized_crop (boolean, optional, default=0) – If or not perform random resized cropping on the image, as a standard preprocessing for resnet training on ImageNet data.
max_rotate_angle (int, optional, default='0') – Rotate by a random degree in
[-v, v]
max_aspect_ratio (float, optional, default=0) – Change the aspect (namely width/height) to a random value. If min_aspect_ratio is None then the aspect ratio ins sampled from [1 - max_aspect_ratio, 1 + max_aspect_ratio], else it is in
[min_aspect_ratio, max_aspect_ratio]
min_aspect_ratio (float or None, optional, default=None) – Change the aspect (namely width/height) to a random value in
[min_aspect_ratio, max_aspect_ratio]
max_shear_ratio (float, optional, default=0) – Apply a shear transformation (namely
(x,y)->(x+my,y)
) withm
randomly chose from[-max_shear_ratio, max_shear_ratio]
max_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.min_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.max_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]
. Ignored ifrandom_resized_crop
is True.min_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]``Ignored if ``random_resized_crop
is True.max_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.min_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.max_img_size (float, optional, default=1e+10) – Set the maximal width and height after all resize and rotate argumentation are applied
min_img_size (float, optional, default=0) – Set the minimal width and height after all resize and rotate argumentation are applied
brightness (float, optional, default=0) – Add a random value in
[-brightness, brightness]
to the brightness of image.contrast (float, optional, default=0) – Add a random value in
[-contrast, contrast]
to the contrast of image.saturation (float, optional, default=0) – Add a random value in
[-saturation, saturation]
to the saturation of image.pca_noise (float, optional, default=0) – Add PCA based noise to the image.
random_h (int, optional, default='0') – Add a random value in
[-random_h, random_h]
to the H channel in HSL color space.random_s (int, optional, default='0') – Add a random value in
[-random_s, random_s]
to the S channel in HSL color space.random_l (int, optional, default='0') – Add a random value in
[-random_l, random_l]
to the L channel in HSL color space.rotate (int, optional, default='-1') – Rotate by an angle. If set, it overwrites the
max_rotate_angle
option.fill_value (int, optional, default='255') – Set the padding pixels value to
fill_value
.inter_method (int, optional, default='1') – The interpolation method: 0-NN 1-bilinear 2-cubic 3-area 4-lanczos4 9-auto 10-rand.
pad (int, optional, default='0') – Change size from
[width, height]
into[pad + width + pad, pad + height + pad]
by padding pixes
- Returns
The result iterator.
- Return type
-
mxnet.io.
ImageRecordUInt8Iter_v1
(*args, **kwargs)¶ b’Iterating on image RecordIO filesnn.. note::nn
ImageRecordUInt8Iter_v1
is deprecated. UseImageRecordUInt8Iter
instead.nnThis iterator is identical toImageRecordIter
except for usinguint8
asnthe data type instead offloat
.nnnnDefined in src/io/iter_image_recordio.cc:L377’- Parameters
path_imglist (string, optional, default='') – Path to the image list (.lst) file. Generally created with tools/im2rec.py. Format (Tab separated): <index of record> <one or more labels> <relative path from root folder>.
path_imgrec (string, optional, default='') – Path to the image RecordIO (.rec) file or a directory path. Created with tools/im2rec.py.
path_imgidx (string, optional, default='') – Path to the image RecordIO index (.idx) file. Created with tools/im2rec.py.
aug_seq (string, optional, default='aug_default') – The augmenter names to represent sequence of augmenters to be applied, seperated by comma. Additional keyword parameters will be seen by these augmenters.
label_width (int, optional, default='1') – The number of labels per image.
data_shape (Shape(tuple), required) – The shape of one output image in (channels, height, width) format.
preprocess_threads (int, optional, default='4') – The number of threads to do preprocessing.
verbose (boolean, optional, default=1) – If or not output verbose information.
num_parts (int, optional, default='1') – Virtually partition the data into these many parts.
part_index (int, optional, default='0') – The i-th virtual partition to be read.
device_id (int, optional, default='0') – The device id used to create context for internal NDArray. Setting device_id to -1 will create Context::CPU(0). Setting device_id to valid positive device id will create Context::CPUPinned(device_id). Default is 0.
shuffle_chunk_size (long (non-negative), optional, default=0) – The data shuffle buffer size in MB. Only valid if shuffle is true.
shuffle_chunk_seed (int, optional, default='0') – The random seed for shuffling
seed_aug (int or None, optional, default='None') – Random seed for augmentations.
shuffle (boolean, optional, default=0) – Whether to shuffle data randomly or not.
seed (int, optional, default='0') – The random seed.
batch_size (int (non-negative), required) – Batch size.
round_batch (boolean, optional, default=1) – Whether to use round robin to handle overflow batch or not.
prefetch_buffer (long (non-negative), optional, default=4) – Maximum number of batches to prefetch.
ctx ({'cpu', 'gpu'},optional, default='gpu') – Context data loader optimized for.
dtype ({None, 'bfloat16', 'float16', 'float32', 'float64', 'int32', 'int64', 'int8', 'uint8'},optional, default='None') – Output data type.
None
means no change.resize (int, optional, default='-1') – Down scale the shorter edge to a new size before applying other augmentations.
rand_crop (boolean, optional, default=0) – If or not randomly crop the image
random_resized_crop (boolean, optional, default=0) – If or not perform random resized cropping on the image, as a standard preprocessing for resnet training on ImageNet data.
max_rotate_angle (int, optional, default='0') – Rotate by a random degree in
[-v, v]
max_aspect_ratio (float, optional, default=0) – Change the aspect (namely width/height) to a random value. If min_aspect_ratio is None then the aspect ratio ins sampled from [1 - max_aspect_ratio, 1 + max_aspect_ratio], else it is in
[min_aspect_ratio, max_aspect_ratio]
min_aspect_ratio (float or None, optional, default=None) – Change the aspect (namely width/height) to a random value in
[min_aspect_ratio, max_aspect_ratio]
max_shear_ratio (float, optional, default=0) – Apply a shear transformation (namely
(x,y)->(x+my,y)
) withm
randomly chose from[-max_shear_ratio, max_shear_ratio]
max_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.min_crop_size (int, optional, default='-1') – Crop both width and height into a random size in
[min_crop_size, max_crop_size].``Ignored if ``random_resized_crop
is True.max_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]
. Ignored ifrandom_resized_crop
is True.min_random_scale (float, optional, default=1) – Resize into
[width*s, height*s]
withs
randomly chosen from[min_random_scale, max_random_scale]``Ignored if ``random_resized_crop
is True.max_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.min_random_area (float, optional, default=1) – Change the area (namely width * height) to a random value in
[min_random_area, max_random_area]
. Ignored ifrandom_resized_crop
is False.max_img_size (float, optional, default=1e+10) – Set the maximal width and height after all resize and rotate argumentation are applied
min_img_size (float, optional, default=0) – Set the minimal width and height after all resize and rotate argumentation are applied
brightness (float, optional, default=0) – Add a random value in
[-brightness, brightness]
to the brightness of image.contrast (float, optional, default=0) – Add a random value in
[-contrast, contrast]
to the contrast of image.saturation (float, optional, default=0) – Add a random value in
[-saturation, saturation]
to the saturation of image.pca_noise (float, optional, default=0) – Add PCA based noise to the image.
random_h (int, optional, default='0') – Add a random value in
[-random_h, random_h]
to the H channel in HSL color space.random_s (int, optional, default='0') – Add a random value in
[-random_s, random_s]
to the S channel in HSL color space.random_l (int, optional, default='0') – Add a random value in
[-random_l, random_l]
to the L channel in HSL color space.rotate (int, optional, default='-1') – Rotate by an angle. If set, it overwrites the
max_rotate_angle
option.fill_value (int, optional, default='255') – Set the padding pixels value to
fill_value
.inter_method (int, optional, default='1') – The interpolation method: 0-NN 1-bilinear 2-cubic 3-area 4-lanczos4 9-auto 10-rand.
pad (int, optional, default='0') – Change size from
[width, height]
into[pad + width + pad, pad + height + pad]
by padding pixes
- Returns
The result iterator.
- Return type
-
mxnet.io.
LibSVMIter
(*args, **kwargs)¶ b”Returns the LibSVM iterator which returns data with csrnstorage type. This iterator is experimental and should be used with care.nnThe input data is stored in a format similar to LibSVM file format, except that the indicesnare expected to be zero-based instead of one-based, and the column indices for each row arenexpected to be sorted in ascending order. Details of the LibSVM format are availablen`here. <https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/>`_nnnThe data_shape parameter is used to set the shape of each line of the data.nThe dimension of both data_shape and label_shape are expected to be 1.nnThe data_libsvm parameter is used to set the path input LibSVM file.nWhen it is set to a directory, all the files in the directory will be read.nnWhen label_libsvm is set to
NULL
, both data and label are read from the file specifiednby data_libsvm. In this case, the data is stored in csr storage type, while the label is a 1Dndense array.nnThe LibSVMIter only support round_batch parameter set toTrue
. Therefore, if batch_sizenis 3 and there are 4 total rows in libsvm file, 2 more examples are consumed at the first round.nnWhen num_parts and part_index are provided, the data is split into num_parts partitions,nand the iterator only reads the part_index-th partition. However, the partitions are notnguaranteed to be even.nn``reset()`` is expected to be called only after a complete pass of data.nnExample::nn # Contents of libsvm filedata.t
.n 1.0 0:0.5 2:1.2n -2.0n -3.0 0:0.6 1:2.4 2:1.2n 4 2:-1.2nn # Creates a LibSVMIter with batch_size`=3.n >>> data_iter = mx.io.LibSVMIter(data_libsvm = ‘data.t’, data_shape = (3,), batch_size = 3)n # The data of the first batch is stored in csr storage typen >>> batch = data_iter.next()n >>> csr = batch.data[0]n <CSRNDArray 3x3 @cpu(0)>n >>> csr.asnumpy()n [[ 0.5 0. 1.2 ]n [ 0. 0. 0. ]n [ 0.6 2.4 1.2]]n # The label of first batchn >>> label = batch.label[0]n >>> labeln [ 1. -2. -3.]n <NDArray 3 @cpu(0)>nn >>> second_batch = data_iter.next()n # The data of the second batchn >>> second_batch.data[0].asnumpy()n [[ 0. 0. -1.2 ]n [ 0.5 0. 1.2 ]n [ 0. 0. 0. ]]n # The label of the second batchn >>> second_batch.label[0].asnumpy()n [ 4. 1. -2.]nn >>> data_iter.reset()n # To restart the iterator for the second pass of the datannWhen `label_libsvm is set to the path to another LibSVM file,ndata is read from data_libsvm and label from label_libsvm.nIn this case, both data and label are stored in the csr format.nIf the label column in the data_libsvm file is ignored.nnExample::nn # Contents of libsvm filelabel.t
n 1.0n -2.0 0:0.125n -3.0 2:1.2n 4 1:1.0 2:-1.2nn # Creates a LibSVMIter with specified label filen >>> data_iter = mx.io.LibSVMIter(data_libsvm = ‘data.t’, data_shape = (3,),n label_libsvm = ‘label.t’, label_shape = (3,), batch_size = 3)nn # Both data and label are in csr storage typen >>> batch = data_iter.next()n >>> csr_data = batch.data[0]n <CSRNDArray 3x3 @cpu(0)>n >>> csr_data.asnumpy()n [[ 0.5 0. 1.2 ]n [ 0. 0. 0. ]n [ 0.6 2.4 1.2 ]]n >>> csr_label = batch.label[0]n <CSRNDArray 3x3 @cpu(0)>n >>> csr_label.asnumpy()n [[ 0. 0. 0. ]n [ 0.125 0. 0. ]n [ 0. 0. 1.2 ]]nnnnDefined in src/io/iter_libsvm.cc:L298”- Parameters
data_libsvm (string, required) – The input zero-base indexed LibSVM data file or a directory path.
data_shape (Shape(tuple), required) – The shape of one example.
label_libsvm (string, optional, default='NULL') – The input LibSVM label file or a directory path. If NULL, all labels will be read from
data_libsvm
.label_shape (Shape(tuple), optional, default=[1]) – The shape of one label.
num_parts (int, optional, default='1') – partition the data into multiple parts
part_index (int, optional, default='0') – the index of the part will read
batch_size (int (non-negative), required) – Batch size.
round_batch (boolean, optional, default=1) – Whether to use round robin to handle overflow batch or not.
prefetch_buffer (long (non-negative), optional, default=4) – Maximum number of batches to prefetch.
ctx ({'cpu', 'gpu'},optional, default='gpu') – Context data loader optimized for.
dtype ({None, 'bfloat16', 'float16', 'float32', 'float64', 'int32', 'int64', 'int8', 'uint8'},optional, default='None') – Output data type.
None
means no change.
- Returns
The result iterator.
- Return type
-
mxnet.io.
MNISTIter
(*args, **kwargs)¶ b’Iterating on the MNIST dataset.nnOne can download the dataset from http://yann.lecun.com/exdb/mnist/nnnnDefined in src/io/iter_mnist.cc:L265’
- Parameters
image (string, optional, default='./train-images-idx3-ubyte') – Dataset Param: Mnist image path.
label (string, optional, default='./train-labels-idx1-ubyte') – Dataset Param: Mnist label path.
batch_size (int, optional, default='128') – Batch Param: Batch Size.
shuffle (boolean, optional, default=1) – Augmentation Param: Whether to shuffle data.
flat (boolean, optional, default=0) – Augmentation Param: Whether to flat the data into 1D.
seed (int, optional, default='0') – Augmentation Param: Random Seed.
silent (boolean, optional, default=0) – Auxiliary Param: Whether to print out data info.
num_parts (int, optional, default='1') – partition the data into multiple parts
part_index (int, optional, default='0') – the index of the part will read
prefetch_buffer (long (non-negative), optional, default=4) – Maximum number of batches to prefetch.
ctx ({'cpu', 'gpu'},optional, default='gpu') – Context data loader optimized for.
dtype ({None, 'bfloat16', 'float16', 'float32', 'float64', 'int32', 'int64', 'int8', 'uint8'},optional, default='None') – Output data type.
None
means no change.
- Returns
The result iterator.
- Return type
-
class
mxnet.io.
MXDataIter
(handle, data_name='data', label_name='softmax_label', **_)[source]¶ Bases:
mxnet.io.io.DataIter
A python wrapper a C++ data iterator.
This iterator is the Python wrapper to all native C++ data iterators, such as CSVIter, ImageRecordIter, MNISTIter, etc. When initializing CSVIter for example, you will get an MXDataIter instance to use in your Python code. Calls to next, reset, etc will be delegated to the underlying C++ data iterators.
Usually you don’t need to interact with MXDataIter directly unless you are implementing your own data iterators in C++. To do that, please refer to examples under the src/io folder.
- Parameters
handle (DataIterHandle, required) – The handle to the underlying C++ Data Iterator.
data_name (str, optional) – Data name. Default to “data”.
label_name (str, optional) – Label name. Default to “softmax_label”.
Methods
getdata
()Get data of current batch.
getindex
()Get index of the current batch.
getlabel
()Get label of the current batch.
getpad
()Get the number of padding examples in the current batch.
Move to the next batch.
next
()Get next data batch from iterator.
reset
()Reset the iterator to the begin of the data.
See also
src
,e.g.
,None
-
getdata
()[source]¶ Get data of current batch.
- Returns
The data of the current batch.
- Return type
list of NDArray
-
getindex
()[source]¶ Get index of the current batch.
- Returns
index – The indices of examples in the current batch.
- Return type
numpy.array
-
getlabel
()[source]¶ Get label of the current batch.
- Returns
The label of the current batch.
- Return type
list of NDArray
-
getpad
()[source]¶ Get the number of padding examples in the current batch.
- Returns
Number of padding examples in the current batch.
- Return type
int
-
iter_next
()[source]¶ Move to the next batch.
- Returns
Whether the move is successful.
- Return type
boolean
-
class
mxnet.io.
NDArrayIter
(data, label=None, batch_size=1, shuffle=False, last_batch_handle='pad', data_name='data', label_name='softmax_label')[source]¶ Bases:
mxnet.io.io.DataIter
Returns an iterator for
mx.nd.NDArray
,numpy.ndarray
,h5py.Dataset
mx.nd.sparse.CSRNDArray
orscipy.sparse.csr_matrix
.Examples
Methods
getdata
()Get data.
getlabel
()Get label.
getpad
()Get pad value of DataBatch.
Ignore roll over data and set to start.
Increments the coursor by batch_size for next batch and check current cursor if it exceed the number of data points.
next
()Returns the next batch of data.
reset
()Resets the iterator to the beginning of the data.
Attributes
The name and shape of data provided by this iterator.
The name and shape of label provided by this iterator.
>>> data = np.arange(40).reshape((10,2,2)) >>> labels = np.ones([10, 1]) >>> dataiter = mx.io.NDArrayIter(data, labels, 3, True, last_batch_handle='discard') >>> for batch in dataiter: ... print batch.data[0].asnumpy() ... batch.data[0].shape ... [[[ 36. 37.] [ 38. 39.]] [[ 16. 17.] [ 18. 19.]] [[ 12. 13.] [ 14. 15.]]] (3L, 2L, 2L) [[[ 32. 33.] [ 34. 35.]] [[ 4. 5.] [ 6. 7.]] [[ 24. 25.] [ 26. 27.]]] (3L, 2L, 2L) [[[ 8. 9.] [ 10. 11.]] [[ 20. 21.] [ 22. 23.]] [[ 28. 29.] [ 30. 31.]]] (3L, 2L, 2L) >>> dataiter.provide_data # Returns a list of `DataDesc` [DataDesc[data,(3, 2L, 2L),<type 'numpy.float32'>,NCHW]] >>> dataiter.provide_label # Returns a list of `DataDesc` [DataDesc[softmax_label,(3, 1L),<type 'numpy.float32'>,NCHW]]
In the above example, data is shuffled as shuffle parameter is set to True and remaining examples are discarded as last_batch_handle parameter is set to discard.
Usage of last_batch_handle parameter:
>>> dataiter = mx.io.NDArrayIter(data, labels, 3, True, last_batch_handle='pad') >>> batchidx = 0 >>> for batch in dataiter: ... batchidx += 1 ... >>> batchidx # Padding added after the examples read are over. So, 10/3+1 batches are created. 4 >>> dataiter = mx.io.NDArrayIter(data, labels, 3, True, last_batch_handle='discard') >>> batchidx = 0 >>> for batch in dataiter: ... batchidx += 1 ... >>> batchidx # Remaining examples are discarded. So, 10/3 batches are created. 3 >>> dataiter = mx.io.NDArrayIter(data, labels, 3, False, last_batch_handle='roll_over') >>> batchidx = 0 >>> for batch in dataiter: ... batchidx += 1 ... >>> batchidx # Remaining examples are rolled over to the next iteration. 3 >>> dataiter.reset() >>> dataiter.next().data[0].asnumpy() [[[ 36. 37.] [ 38. 39.]] [[ 0. 1.] [ 2. 3.]] [[ 4. 5.] [ 6. 7.]]] (3L, 2L, 2L)
NDArrayIter also supports multiple input and labels.
>>> data = {'data1':np.zeros(shape=(10,2,2)), 'data2':np.zeros(shape=(20,2,2))} >>> label = {'label1':np.zeros(shape=(10,1)), 'label2':np.zeros(shape=(20,1))} >>> dataiter = mx.io.NDArrayIter(data, label, 3, True, last_batch_handle='discard')
NDArrayIter also supports
mx.nd.sparse.CSRNDArray
with last_batch_handle set to discard.>>> csr_data = mx.nd.array(np.arange(40).reshape((10,4))).tostype('csr') >>> labels = np.ones([10, 1]) >>> dataiter = mx.io.NDArrayIter(csr_data, labels, 3, last_batch_handle='discard') >>> [batch.data[0] for batch in dataiter] [ <CSRNDArray 3x4 @cpu(0)>, <CSRNDArray 3x4 @cpu(0)>, <CSRNDArray 3x4 @cpu(0)>]
- Parameters
data (array or list of array or dict of string to array) – The input data.
label (array or list of array or dict of string to array, optional) – The input label.
batch_size (int) – Batch size of data.
shuffle (bool, optional) – Whether to shuffle the data. Only supported if no h5py.Dataset inputs are used.
last_batch_handle (str, optional) – How to handle the last batch. This parameter can be ‘pad’, ‘discard’ or ‘roll_over’. If ‘pad’, the last batch will be padded with data starting from the begining If ‘discard’, the last batch will be discarded If ‘roll_over’, the remaining elements will be rolled over to the next iteration and note that it is intended for training and can cause problems if used for prediction.
data_name (str, optional) – The data name.
label_name (str, optional) – The label name.
-
iter_next
()[source]¶ Increments the coursor by batch_size for next batch and check current cursor if it exceed the number of data points.
-
property
provide_data
¶ The name and shape of data provided by this iterator.
-
property
provide_label
¶ The name and shape of label provided by this iterator.
-
class
mxnet.io.
PrefetchingIter
(iters, rename_data=None, rename_label=None)[source]¶ Bases:
mxnet.io.io.DataIter
Performs pre-fetch for other data iterators.
This iterator will create another thread to perform
iter_next
and then store the data in memory. It potentially accelerates the data read, at the cost of more memory usage.- Parameters
iters (DataIter or list of DataIter) – The data iterators to be pre-fetched.
rename_data (None or list of dict) – The i-th element is a renaming map for the i-th iter, in the form of {‘original_name’ : ‘new_name’}. Should have one entry for each entry in iter[i].provide_data.
rename_label (None or list of dict) – Similar to
rename_data
.
Methods
getdata
()Get data of current batch.
getindex
()Get index of the current batch.
getlabel
()Get label of the current batch.
getpad
()Get the number of padding examples in the current batch.
Move to the next batch.
next
()Get next data batch from iterator.
reset
()Reset the iterator to the begin of the data.
Examples
>>> iter1 = mx.io.NDArrayIter({'data':mx.nd.ones((100,10))}, batch_size=25) >>> iter2 = mx.io.NDArrayIter({'data':mx.nd.ones((100,10))}, batch_size=25) >>> piter = mx.io.PrefetchingIter([iter1, iter2], ... rename_data=[{'data': 'data_1'}, {'data': 'data_2'}]) >>> print(piter.provide_data) [DataDesc[data_1,(25, 10L),<type 'numpy.float32'>,NCHW], DataDesc[data_2,(25, 10L),<type 'numpy.float32'>,NCHW]]
-
getdata
()[source]¶ Get data of current batch.
- Returns
The data of the current batch.
- Return type
list of NDArray
-
getindex
()[source]¶ Get index of the current batch.
- Returns
index – The indices of examples in the current batch.
- Return type
numpy.array
-
getlabel
()[source]¶ Get label of the current batch.
- Returns
The label of the current batch.
- Return type
list of NDArray
-
getpad
()[source]¶ Get the number of padding examples in the current batch.
- Returns
Number of padding examples in the current batch.
- Return type
int
-
iter_next
()[source]¶ Move to the next batch.
- Returns
Whether the move is successful.
- Return type
boolean
-
class
mxnet.io.
ResizeIter
(data_iter, size, reset_internal=True)[source]¶ Bases:
mxnet.io.io.DataIter
Resize a data iterator to a given number of batches.
- Parameters
data_iter (DataIter) – The data iterator to be resized.
size (int) – The number of batches per epoch to resize to.
reset_internal (bool) – Whether to reset internal iterator on ResizeIter.reset.
Methods
getdata
()Get data of current batch.
getindex
()Get index of the current batch.
getlabel
()Get label of the current batch.
getpad
()Get the number of padding examples in the current batch.
Move to the next batch.
reset
()Reset the iterator to the begin of the data.
Examples
>>> nd_iter = mx.io.NDArrayIter(mx.nd.ones((100,10)), batch_size=25) >>> resize_iter = mx.io.ResizeIter(nd_iter, 2) >>> for batch in resize_iter: ... print(batch.data) [<NDArray 25x10 @cpu(0)>] [<NDArray 25x10 @cpu(0)>]
-
getdata
()[source]¶ Get data of current batch.
- Returns
The data of the current batch.
- Return type
list of NDArray
-
getindex
()[source]¶ Get index of the current batch.
- Returns
index – The indices of examples in the current batch.
- Return type
numpy.array
-
getlabel
()[source]¶ Get label of the current batch.
- Returns
The label of the current batch.
- Return type
list of NDArray
-
getpad
()[source]¶ Get the number of padding examples in the current batch.
- Returns
Number of padding examples in the current batch.
- Return type
int
此页内容是否对您有帮助
感谢反馈!