Object/Class

ml.dmlc.mxnet

NDArray

Related Docs: class NDArray | package mxnet

Permalink

object NDArray

NDArray API of mxnet

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. NDArray
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

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

    Permalink
    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 = Base.MX_REAL_TYPE): NDArray

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

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

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

    Permalink

    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

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

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

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

    Permalink

    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

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

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

    Permalink

    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

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

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

    Permalink

    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[_]

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

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

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

    Permalink

    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

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

    Permalink

    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

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

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

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

    Permalink

    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

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

    Permalink

    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])

    Permalink

    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]

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

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

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

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

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

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

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

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

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

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

    Permalink

    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

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

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

    Permalink

    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

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

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

    Permalink

    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

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

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

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

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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  56. def toString(): String

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

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

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

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

    Permalink

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

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

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

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

    Permalink

    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