org.apache.mxnet

NDArray

Related Docs: class NDArray | package mxnet

object NDArray

NDArray API of mxnet

Annotations
@AddNDArrayFunctions( false )
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. NDArray
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def arange(start: Float, stop: Option[Float] = None, step: Float = 1.0f, repeat: Int = 1, ctx: Context = Context.defaultCtx, dType: DType.DType = Base.MX_REAL_TYPE): NDArray

    Returns evenly spaced values within a given interval.

    Returns evenly spaced values within a given interval. Values are generated within the half-open interval [start, stop). In other words, the interval includes start but excludes stop.

    start

    Start of interval. The default start value is 0.

    stop

    End of interval.

    step

    Spacing between values. The default step size is 1.

    repeat

    Number of times to repeat each element. The default repeat count is 1.

    ctx

    Device context. Default context is the current default context.

    dType

    The data type of the NDArray. The default datatype is DType.Float32.

    returns

    NDArray of evenly spaced values in the specified range.

  5. def array(sourceArr: Array[Float], shape: Shape, ctx: Context = null): NDArray

    Create a new NDArray that copies content from source_array.

    Create a new NDArray that copies content from source_array.

    sourceArr

    Source data to create NDArray from.

    shape

    shape of the NDArray

    ctx

    The context of the NDArray, default to current default context.

    returns

    The created NDArray.

  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def concatenate(arrays: NDArray*): NDArray

  9. def concatenate(arrays: Seq[NDArray], axis: Int = 0, alwaysCopy: Boolean = true): NDArray

    Concatenate a list of NDArrays along the specified dimension.

    Concatenate a list of NDArrays along the specified dimension.

    arrays

    Arrays to be concatenate. They must have identical shape except the first dimension. They also must have the same data type.

    axis

    The axis along which to concatenate.

    alwaysCopy

    Default True. When not True, if the arrays only contain one NDArray, that element will be returned directly, avoid copying.

    returns

    An NDArray that lives on the same context as arrays[0].context.

  10. def deserialize(bytes: Array[Byte]): NDArray

  11. def empty(ctx: Context, shape: Int*): NDArray

  12. def empty(shape: Int*): NDArray

  13. def empty(shape: Shape, ctx: Context = null, dtype: DType.DType = Base.MX_REAL_TYPE): NDArray

    Create an empty uninitialized new NDArray, with specified shape.

    Create an empty uninitialized new NDArray, with specified shape.

    shape

    shape of the NDArray.

    ctx

    The context of the NDArray, default to current default context.

    returns

    The created NDArray.

  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def equal(lhs: NDArray, rhs: Float): NDArray

  16. def equal(lhs: NDArray, rhs: NDArray): NDArray

    Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.

    Returns the result of element-wise **equal to** (==) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are same, otherwise return 0(false).

  17. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def full(shape: Shape, value: Float, ctx: Context = null): NDArray

    Create a new NDArray filled with given value, with specified shape.

    Create a new NDArray filled with given value, with specified shape.

    shape

    shape of the NDArray.

    value

    value to be filled with

    ctx

    The context of the NDArray, default to current default context

  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. implicit def getFirstResult(ret: NDArrayFuncReturn): NDArray

  22. def greater(lhs: NDArray, rhs: Float): NDArray

  23. def greater(lhs: NDArray, rhs: NDArray): NDArray

    Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.

    Returns the result of element-wise **greater than** (>) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than rhs, otherwise return 0(false).

  24. def greaterEqual(lhs: NDArray, rhs: Float): NDArray

  25. def greaterEqual(lhs: NDArray, rhs: NDArray): NDArray

    Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.

    Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are greater than equal to rhs, otherwise return 0(false).

  26. def hashCode(): Int

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

    Definition Classes
    Any
  28. def lesser(lhs: NDArray, rhs: Float): NDArray

  29. def lesser(lhs: NDArray, rhs: NDArray): NDArray

    Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.

    Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are less than rhs, otherwise return 0(false).

  30. def lesserEqual(lhs: NDArray, rhs: Float): NDArray

  31. def lesserEqual(lhs: NDArray, rhs: NDArray): NDArray

    Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.

    Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if lhs elements are lesser than equal to rhs, otherwise return 0(false).

  32. def load(fname: String): (Array[String], Array[NDArray])

    Load ndarray from binary file.

    Load ndarray from binary file.

    You can also use pickle to do the job if you only work on python. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being able to directly load/save from cloud storage(S3, HDFS)

    fname

    The name of the file.Can be S3 or HDFS address (remember built with S3 support). Example of fname:

    • s3://my-bucket/path/my-s3-ndarray
    • hdfs://my-bucket/path/my-hdfs-ndarray
    • /path-to/my-local-ndarray
    returns

    dict of str->NDArray to be saved

  33. def load2Array(fname: String): Array[NDArray]

  34. def load2Map(fname: String): Map[String, NDArray]

  35. def maximum(lhs: Float, rhs: NDArray): NDArray

  36. def maximum(lhs: NDArray, rhs: Float): NDArray

  37. def maximum(lhs: NDArray, rhs: NDArray): NDArray

  38. def minimum(lhs: Float, rhs: NDArray): NDArray

  39. def minimum(lhs: NDArray, rhs: Float): NDArray

  40. def minimum(lhs: NDArray, rhs: NDArray): NDArray

  41. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  42. def notEqual(lhs: NDArray, rhs: Float): NDArray

  43. def notEqual(lhs: NDArray, rhs: NDArray): NDArray

    Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.

    Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting. For each element in input arrays, return 1(true) if corresponding elements are different, otherwise return 0(false).

  44. final def notify(): Unit

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

    Definition Classes
    AnyRef
  46. def onehotEncode(indices: NDArray, out: NDArray): NDArray

    One hot encoding indices into matrix out.

    One hot encoding indices into matrix out.

    indices

    An NDArray containing indices of the categorical features.

    out

    The result holder of the encoding.

    returns

    Same as out.

  47. def ones(ctx: Context, shape: Int*): NDArray

  48. def ones(shape: Int*): NDArray

  49. def ones(shape: Shape, ctx: Context = null, dtype: DType.DType = Base.MX_REAL_TYPE): NDArray

    Create a new NDArray filled with 1, with specified shape.

    Create a new NDArray filled with 1, with specified shape.

    shape

    shape of the NDArray.

    ctx

    The context of the NDArray, default to current default context.

    returns

    The created NDArray.

  50. def power(lhs: Float, rhs: NDArray): NDArray

  51. def power(lhs: NDArray, rhs: Float): NDArray

  52. def power(lhs: NDArray, rhs: NDArray): NDArray

  53. def save(fname: String, data: Traversable[NDArray]): Unit

  54. def save(fname: String, data: Map[String, NDArray]): Unit

    Save list of NDArray or dict of str->NDArray to binary file.

    Save list of NDArray or dict of str->NDArray to binary file.

    You can also use pickle to do the job if you only work on python. The advantage of load/save is the file is language agnostic. This means the file saved using save can be loaded by other language binding of mxnet. You also get the benefit being able to directly load/save from cloud storage(S3, HDFS)

    fname

    The name of the file.Can be S3 or HDFS address (remember built with S3 support). Example of fname:

    • s3://my-bucket/path/my-s3-ndarray
    • hdfs://my-bucket/path/my-hdfs-ndarray
    • /path-to/my-local-ndarray
    data

    dict of str->NDArray

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

    Definition Classes
    AnyRef
  56. def toString(): String

    Definition Classes
    AnyRef → Any
  57. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. def waitall(): Unit

    Wait all async operation to finish in MXNet This function is used for benchmark only

  61. def zeros(ctx: Context, shape: Int*): NDArray

  62. def zeros(shape: Int*): NDArray

  63. def zeros(shape: Shape, ctx: Context = null, dtype: DType.DType = Base.MX_REAL_TYPE): NDArray

    Create a new NDArray filled with 0, with specified shape.

    Create a new NDArray filled with 0, with specified shape.

    shape

    shape of the NDArray.

    ctx

    The context of the NDArray, default to current default context.

    returns

    The created NDArray.

Inherited from AnyRef

Inherited from Any

Ungrouped