NPX: NumPy Neural Network Extension

Compatibility

set_np([shape, array, dtype])

Setting NumPy shape and array semantics at the same time.

reset_np()

Deactivate NumPy shape and array and deafult dtype semantics at the same time.

is_np_array
use_np_array
is_np_shape
use_np_shape
np_array
np_shape

Devices

cpu([device_id])

Returns a CPU device.

cpu_pinned([device_id])

Returns a CPU pinned memory device.

gpu([device_id])

Returns a GPU device.

gpu_memory_info([device_id])

Query CUDA for the free and total bytes of GPU global memory.

current_device()

Returns the current device.

num_gpus()

Query CUDA for the number of GPUs present.

Nerual networks

activation(data[, act_type])

Applies an activation function element-wise to the input.

batch_norm(x, gamma, beta, running_mean, …)

Batch normalization.

convolution([data, weight, bias, kernel, …])

Compute N-D convolution on (N+2)-D input.

dropout(data[, p, mode, axes, cudnn_off])

Applies dropout operation to input array.

embedding(data, weight[, input_dim, …])

Maps integer indices to vector representations (embeddings).

fully_connected(x, weight[, bias, …])

Applies a linear transformation: \(Y = XW^T + b\).

layer_norm([data, gamma, beta, axis, eps, …])

Layer normalization.

pooling([data, kernel, stride, pad, …])

Performs pooling on the input.

rnn([data, parameters, state, state_cell, …])

Applies recurrent layers to input data.

leaky_relu([data, gamma, act_type, slope, …])

Applies Leaky rectified linear unit activation element-wise to the input.

multibox_detection([cls_prob, loc_pred, …])

Convert multibox detection predictions.

multibox_prior([data, sizes, ratios, clip, …])

Generate prior(anchor) boxes from data, sizes and ratios.

multibox_target([anchor, label, cls_pred, …])

Compute Multibox training targets

roi_pooling([data, rois, pooled_size, …])

Performs region of interest(ROI) pooling on the input array.

More operators

sigmoid([data, out, name])

Computes sigmoid of x element-wise.

relu([data, out, name])

Computes rectified linear activation.

smooth_l1([data, scalar, out, name])

Calculate Smooth L1 Loss(lhs, scalar) by summing

softmax(data[, length, axis, temperature, …])

Applies the softmax function.

log_softmax(data[, axis, length, …])

Computes the log softmax of the input.

topk(data[, axis, k, ret_typ, is_ascend, dtype])

Returns the indices of the top k elements in an input array along the given

waitall()

Wait for all async operations to finish in MXNet.

load(file)

Load arrays from .npy, .npz or legacy MXNet file format.

save(file, arr)

Save an array to a binary file in NumPy .npy format.

one_hot(data[, depth, on_value, off_value, …])

Returns a one-hot array.

pick(data, index[, axis, mode, keepdims])

Picks elements from an input array according to the input indices along the given axis.

reshape_like([lhs, rhs, lhs_begin, lhs_end, …])

Reshape some or all dimensions of lhs to have the same shape as some or all dimensions of rhs.

batch_flatten([data, out, name])

Flattens the input array into a 2-D array by collapsing the higher dimensions.

batch_dot(a, b[, transpose_a, transpose_b, …])

Batchwise dot product.

gamma([data, out, name])

Returns the gamma function (extension of the factorial function to the reals), computed element-wise on the input array.

sequence_mask([data, sequence_length, …])

Sets all elements outside the sequence to a constant value.

seed