org.apache.mxnet

NDArray

Related Docs: class NDArray | package mxnet

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
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. val api: NDArrayAPI.type

  5. 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

    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.

  6. 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.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

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

  10. 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.

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

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

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

  14. def empty(shape: Shape, ctx: Context = null, 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.

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

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

  17. 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).

  18. def equals(arg0: Any): Boolean

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. 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

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

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

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

  24. 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).

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

  26. 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).

  27. def hashCode(): Int

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

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

  30. 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).

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

  32. 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).

  33. 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

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

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

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

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

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

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

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

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

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

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

  44. 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).

  45. final def notify(): Unit

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

    Definition Classes
    AnyRef
  47. 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.

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

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

  50. def ones(shape: Shape, ctx: Context = null, 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.

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

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

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

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

  55. 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

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

    Definition Classes
    AnyRef
  57. def toString(): String

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

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

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

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

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

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

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

  64. def zeros(shape: Shape, ctx: Context = null, 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