From b30a719c21983e04c58dda20759a8d71caf8986f Mon Sep 17 00:00:00 2001 From: Qing Date: Mon, 9 Jul 2018 11:40:51 -0700 Subject: [PATCH 1/9] add initial neuralstyle and test coverage --- .../neuralstyle/ModelVgg19.scala | 115 +++++++----------- .../neuralstyle/NeuralStyle.scala | 15 ++- .../neuralstyle/end2end/Basic.scala | 39 +++--- .../neuralstyle/end2end/BoostInference.scala | 60 ++++----- .../neuralstyle/end2end/BoostTrain.scala | 38 +++--- .../neuralstyle/end2end/DataProcessing.scala | 15 +-- .../neuralstyle/end2end/GenV3.scala | 39 +++--- .../neuralstyle/end2end/GenV4.scala | 81 ++++-------- .../neuralstyle/end2end/ModelVgg19.scala | 111 ----------------- .../neuralstyle/end2end/Module.scala | 15 +-- .../imclassification/MNISTExampleSuite.scala | 3 +- .../neuralstyle/NeuralStyleSuite.scala | 66 ++++++++++ 12 files changed, 237 insertions(+), 360 deletions(-) delete mode 100644 scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/ModelVgg19.scala create mode 100644 scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/ModelVgg19.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/ModelVgg19.scala index 4d9aa35d21ff..afaea5ad3649 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/ModelVgg19.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/ModelVgg19.scala @@ -17,86 +17,65 @@ package org.apache.mxnetexamples.neuralstyle -import org.apache.mxnet.Context -import org.apache.mxnet.Executor -import org.apache.mxnet.NDArray -import org.apache.mxnet.Symbol -import org.apache.mxnet.Shape +import org.apache.mxnet.{Context, Executor, NDArray, Shape, Symbol} /** * Definition for the neuralstyle network and initialize it with pretrained weight - * @author Depeng Liang */ object ModelVgg19 { case class ConvExecutor(executor: Executor, data: NDArray, dataGrad: NDArray, style: Array[NDArray], content: NDArray, argDict: Map[String, NDArray]) + def ConvRelu(data : Symbol, convName : String, reluName : String, + numFilter : Int, kernel : (Int, Int) = (3, 3), + stride : (Int, Int) = (1, 1)) : Symbol = { + val conv = Symbol.api.Convolution(data = Some(data), num_filter = numFilter, + pad = Some(Shape(1, 1)), kernel = Shape(kernel._1, kernel._2), + stride = Some(Shape(stride._1, stride._2)), no_bias = Some(false), + workspace = Some(1024), name = convName) + Symbol.api.relu(data = Some(conv), name = reluName) + } + def getSymbol: (Symbol, Symbol) = { + getVggSymbol() + } + + def getVggSymbol(prefix: String = "", contentOnly: Boolean = false): (Symbol, Symbol) = { // declare symbol - val data = Symbol.Variable("data") - val conv1_1 = Symbol.Convolution("conv1_1")()(Map("data" -> data , "num_filter" -> 64, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu1_1 = Symbol.Activation("relu1_1")()(Map("data" -> conv1_1 , "act_type" -> "relu")) - val conv1_2 = Symbol.Convolution("conv1_2")()(Map("data" -> relu1_1 , "num_filter" -> 64, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu1_2 = Symbol.Activation("relu1_2")()(Map("data" -> conv1_2 , "act_type" -> "relu")) - val pool1 = Symbol.Pooling("pool1")()(Map("data" -> relu1_2 , "pad" -> "(0,0)", - "kernel" -> "(2,2)", "stride" -> "(2,2)", "pool_type" -> "avg")) - val conv2_1 = Symbol.Convolution("conv2_1")()(Map("data" -> pool1 , "num_filter" -> 128, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu2_1 = Symbol.Activation("relu2_1")()(Map("data" -> conv2_1 , "act_type" -> "relu")) - val conv2_2 = Symbol.Convolution("conv2_2")()(Map("data" -> relu2_1 , "num_filter" -> 128, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu2_2 = Symbol.Activation("relu2_2")()(Map("data" -> conv2_2 , "act_type" -> "relu")) - val pool2 = Symbol.Pooling("pool2")()(Map("data" -> relu2_2 , "pad" -> "(0,0)", - "kernel" -> "(2,2)", "stride" -> "(2,2)", "pool_type" -> "avg")) - val conv3_1 = Symbol.Convolution("conv3_1")()(Map("data" -> pool2 , "num_filter" -> 256, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu3_1 = Symbol.Activation("relu3_1")()(Map("data" -> conv3_1 , "act_type" -> "relu")) - val conv3_2 = Symbol.Convolution("conv3_2")()(Map("data" -> relu3_1 , "num_filter" -> 256, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu3_2 = Symbol.Activation("'relu3_2")()(Map("data" -> conv3_2 , "act_type" -> "relu")) - val conv3_3 = Symbol.Convolution("conv3_3")()(Map("data" -> relu3_2 , "num_filter" -> 256, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu3_3 = Symbol.Activation("relu3_3")()(Map("data" -> conv3_3 , "act_type" -> "relu")) - val conv3_4 = Symbol.Convolution("conv3_4")()(Map("data" -> relu3_3 , "num_filter" -> 256, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu3_4 = Symbol.Activation("relu3_4")()(Map("data" -> conv3_4 , "act_type" -> "relu")) - val pool3 = Symbol.Pooling("pool3")()(Map("data" -> relu3_4 , "pad" -> "(0,0)", - "kernel" -> "(2,2)", "stride" -> "(2,2)", "pool_type" -> "avg")) - val conv4_1 = Symbol.Convolution("conv4_1")()(Map("data" -> pool3 , "num_filter" -> 512, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu4_1 = Symbol.Activation("relu4_1")()(Map("data" -> conv4_1 , "act_type" -> "relu")) - val conv4_2 = Symbol.Convolution("conv4_2")()(Map("data" -> relu4_1 , "num_filter" -> 512, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu4_2 = Symbol.Activation("relu4_2")()(Map("data" -> conv4_2 , "act_type" -> "relu")) - val conv4_3 = Symbol.Convolution("conv4_3")()(Map("data" -> relu4_2 , "num_filter" -> 512, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu4_3 = Symbol.Activation("relu4_3")()(Map("data" -> conv4_3 , "act_type" -> "relu")) - val conv4_4 = Symbol.Convolution("conv4_4")()(Map("data" -> relu4_3 , "num_filter" -> 512, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu4_4 = Symbol.Activation("relu4_4")()(Map("data" -> conv4_4 , "act_type" -> "relu")) - val pool4 = Symbol.Pooling("pool4")()(Map("data" -> relu4_4 , "pad" -> "(0,0)", - "kernel" -> "(2,2)", "stride" -> "(2,2)", "pool_type" -> "avg")) - val conv5_1 = Symbol.Convolution("conv5_1")()(Map("data" -> pool4 , "num_filter" -> 512, - "pad" -> "(1,1)", "kernel" -> "(3,3)", "stride" -> "(1,1)", - "no_bias" -> false, "workspace" -> 1024)) - val relu5_1 = Symbol.Activation("relu5_1")()(Map("data" -> conv5_1 , "act_type" -> "relu")) + val data = Symbol.Variable(s"${prefix}data") + + val relu1_1 = ConvRelu(data, s"${prefix}conv1_1", s"${prefix}relu1_1", 64) + val relu1_2 = ConvRelu(relu1_1, s"${prefix}conv1_2", s"${prefix}relu1_2", 64) + val pool1 = Symbol.api.Pooling(data = Some(relu1_2), pad = Some(Shape(0, 0)), + kernel = Some(Shape(2, 2)), stride = Some(Shape(2, 2)), pool_type = Some("avg"), + name = s"${prefix}pool1") + + val relu2_1 = ConvRelu(pool1, s"${prefix}conv2_1", s"${prefix}relu2_1", 128) + val relu2_2 = ConvRelu(relu2_1, s"${prefix}conv2_2", s"${prefix}relu2_2", 128) + val pool2 = Symbol.api.Pooling(data = Some(relu2_2), pad = Some(Shape(0, 0)), + kernel = Some(Shape(2, 2)), stride = Some(Shape(2, 2)), pool_type = Some("avg"), + name = s"${prefix}pool2") + + val relu3_1 = ConvRelu(pool2, s"${prefix}conv3_1", s"${prefix}relu3_1", 256) + val relu3_2 = ConvRelu(relu3_1, s"${prefix}conv3_2", s"${prefix}relu3_2", 256) + val relu3_3 = ConvRelu(relu3_2, s"${prefix}conv3_3", s"${prefix}relu3_3", 256) + val relu3_4 = ConvRelu(relu3_3, s"${prefix}conv3_4", s"${prefix}relu3_4", 256) + val pool3 = Symbol.api.Pooling(data = Some(relu3_4), pad = Some(Shape(0, 0)), + kernel = Some(Shape(2, 2)), stride = Some(Shape(2, 2)), pool_type = Some("avg"), + name = s"${prefix}pool3") + + val relu4_1 = ConvRelu(pool3, s"${prefix}conv4_1", s"${prefix}relu4_1", 512) + val relu4_2 = ConvRelu(relu4_1, s"${prefix}conv4_2", s"${prefix}relu4_2", 512) + val relu4_3 = ConvRelu(relu4_2, s"${prefix}conv4_3", s"${prefix}relu4_3", 512) + val relu4_4 = ConvRelu(relu4_3, s"${prefix}conv4_4", s"${prefix}relu4_4", 512) + val pool4 = Symbol.api.Pooling(data = Some(relu4_4), pad = Some(Shape(0, 0)), + kernel = Some(Shape(2, 2)), stride = Some(Shape(2, 2)), pool_type = Some("avg"), + name = s"${prefix}pool4") + + val relu5_1 = ConvRelu(pool4, s"${prefix}conv5_1", s"${prefix}relu5_1", 512) // style and content layers - val style = Symbol.Group(relu1_1, relu2_1, relu3_1, relu4_1, relu5_1) + val style = if (contentOnly) null else Symbol.Group(relu1_1, relu2_1, relu3_1, relu4_1, relu5_1) val content = Symbol.Group(relu4_2) (style, content) } diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala index d99ea641b5d4..22a1d269a9bf 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala @@ -17,21 +17,20 @@ package org.apache.mxnetexamples.neuralstyle -import org.apache.mxnet._ -import org.kohsuke.args4j.{CmdLineParser, Option} -import org.slf4j.LoggerFactory -import scala.collection.JavaConverters._ -import com.sksamuel.scrimage.Image import java.io.File -import com.sksamuel.scrimage.Pixel + +import com.sksamuel.scrimage.{Image, Pixel} import com.sksamuel.scrimage.filter.GaussianBlurFilter import com.sksamuel.scrimage.nio.JpegWriter +import org.apache.mxnet._ import org.apache.mxnet.optimizer.Adam +import org.kohsuke.args4j.{CmdLineParser, Option} +import org.slf4j.LoggerFactory + +import scala.collection.JavaConverters._ /** * An Implementation of the paper A Neural Algorithm of Artistic Style - * by Leon A. Gatys, Alexander S. Ecker, and Matthias Bethge - * @author Depeng Liang */ object NeuralStyle { case class NSExecutor(executor: Executor, data: NDArray, dataGrad: NDArray) diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Basic.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Basic.scala index c604f842c4c2..e7dc439188ee 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Basic.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Basic.scala @@ -17,16 +17,11 @@ package org.apache.mxnetexamples.neuralstyle.end2end -import org.apache.mxnet.Shape -import org.apache.mxnet.Context -import org.apache.mxnet.NDArray -import org.apache.mxnet.Symbol -import org.apache.mxnet.Initializer +import org.apache.mxnet.{Context, Initializer, NDArray, Shape, Symbol} +import org.apache.mxnetexamples.neuralstyle.ModelVgg19 import org.slf4j.LoggerFactory -/** - * @author Depeng Liang - */ + object Basic { class PretrainedInit(prefix: String, params: Map[String, NDArray], @@ -61,7 +56,7 @@ object Basic { def getStyleModule(prefix: String, dShape: Shape, ctx: Context, params: Map[String, NDArray]): Module = { val inputShape = Map(s"${prefix}_data" -> dShape) - val (style, content) = ModelVgg19.getVggSymbol(prefix) + val (style, content) = ModelVgg19.getVggSymbol(prefix + "_") val (gram, gScale) = styleGramSymbol(inputShape, style) val init = new PretrainedInit(prefix, params, true) new Module(symbol = gram, context = ctx, @@ -75,11 +70,15 @@ object Basic { var gradScale = List[Int]() for (i <- 0 until style.listOutputs().length) { val shape = outputShape(i) - val x = Symbol.Reshape()()(Map("data" -> style.get(i), - "shape" -> Shape(shape(1), shape(2) * shape(3)))) - // use fully connected to quickly do dot(x, x^T) - val gram = Symbol.FullyConnected()()(Map("data" -> x, "weight" -> x, - "no_bias" -> true, "num_hidden" -> shape(1))) + val x = Symbol.api.Reshape(data = Some(style.get(i)), + shape = Some(Shape(shape(1), shape(2) * shape(3)))) + val gram = Symbol.api.FullyConnected(data = Some(x), weight = Some(x), + no_bias = Some(true), num_hidden = shape(1)) +// val x = Symbol.Reshape()()(Map("data" -> style.get(i), +// "shape" -> Shape(shape(1), shape(2) * shape(3)))) +// // use fully connected to quickly do dot(x, x^T) +// val gram = Symbol.FullyConnected()()(Map("data" -> x, "weight" -> x, +// "no_bias" -> true, "num_hidden" -> shape(1))) gramList = gramList :+ gram gradScale = gradScale :+ (shape(1) * shape(2) * shape(3) * shape(1)) } @@ -90,16 +89,20 @@ object Basic { var gramLoss = List[Symbol]() for (i <- 0 until gram.listOutputs().length) { val gvar = Symbol.Variable(s"target_gram_$i") - gramLoss = gramLoss :+ Symbol.sum()(Symbol.square()(gvar - gram.get(i))())() + gramLoss = gramLoss :+ Symbol.api.sum(Some( + Symbol.api.square(Some(gvar - gram.get(i))) + )) +// gramLoss = gramLoss :+ Symbol.sum()(Symbol.square()(gvar - gram.get(i))())() } val cvar = Symbol.Variable("target_content") - val contentLoss = Symbol.sum()(Symbol.square()(cvar - content)())() + val contentLoss = Symbol.api.sum(Some(Symbol.api.square(Some(cvar - content)))) +// val contentLoss = Symbol.sum()(Symbol.square()(cvar - content)())() (Symbol.Group(gramLoss: _*), contentLoss) } def getContentModule(prefix: String, dShape: Shape, ctx: Context, params: Map[String, NDArray]): Module = { - val (_, sym) = ModelVgg19.getVggSymbol(prefix, true) + val (_, sym) = ModelVgg19.getVggSymbol(prefix + "_", true) val init = new PretrainedInit(prefix, params) new Module(symbol = sym, context = ctx, dataShapes = Map(s"${prefix}_data" -> dShape), @@ -109,7 +112,7 @@ object Basic { def getLossModule(prefix: String, dShape: Shape, ctx: Context, params: Map[String, NDArray]): (Module, List[Int]) = { val inputShape = Map(s"${prefix}_data" -> dShape) - val (style, content) = ModelVgg19.getVggSymbol(prefix) + val (style, content) = ModelVgg19.getVggSymbol(prefix + "_") val (gram, gScale) = styleGramSymbol(inputShape, style) val (styleLoss, contentLoss) = getLoss(gram, content) val sym = Symbol.Group(styleLoss, contentLoss) diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostInference.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostInference.scala index 0feb73d3036e..5410fb9edc7c 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostInference.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostInference.scala @@ -17,19 +17,43 @@ package org.apache.mxnetexamples.neuralstyle.end2end -import org.slf4j.LoggerFactory +import org.apache.mxnet.{Context, Shape} import org.kohsuke.args4j.{CmdLineParser, Option} +import org.slf4j.LoggerFactory + import scala.collection.JavaConverters._ -import org.apache.mxnet.Shape -import org.apache.mxnet.Context -/** - * @author Depeng Liang - */ object BoostInference { private val logger = LoggerFactory.getLogger(classOf[BoostInference]) + def runInference(modelPath: String, outputPath: String, guassianRadius : Int, + inputImage : String, ctx : Context): Unit = { + val dShape = Shape(1, 3, 480, 640) + val clipNorm = 1.0f * dShape.product + // generator + val gens = Array( + GenV4.getModule("g0", dShape, ctx, isTrain = false), + GenV3.getModule("g1", dShape, ctx, isTrain = false), + GenV3.getModule("g2", dShape, ctx, isTrain = false), + GenV4.getModule("g3", dShape, ctx, isTrain = false) + ) + gens.zipWithIndex.foreach { case (gen, i) => + gen.loadParams(s"$modelPath/$i/v3_0002-0026000.params") + } + + val contentNp = + DataProcessing.preprocessContentImage(s"$inputImage", dShape, ctx) + var data = Array(contentNp) + for (i <- 0 until gens.length) { + gens(i).forward(data.takeRight(1)) + val newImg = gens(i).getOutputs()(0) + data :+= newImg + DataProcessing.saveImage(newImg, s"$outputPath/out_$i.jpg", guassianRadius) + logger.info(s"Converted image: $outputPath/out_$i.jpg") + } + } + def main(args: Array[String]): Unit = { val stce = new BoostInference val parser: CmdLineParser = new CmdLineParser(stce) @@ -39,30 +63,10 @@ object BoostInference { && stce.inputImage != null && stce.outputPath != null) - val dShape = Shape(1, 3, 480, 640) - val clipNorm = 1.0f * dShape.product val ctx = if (stce.gpu == -1) Context.cpu() else Context.gpu(stce.gpu) - // generator - val gens = Array( - GenV4.getModule("g0", dShape, ctx, isTrain = false), - GenV3.getModule("g1", dShape, ctx, isTrain = false), - GenV3.getModule("g2", dShape, ctx, isTrain = false), - GenV4.getModule("g3", dShape, ctx, isTrain = false) - ) - gens.zipWithIndex.foreach { case (gen, i) => - gen.loadParams(s"${stce.modelPath}/$i/v3_0002-0026000.params") - } + runInference(stce.modelPath, stce.outputPath, stce.guassianRadius, stce.inputImage, ctx) - val contentNp = - DataProcessing.preprocessContentImage(s"${stce.inputImage}", dShape, ctx) - var data = Array(contentNp) - for (i <- 0 until gens.length) { - gens(i).forward(data.takeRight(1)) - val newImg = gens(i).getOutputs()(0) - data :+= newImg - DataProcessing.saveImage(newImg, s"${stce.outputPath}/out_${i}.jpg", stce.guassianRadius) - } } catch { case ex: Exception => { logger.error(ex.getMessage, ex) @@ -74,7 +78,7 @@ object BoostInference { } class BoostInference { - @Option(name = "--model-path", usage = "the save model path") + @Option(name = "--model-path", usage = "the saved model path") private val modelPath: String = null @Option(name = "--input-image", usage = "the style image") private val inputImage: String = null diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostTrain.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostTrain.scala index 8b5549de4af1..eb7007a1ce4f 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostTrain.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostTrain.scala @@ -17,24 +17,17 @@ package org.apache.mxnetexamples.neuralstyle.end2end -import org.slf4j.LoggerFactory +import java.io.File + +import org.apache.mxnet.{Context, Executor, NDArray, Shape, Symbol} +import org.apache.mxnet.optimizer.SGD import org.kohsuke.args4j.{CmdLineParser, Option} +import org.slf4j.LoggerFactory + import scala.collection.JavaConverters._ -import org.apache.mxnet.NDArray -import org.apache.mxnet.Shape -import org.apache.mxnet.Context -import org.apache.mxnet.DataBatch -import org.apache.mxnet.Symbol -import org.apache.mxnet.Executor -import org.apache.mxnet.optimizer.SGD -import java.io.File -import javax.imageio.ImageIO import scala.util.Random -import org.apache.mxnet.optimizer.Adam -/** - * @author Depeng Liang - */ + object BoostTrain { private val logger = LoggerFactory.getLogger(classOf[BoostTrain]) @@ -46,12 +39,13 @@ object BoostTrain { val nChannel = img.shape(1) val sImg = Symbol.Variable("img") val sKernel = Symbol.Variable("kernel") - val channels = Symbol.SliceChannel()(sImg)(Map("num_outputs" -> nChannel)) - val out = Symbol.Concat()((0 until nChannel).map { i => - Symbol.Convolution()()(Map("data" -> channels.get(i), "weight" -> sKernel, - "num_filter" -> 1, "kernel" -> "(3,3)", "pad" -> "(1,1)", - "no_bias" -> true, "stride" -> "(1,1)")) - }.toArray: _*)() * tvWeight + val channels = Symbol.api.SliceChannel(data = Some(sImg), num_outputs = nChannel) + val toConcat = (0 until nChannel).map( i => + Symbol.api.Convolution(data = Some(channels.get(i)), weight = Some(sKernel), + num_filter = 1, kernel = Shape(3, 3), pad = Some(Shape(1, 1)), + no_bias = Some(true), stride = Some(Shape(1, 1))) + ).toArray + val out = Symbol.api.Concat(data = toConcat, num_args = toConcat.length) * tvWeight val kernel = { val tmp = NDArray.empty(Shape(1, 1, 3, 3), ctx) tmp.set(Array[Float](0, -1, 0, -1, 4, -1, 0, -1, 0)) @@ -197,9 +191,9 @@ object BoostTrain { class BoostTrain { @Option(name = "--data-path", usage = "the input train data path") private val dataPath: String = null - @Option(name = "--vgg--model-path", usage = "the pretrained model to use: ['vgg']") + @Option(name = "--vgg-model-path", usage = "the pretrained model to use: ['vgg']") private val vggModelPath: String = null - @Option(name = "--save--model-path", usage = "the save model path") + @Option(name = "--save-model-path", usage = "the save model path") private val saveModelPath: String = null @Option(name = "--style-image", usage = "the style image") private val styleImage: String = null diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/DataProcessing.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/DataProcessing.scala index 94d05bb7d57c..80a009ea40c2 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/DataProcessing.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/DataProcessing.scala @@ -17,19 +17,14 @@ package org.apache.mxnetexamples.neuralstyle.end2end -import com.sksamuel.scrimage.Image -import com.sksamuel.scrimage.Pixel +import java.io.File + +import com.sksamuel.scrimage.{Image, Pixel} import com.sksamuel.scrimage.filter.GaussianBlurFilter import com.sksamuel.scrimage.nio.JpegWriter -import org.apache.mxnet.Context -import org.apache.mxnet.NDArray -import java.io.File -import org.apache.mxnet.Shape -import scala.util.Random +import org.apache.mxnet.{Context, NDArray, Shape} + -/** - * @author Depeng Liang - */ object DataProcessing { def preprocessContentImage(path: String, diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV3.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV3.scala index b90e9f0e3171..d36698cc122f 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV3.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV3.scala @@ -17,34 +17,31 @@ package org.apache.mxnetexamples.neuralstyle.end2end -import org.apache.mxnet.Symbol -import org.apache.mxnet.Shape -import org.apache.mxnet.Context -import org.apache.mxnet.Xavier +import org.apache.mxnet.{Context, Shape, Symbol, Xavier} + -/** - * @author Depeng Liang - */ object GenV3 { def Conv(data: Symbol, numFilter: Int, kernel: (Int, Int) = (5, 5), pad: (Int, Int) = (2, 2), stride: (Int, Int) = (2, 2)): Symbol = { - var sym = Symbol.Convolution()()(Map("data" -> data, "num_filter" -> numFilter, - "kernel" -> s"$kernel", "stride" -> s"$stride", "pad" -> s"$pad", "no_bias" -> false)) - sym = Symbol.BatchNorm()()(Map("data" -> sym, "fix_gamma" -> false)) - sym = Symbol.LeakyReLU()()(Map("data" -> sym, "act_type" -> "leaky")) + var sym = Symbol.api.Convolution(data = Some(data), num_filter = numFilter, + kernel = Shape(kernel._1, kernel._2), stride = Some(Shape(stride._1, stride._2)), + pad = Some(Shape(pad._1, pad._2)), no_bias = Some(false)) + sym = Symbol.api.BatchNorm(data = Some(sym), fix_gamma = Some(false)) + sym = Symbol.api.LeakyReLU(data = Some(sym), act_type = Some("leaky")) sym } def Deconv(data: Symbol, numFilter: Int, imHw: (Int, Int), kernel: (Int, Int) = (7, 7), pad: (Int, Int) = (2, 2), stride: (Int, Int) = (2, 2), crop: Boolean = true, out: Boolean = false): Symbol = { - var sym = Symbol.Deconvolution()()(Map("data" -> data, "num_filter" -> numFilter, - "kernel" -> s"$kernel", "stride" -> s"$stride", "pad" -> s"$pad", "no_bias" -> true)) - if (crop) sym = Symbol.Crop()(sym)( - Map("offset" -> "(1, 1)", "h_w" -> s"$imHw", "num_args" -> 1)) - sym = Symbol.BatchNorm()()(Map("data" -> sym, "fix_gamma" -> false)) - if (out == false) Symbol.LeakyReLU()()(Map("data" -> sym, "act_type" -> "leaky")) - else Symbol.Activation()()(Map("data" -> sym, "act_type" -> "tanh")) + var sym = Symbol.api.Deconvolution(data = Some(data), num_filter = numFilter, + kernel = Shape(kernel._1, kernel._2), stride = Some(Shape(stride._1, stride._2)), + pad = Some(Shape(pad._1, pad._2)), no_bias = Some(true)) + if (crop) sym = Symbol.api.Crop(data = Array(sym), offset = Some(Shape(1, 1)), + h_w = Some(Shape(imHw._1, imHw._2)), num_args = 1) + sym = Symbol.api.BatchNorm(data = Some(sym), fix_gamma = Some(false)) + if (out == false) Symbol.api.LeakyReLU(data = Some(sym), act_type = Some("leaky")) + else Symbol.api.Activation(data = Some(sym), act_type = "tanh") } def getGenerator(prefix: String, imHw: (Int, Int)): Symbol = { @@ -61,12 +58,12 @@ object GenV3 { val conv5_1 = Conv(deconv2, 96, kernel = (3, 3), pad = (1, 1), stride = (1, 1)) val deconv3 = Deconv(conv5_1, 3, imHw, kernel = (8, 8), pad = (3, 3), out = true, crop = false) val rawOut = (deconv3 * 128) + 128 - val norm = Symbol.SliceChannel()(rawOut)(Map("num_outputs" -> 3)) + val norm = Symbol.api.SliceChannel(data = Some(rawOut), num_outputs = 3) val rCh = norm.get(0) - 123.68f val gCh = norm.get(1) - 116.779f val bCh = norm.get(2) - 103.939f - val normOut = Symbol.Concat()(rCh, gCh, bCh)() * 0.4f + data * 0.6f - normOut + val normOut = Symbol.api.Concat(data = Array(rCh, gCh, bCh), num_args = 3) + normOut * 0.4f + data * 0.6f } def getModule(prefix: String, dShape: Shape, ctx: Context, isTrain: Boolean = true): Module = { diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala index 876a0529b69e..df027673abb8 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala @@ -17,78 +17,41 @@ package org.apache.mxnetexamples.neuralstyle.end2end -import org.apache.mxnet.Symbol -import org.apache.mxnet.Shape -import org.apache.mxnet.Context -import org.apache.mxnet.Xavier +import org.apache.mxnet.{Context, Shape, Symbol, Xavier} + -/** - * @author Depeng Liang - */ object GenV4 { - def Conv(data: Symbol, numFilter: Int, kernel: (Int, Int) = (5, 5), - pad: (Int, Int) = (2, 2), stride: (Int, Int) = (2, 2)): Symbol = { - var sym = Symbol.Convolution()()(Map("data" -> data, "num_filter" -> numFilter, - "kernel" -> s"$kernel", "stride" -> s"$stride", "pad" -> s"$pad", "no_bias" -> false)) - sym = Symbol.BatchNorm()()(Map("data" -> sym, "fix_gamma" -> false)) - sym = Symbol.LeakyReLU()()(Map("data" -> sym, "act_type" -> "leaky")) + def Conv(data: Symbol, numFilter: Int, workspace : Long, kernel: (Int, Int) = (5, 5), + pad: (Int, Int) = (2, 2)): Symbol = { + var sym = Symbol.api.Convolution(data = Some(data), num_filter = numFilter, + kernel = Shape(kernel._1, kernel._2), workspace = Some(workspace), + pad = Some(Shape(pad._1, pad._2)), no_bias = Some(false)) + sym = Symbol.api.BatchNorm(data = Some(sym), fix_gamma = Some(false)) + sym = Symbol.api.LeakyReLU(data = Some(sym), act_type = Some("leaky")) sym } - def Deconv(data: Symbol, numFilter: Int, imHw: (Int, Int), kernel: (Int, Int) = (6, 6), - pad: (Int, Int) = (2, 2), stride: (Int, Int) = (2, 2), out: Boolean = false): Symbol = { - var sym = Symbol.Deconvolution()()(Map("data" -> data, "num_filter" -> numFilter, - "kernel" -> s"$kernel", "stride" -> s"$stride", "pad" -> s"$pad", "no_bias" -> true)) - sym = Symbol.BatchNorm()()(Map("data" -> sym, "fix_gamma" -> false)) - if (out == false) Symbol.LeakyReLU()()(Map("data" -> sym, "act_type" -> "leaky")) - else Symbol.Activation()()(Map("data" -> sym, "act_type" -> "tanh")) - } - def getGenerator(prefix: String, imHw: (Int, Int)): Symbol = { val data = Symbol.Variable(s"${prefix}_data") - var conv1_1 = Symbol.Convolution()()(Map("data" -> data, "num_filter" -> 48, - "kernel" -> "(5, 5)", "pad" -> "(2, 2)", "no_bias" -> false, "workspace" -> 4096)) - conv1_1 = Symbol.BatchNorm()()(Map("data" -> conv1_1, "fix_gamma" -> false)) - conv1_1 = Symbol.LeakyReLU()()(Map("data" -> conv1_1, "act_type" -> "leaky")) - - var conv2_1 = Symbol.Convolution()()(Map("data" -> conv1_1, "num_filter" -> 32, - "kernel" -> "(5, 5)", "pad" -> "(2, 2)", "no_bias" -> false, "workspace" -> 4096)) - conv2_1 = Symbol.BatchNorm()()(Map("data" -> conv2_1, "fix_gamma" -> false)) - conv2_1 = Symbol.LeakyReLU()()(Map("data" -> conv2_1, "act_type" -> "leaky")) - - var conv3_1 = Symbol.Convolution()()(Map("data" -> conv2_1, "num_filter" -> 64, - "kernel" -> "(3, 3)", "pad" -> "(1, 1)", "no_bias" -> false, "workspace" -> 4096)) - conv3_1 = Symbol.BatchNorm()()(Map("data" -> conv3_1, "fix_gamma" -> false)) - conv3_1 = Symbol.LeakyReLU()()(Map("data" -> conv3_1, "act_type" -> "leaky")) - - var conv4_1 = Symbol.Convolution()()(Map("data" -> conv3_1, "num_filter" -> 32, - "kernel" -> "(5, 5)", "pad" -> "(2, 2)", "no_bias" -> false, "workspace" -> 4096)) - conv4_1 = Symbol.BatchNorm()()(Map("data" -> conv4_1, "fix_gamma" -> false)) - conv4_1 = Symbol.LeakyReLU()()(Map("data" -> conv4_1, "act_type" -> "leaky")) - - var conv5_1 = Symbol.Convolution()()(Map("data" -> conv4_1, "num_filter" -> 48, - "kernel" -> "(5, 5)", "pad" -> "(2, 2)", "no_bias" -> false, "workspace" -> 4096)) - conv5_1 = Symbol.BatchNorm()()(Map("data" -> conv5_1, "fix_gamma" -> false)) - conv5_1 = Symbol.LeakyReLU()()(Map("data" -> conv5_1, "act_type" -> "leaky")) - - var conv6_1 = Symbol.Convolution()()(Map("data" -> conv5_1, "num_filter" -> 32, - "kernel" -> "(5, 5)", "pad" -> "(2, 2)", "no_bias" -> true, "workspace" -> 4096)) - conv6_1 = Symbol.BatchNorm()()(Map("data" -> conv6_1, "fix_gamma" -> false)) - conv6_1 = Symbol.LeakyReLU()()(Map("data" -> conv6_1, "act_type" -> "leaky")) - - var out = Symbol.Convolution()()(Map("data" -> conv6_1, "num_filter" -> 3, "kernel" -> "(3, 3)", - "pad" -> "(1, 1)", "no_bias" -> true, "workspace" -> 4096)) - out = Symbol.BatchNorm()()(Map("data" -> out, "fix_gamma" -> false)) - out = Symbol.Activation()()(Map("data" -> out, "act_type" -> "tanh")) + var conv1_1 = Conv(data, 48, 4096) + val conv2_1 = Conv(conv1_1, 32, 4096) + var conv3_1 = Conv(conv2_1, 64, 4096, (3, 3), (1, 1)) + var conv4_1 = Conv(conv3_1, 32, 4096) + var conv5_1 = Conv(conv4_1, 48, 4096) + var conv6_1 = Conv(conv5_1, 32, 4096) + var out = Symbol.api.Convolution(data = Some(conv6_1), num_filter = 3, kernel = Shape(3, 3), + pad = Some(Shape(1, 1)), no_bias = Some(true), workspace = Some(4096)) + out = Symbol.api.BatchNorm(data = Some(out), fix_gamma = Some(false)) + out = Symbol.api.Activation(data = Some(out), act_type = "tanh") val rawOut = (out * 128) + 128 - val norm = Symbol.SliceChannel()(rawOut)(Map("num_outputs" -> 3)) + val norm = Symbol.api.SliceChannel(data = Some(rawOut), num_outputs = 3) val rCh = norm.get(0) - 123.68f val gCh = norm.get(1) - 116.779f val bCh = norm.get(2) - 103.939f - val normOut = Symbol.Concat()(rCh, gCh, bCh)() * 0.4f + data * 0.6f - normOut + val normOut = Symbol.api.Concat(data = Array(rCh, gCh, bCh), num_args = 3) + normOut * 0.4f + data * 0.6f } def getModule(prefix: String, dShape: Shape, ctx: Context, isTrain: Boolean = true): Module = { diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/ModelVgg19.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/ModelVgg19.scala deleted file mode 100644 index 6044847be4ad..000000000000 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/ModelVgg19.scala +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.mxnetexamples.neuralstyle.end2end - -import org.apache.mxnet.Executor -import org.apache.mxnet.NDArray -import org.apache.mxnet.Symbol - - -object ModelVgg19 { - - def getVggSymbol(prefix: String, contentOnly: Boolean = false): (Symbol, Symbol) = { - // declare symbol - val data = Symbol.Variable(s"${prefix}_data") - val conv1_1 = Symbol.Convolution(s"${prefix}_conv1_1")()(Map("data" -> data, - "num_filter" -> 64, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu1_1 = Symbol.Activation(s"${prefix}_relu1_1")()(Map("data" -> conv1_1, - "act_type" -> "relu")) - val conv1_2 = Symbol.Convolution(s"${prefix}_conv1_2")()(Map("data" -> relu1_1, - "num_filter" -> 64, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu1_2 = Symbol.Activation(s"${prefix}_relu1_2")()(Map("data" -> conv1_2, - "act_type" -> "relu")) - val pool1 = Symbol.Pooling(s"${prefix}_pool1")()(Map("data" -> relu1_2 , "pad" -> "(0,0)", - "kernel" -> "(2,2)", "stride" -> "(2,2)", "pool_type" -> "avg")) - val conv2_1 = Symbol.Convolution(s"${prefix}_conv2_1")()(Map("data" -> pool1, - "num_filter" -> 128, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu2_1 = Symbol.Activation(s"${prefix}_relu2_1")()(Map("data" -> conv2_1, - "act_type" -> "relu")) - val conv2_2 = Symbol.Convolution(s"${prefix}_conv2_2")()(Map("data" -> relu2_1, - "num_filter" -> 128, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu2_2 = Symbol.Activation(s"${prefix}_relu2_2")()(Map("data" -> conv2_2, - "act_type" -> "relu")) - val pool2 = Symbol.Pooling("pool2")()(Map("data" -> relu2_2 , "pad" -> "(0,0)", - "kernel" -> "(2,2)", "stride" -> "(2,2)", "pool_type" -> "avg")) - val conv3_1 = Symbol.Convolution(s"${prefix}_conv3_1")()(Map("data" -> pool2, - "num_filter" -> 256, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu3_1 = Symbol.Activation(s"${prefix}_relu3_1")()(Map("data" -> conv3_1, - "act_type" -> "relu")) - val conv3_2 = Symbol.Convolution(s"${prefix}_conv3_2")()(Map("data" -> relu3_1, - "num_filter" -> 256, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu3_2 = Symbol.Activation(s"${prefix}_relu3_2")()(Map("data" -> conv3_2, - "act_type" -> "relu")) - val conv3_3 = Symbol.Convolution(s"${prefix}_conv3_3")()(Map("data" -> relu3_2, - "num_filter" -> 256, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu3_3 = Symbol.Activation(s"${prefix}_relu3_3")()(Map("data" -> conv3_3, - "act_type" -> "relu")) - val conv3_4 = Symbol.Convolution(s"${prefix}_conv3_4")()(Map("data" -> relu3_3, - "num_filter" -> 256, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu3_4 = Symbol.Activation(s"${prefix}_relu3_4")()(Map("data" -> conv3_4 , - "act_type" -> "relu")) - val pool3 = Symbol.Pooling(s"${prefix}_pool3")()(Map("data" -> relu3_4, - "pad" -> "(0,0)", "kernel" -> "(2,2)", "stride" -> "(2,2)", - "pool_type" -> "avg")) - val conv4_1 = Symbol.Convolution(s"${prefix}_conv4_1")()(Map("data" -> pool3, - "num_filter" -> 512, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu4_1 = Symbol.Activation(s"${prefix}_relu4_1")()(Map("data" -> conv4_1, - "act_type" -> "relu")) - val conv4_2 = Symbol.Convolution(s"${prefix}_conv4_2")()(Map("data" -> relu4_1, - "num_filter" -> 512, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu4_2 = Symbol.Activation(s"${prefix}_relu4_2")()(Map("data" -> conv4_2, - "act_type" -> "relu")) - val conv4_3 = Symbol.Convolution(s"${prefix}_conv4_3")()(Map("data" -> relu4_2, - "num_filter" -> 512, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu4_3 = Symbol.Activation(s"${prefix}_relu4_3")()(Map("data" -> conv4_3, - "act_type" -> "relu")) - val conv4_4 = Symbol.Convolution(s"${prefix}_conv4_4")()(Map("data" -> relu4_3, - "num_filter" -> 512, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu4_4 = Symbol.Activation(s"${prefix}_relu4_4")()(Map("data" -> conv4_4, - "act_type" -> "relu")) - val pool4 = Symbol.Pooling(s"${prefix}_pool4")()(Map("data" -> relu4_4, - "pad" -> "(0,0)", "kernel" -> "(2,2)", "stride" -> "(2,2)", - "pool_type" -> "avg")) - val conv5_1 = Symbol.Convolution(s"${prefix}_conv5_1")()(Map("data" -> pool4, - "num_filter" -> 512, "pad" -> "(1,1)", "kernel" -> "(3,3)", - "stride" -> "(1,1)", "no_bias" -> false, "workspace" -> 1024)) - val relu5_1 = Symbol.Activation(s"${prefix}_relu5_1")()(Map("data" -> conv5_1, - "act_type" -> "relu")) - - // style and content layers - val style = if (contentOnly) null else Symbol.Group(relu1_1, relu2_1, relu3_1, relu4_1, relu5_1) - val content = Symbol.Group(relu4_2) - (style, content) - } -} diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Module.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Module.scala index d681b16c5af8..1d11f8864063 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Module.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Module.scala @@ -17,20 +17,9 @@ package org.apache.mxnetexamples.neuralstyle.end2end -import org.apache.mxnet.Context +import org.apache.mxnet.{Context, Initializer, NDArray, Optimizer, Shape, Symbol, Uniform} import org.slf4j.LoggerFactory -import org.apache.mxnet.Symbol -import org.apache.mxnet.NDArray -import org.apache.mxnet.Optimizer -import org.apache.mxnet.Executor -import org.apache.mxnet.Shape -import org.apache.mxnet.Uniform -import org.apache.mxnet.Initializer -import org.apache.mxnet.DataBatch - -/** - * @author Depeng Liang - */ + class Module(symbol: Symbol, context: Context, dataShapes: Map[String, Shape], diff --git a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/imclassification/MNISTExampleSuite.scala b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/imclassification/MNISTExampleSuite.scala index 7b1d6ddc38b5..0fd3af02d9cf 100644 --- a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/imclassification/MNISTExampleSuite.scala +++ b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/imclassification/MNISTExampleSuite.scala @@ -29,8 +29,7 @@ import org.slf4j.LoggerFactory import scala.sys.process.Process /** - * Integration test for imageClassifier example. - * This will run as a part of "make scalatest" + * Integration test for MNIST example. */ class MNISTExampleSuite extends FunSuite with BeforeAndAfterAll { private val logger = LoggerFactory.getLogger(classOf[MNISTExampleSuite]) diff --git a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala new file mode 100644 index 000000000000..a59a97780ee2 --- /dev/null +++ b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.mxnetexamples.neuralstyle + +import java.io.File +import java.net.URL + +import org.apache.commons.io.FileUtils +import org.apache.mxnet.Context +import org.apache.mxnetexamples.neuralstyle.end2end.BoostInference +import org.scalatest.{BeforeAndAfterAll, FunSuite} +import org.slf4j.LoggerFactory + +import scala.sys.process.Process + +/** + * Neural Suite Test package + * Currently there is no plan to run to test accuracy + * This test is just to verify the model is runnable + */ +class NeuralStyleSuite extends FunSuite with BeforeAndAfterAll { + private val logger = LoggerFactory.getLogger(classOf[NeuralStyleSuite]) + + def downloadUrl(url: String, filePath: String) : Unit = { + val tmpFile = new File(filePath) + if (!tmpFile.exists()) { + FileUtils.copyURLToFile(new URL(url), tmpFile) + } + } + + test("Example CI: Test Boost Inference") { + logger.info("Downloading vgg model") + val tempDirPath = System.getProperty("java.io.tmpdir") + logger.info("tempDirPath: %s".format(tempDirPath)) + val baseUrl = "https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/" + downloadUrl(baseUrl + "IMG_4343.jpg", tempDirPath + "/NS/IMG_4343.jpg") + downloadUrl(baseUrl + "model.zip", tempDirPath + "/NS/model.zip") + var ctx = Context.cpu() + if (System.getenv().containsKey("SCALA_TEST_ON_GPU") && + System.getenv("SCALA_TEST_ON_GPU").toInt == 1) { + ctx = Context.gpu() + } + + // TODO: Need to confirm with Windows + Process("unzip " + tempDirPath + "/NS/model.zip -d " + + tempDirPath + "/NS/") ! + + BoostInference.runInference(tempDirPath + "/NS/model", tempDirPath + "/NS", 2, + tempDirPath + "/NS/IMG_4343.jpg", ctx) + } +} From a52c5f6c085ad12cfe5afda5346c80e27bd48233 Mon Sep 17 00:00:00 2001 From: Qing Date: Mon, 9 Jul 2018 15:29:34 -0700 Subject: [PATCH 2/9] Add two more test and README --- .../neuralstyle/NeuralStyle.scala | 191 +++++++------- .../mxnetexamples/neuralstyle/README.md | 83 +++++++ .../neuralstyle/end2end/BoostTrain.scala | 233 +++++++++--------- .../mxnetexamples/gan/GanExampleSuite.scala | 2 +- .../neuralstyle/NeuralStyleSuite.scala | 49 +++- 5 files changed, 347 insertions(+), 211 deletions(-) create mode 100644 scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/README.md diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala index 22a1d269a9bf..e11c1c6d7027 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala @@ -155,104 +155,117 @@ object NeuralStyle { Math.sqrt(array.map(x => x * x).sum.toDouble).toFloat } - def main(args: Array[String]): Unit = { - val alle = new NeuralStyle - val parser: CmdLineParser = new CmdLineParser(alle) - try { - parser.parseArgument(args.toList.asJava) - assert(alle.contentImage != null && alle.styleImage != null - && alle.modelPath != null && alle.outputDir != null) + //scalastyle:off + def runTraining(model : String, contentImage : String, styleImage: String, dev : Context, + modelPath : String, outputDir : String, styleWeight : Float, + contentWeight : Float, tvWeight : Float, gaussianRadius : Int, + lr: Float, maxNumEpochs: Int, maxLongEdge: Int, + saveEpochs : Int, stopEps: Float) : Unit = { + + val contentNp = preprocessContentImage(contentImage, maxLongEdge, dev) + val styleNp = preprocessStyleImage(styleImage, contentNp.shape, dev) + val size = (contentNp.shape(2), contentNp.shape(3)) + + val (style, content) = ModelVgg19.getSymbol + val (gram, gScale) = styleGramSymbol(size, style) + var modelExecutor = ModelVgg19.getExecutor(gram, content, modelPath, size, dev) + + modelExecutor.data.set(styleNp) + modelExecutor.executor.forward() + + val styleArray = modelExecutor.style.map(_.copyTo(Context.cpu())) + modelExecutor.data.set(contentNp) + modelExecutor.executor.forward() + val contentArray = modelExecutor.content.copyTo(Context.cpu()) + + // delete the executor + modelExecutor = null + + val (styleLoss, contentLoss) = getLoss(gram, content) + modelExecutor = ModelVgg19.getExecutor( + styleLoss, contentLoss, modelPath, size, dev) + + val gradArray = { + var tmpGA = Array[NDArray]() + for (i <- 0 until styleArray.length) { + modelExecutor.argDict(s"target_gram_$i").set(styleArray(i)) + tmpGA = tmpGA :+ NDArray.ones(Shape(1), dev) * (styleWeight / gScale(i)) + } + tmpGA :+ NDArray.ones(Shape(1), dev) * contentWeight + } - val dev = if (alle.gpu >= 0) Context.gpu(alle.gpu) else Context.cpu(0) - val contentNp = preprocessContentImage(alle.contentImage, alle.maxLongEdge, dev) - val styleNp = preprocessStyleImage(alle.styleImage, contentNp.shape, dev) - val size = (contentNp.shape(2), contentNp.shape(3)) + modelExecutor.argDict("target_content").set(contentArray) - val (style, content) = ModelVgg19.getSymbol - val (gram, gScale) = styleGramSymbol(size, style) - var modelExecutor = ModelVgg19.getExecutor(gram, content, alle.modelPath, size, dev) + // train + val img = Random.uniform(-0.1f, 0.1f, contentNp.shape, dev) + val lrFS = new FactorScheduler(step = 10, factor = 0.9f) - modelExecutor.data.set(styleNp) - modelExecutor.executor.forward() + saveImage(contentNp, s"${outputDir}/input.jpg", gaussianRadius) + saveImage(styleNp, s"${outputDir}/style.jpg", gaussianRadius) - val styleArray = modelExecutor.style.map(_.copyTo(Context.cpu())) - modelExecutor.data.set(contentNp) - modelExecutor.executor.forward() - val contentArray = modelExecutor.content.copyTo(Context.cpu()) + val optimizer = new Adam( + learningRate = lr, + wd = 0.005f, + lrScheduler = lrFS) + val optimState = optimizer.createState(0, img) - // delete the executor - modelExecutor = null + logger.info(s"start training arguments") - val (styleLoss, contentLoss) = getLoss(gram, content) - modelExecutor = ModelVgg19.getExecutor( - styleLoss, contentLoss, alle.modelPath, size, dev) + var oldImg = img.copyTo(dev) + val clipNorm = img.shape.toVector.reduce(_ * _) + val tvGradExecutor = getTvGradExecutor(img, dev, tvWeight) + var eps = 0f + var trainingDone = false + var e = 0 + while (e < maxNumEpochs && !trainingDone) { + modelExecutor.data.set(img) + modelExecutor.executor.forward() + modelExecutor.executor.backward(gradArray) - val gradArray = { - var tmpGA = Array[NDArray]() - for (i <- 0 until styleArray.length) { - modelExecutor.argDict(s"target_gram_$i").set(styleArray(i)) - tmpGA = tmpGA :+ NDArray.ones(Shape(1), dev) * (alle.styleWeight / gScale(i)) - } - tmpGA :+ NDArray.ones(Shape(1), dev) * alle.contentWeight + val gNorm = NDArray.norm(modelExecutor.dataGrad).toScalar + if (gNorm > clipNorm) { + modelExecutor.dataGrad.set(modelExecutor.dataGrad * (clipNorm / gNorm)) } - - modelExecutor.argDict("target_content").set(contentArray) - - // train - val img = Random.uniform(-0.1f, 0.1f, contentNp.shape, dev) - val lr = new FactorScheduler(step = 10, factor = 0.9f) - - saveImage(contentNp, s"${alle.outputDir}/input.jpg", alle.guassianRadius) - saveImage(styleNp, s"${alle.outputDir}/style.jpg", alle.guassianRadius) - - val optimizer = new Adam( - learningRate = alle.lr, - wd = 0.005f, - lrScheduler = lr) - val optimState = optimizer.createState(0, img) - - logger.info(s"start training arguments $alle") - - var oldImg = img.copyTo(dev) - val clipNorm = img.shape.toVector.reduce(_ * _) - val tvGradExecutor = getTvGradExecutor(img, dev, alle.tvWeight) - var eps = 0f - var trainingDone = false - var e = 0 - while (e < alle.maxNumEpochs && !trainingDone) { - modelExecutor.data.set(img) - modelExecutor.executor.forward() - modelExecutor.executor.backward(gradArray) - - val gNorm = NDArray.norm(modelExecutor.dataGrad).toScalar - if (gNorm > clipNorm) { - modelExecutor.dataGrad.set(modelExecutor.dataGrad * (clipNorm / gNorm)) - } - tvGradExecutor match { - case Some(executor) => { - executor.forward() - optimizer.update(0, img, - modelExecutor.dataGrad + executor.outputs(0), - optimState) - } - case None => - optimizer.update(0, img, modelExecutor.dataGrad, optimState) + tvGradExecutor match { + case Some(executor) => { + executor.forward() + optimizer.update(0, img, + modelExecutor.dataGrad + executor.outputs(0), + optimState) } - eps = (NDArray.norm(oldImg - img) / NDArray.norm(img)).toScalar - oldImg.set(img) - logger.info(s"epoch $e, relative change $eps") + case None => + optimizer.update(0, img, modelExecutor.dataGrad, optimState) + } + eps = (NDArray.norm(oldImg - img) / NDArray.norm(img)).toScalar + oldImg.set(img) + logger.info(s"epoch $e, relative change $eps") - if (eps < alle.stopEps) { - logger.info("eps < args.stop_eps, training finished") - trainingDone = true - } - if ((e + 1) % alle.saveEpochs == 0) { - saveImage(img, s"${alle.outputDir}/tmp_${e + 1}.jpg", alle.guassianRadius) - } - e = e + 1 + if (eps < stopEps) { + logger.info("eps < args.stop_eps, training finished") + trainingDone = true + } + if ((e + 1) % saveEpochs == 0) { + saveImage(img, s"${outputDir}/tmp_${e + 1}.jpg", gaussianRadius) } - saveImage(img, s"${alle.outputDir}/out.jpg", alle.guassianRadius) - logger.info("Finish fit ...") + e = e + 1 + } + saveImage(img, s"${outputDir}/out.jpg", gaussianRadius) + logger.info("Finish fit ...") + } + + def main(args: Array[String]): Unit = { + val alle = new NeuralStyle + val parser: CmdLineParser = new CmdLineParser(alle) + try { + parser.parseArgument(args.toList.asJava) + assert(alle.contentImage != null && alle.styleImage != null + && alle.modelPath != null && alle.outputDir != null) + + val dev = if (alle.gpu >= 0) Context.gpu(alle.gpu) else Context.cpu(0) + runTraining(alle.model, alle.contentImage, alle.styleImage, dev, alle.modelPath, + alle.outputDir, alle.styleWeight, alle.contentWeight, alle.tvWeight, + alle.gaussianRadius, alle.lr, alle.maxNumEpochs, alle.maxLongEdge, + alle.saveEpochs, alle.stopEps) } catch { case ex: Exception => { logger.error(ex.getMessage, ex) @@ -292,6 +305,6 @@ class NeuralStyle { private val outputDir: String = null @Option(name = "--save-epochs", usage = "save the output every n epochs") private val saveEpochs: Int = 50 - @Option(name = "--guassian-radius", usage = "the gaussian blur filter radius") - private val guassianRadius: Int = 1 + @Option(name = "--gaussian-radius", usage = "the gaussian blur filter radius") + private val gaussianRadius: Int = 1 } diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/README.md b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/README.md new file mode 100644 index 000000000000..fe849343c9d7 --- /dev/null +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/README.md @@ -0,0 +1,83 @@ +# Neural Style Example for Scala + +## Introduction +This model contains three important components: +- Boost Inference +- Boost Training +- Neural Style conversion + +You can use the prebuilt VGG model to do the conversion. +By adding a style image, you can create several interesting images. + +Original Image | Style Image +:-------------------------:|:-------------------------: +![](https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/IMG_4343.jpg) | ![](https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/starry_night.jpg) + +Boost Inference Image (pretrained) | Epoch 150 Image +:-------------------------:|:-------------------------: +![](https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/out_3.jpg) | ![](https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/tmp_150.jpg) + +## Setup +Please download the input image and style image following the links below: + +Input image +```bash +https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/IMG_4343.jpg +``` +Style image +```bash +https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/starry_night.jpg +``` + +VGG model --Boost inference +```bash +https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/model.zip +``` + +VGG model --Boost Training +```bash +https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/vgg19.params +``` + +Please unzip the model before you use it. + +## Boost Inference Example + +Please provide the corresponding arguments before you execute the program +```bash +--input-image +/IMG_4343.jpg +--model-path +/model +--output-path + +``` + +## Boost Training Example +Please download your own training data for boost training. +You can use 26k images sampled from [MIT Place dataset](http://places.csail.mit.edu/). +```bash +--style-image +/starry_night.jpg +--data-path +/images +--vgg-model-path +/vgg19.params +--save-model-path + +``` + +## NeuralStyle Example +Please provide the corresponding arguments before you execute the program +```bash +--model-path +/vgg19.params +--content-image +/IMG_4343.jpg +--style-image +/starry_night.jpg +--gpu + +--output-dir + +``` \ No newline at end of file diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostTrain.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostTrain.scala index eb7007a1ce4f..08b4c85d2c55 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostTrain.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/BoostTrain.scala @@ -54,130 +54,135 @@ object BoostTrain { out.bind(ctx, Map("img" -> img, "kernel" -> kernel)) } - def main(args: Array[String]): Unit = { - val stin = new BoostTrain - val parser: CmdLineParser = new CmdLineParser(stin) - try { - parser.parseArgument(args.toList.asJava) - assert(stin.dataPath != null - && stin.vggModelPath != null - && stin.saveModelPath != null - && stin.styleImage != null) - // params - val vggParams = NDArray.load2Map(stin.vggModelPath) - val styleWeight = 1.2f - val contentWeight = 10f - val dShape = Shape(1, 3, 384, 384) - val clipNorm = 0.05f * dShape.product - val modelPrefix = "v3" - val ctx = if (stin.gpu == -1) Context.cpu() else Context.gpu(stin.gpu) - - // init style - val styleNp = DataProcessing.preprocessStyleImage(stin.styleImage, dShape, ctx) - var styleMod = Basic.getStyleModule("style", dShape, ctx, vggParams) - styleMod.forward(Array(styleNp)) - val styleArray = styleMod.getOutputs().map(_.copyTo(Context.cpu())) - styleMod.dispose() - styleMod = null - - // content - val contentMod = Basic.getContentModule("content", dShape, ctx, vggParams) - - // loss - val (loss, gScale) = Basic.getLossModule("loss", dShape, ctx, vggParams) - val extraArgs = (0 until styleArray.length) - .map( i => s"target_gram_$i" -> styleArray(i)).toMap - loss.setParams(extraArgs) - var gradArray = Array[NDArray]() - for (i <- 0 until styleArray.length) { - gradArray = gradArray :+ (NDArray.ones(Shape(1), ctx) * (styleWeight / gScale(i))) - } - gradArray = gradArray :+ (NDArray.ones(Shape(1), ctx) * contentWeight) - - // generator - val gens = Array( - GenV4.getModule("g0", dShape, ctx), - GenV3.getModule("g1", dShape, ctx), - GenV3.getModule("g2", dShape, ctx), - GenV4.getModule("g3", dShape, ctx) - ) - gens.foreach { gen => - val opt = new SGD(learningRate = 1e-4f, - momentum = 0.9f, - wd = 5e-3f, - clipGradient = 5f) - gen.initOptimizer(opt) - } + def runTraining(dataPath : String, vggModelPath: String, ctx : Context, + styleImage : String, saveModelPath : String) : Unit = { + // params + val vggParams = NDArray.load2Map(vggModelPath) + val styleWeight = 1.2f + val contentWeight = 10f + val dShape = Shape(1, 3, 384, 384) + val clipNorm = 0.05f * dShape.product + val modelPrefix = "v3" + // init style + val styleNp = DataProcessing.preprocessStyleImage(styleImage, dShape, ctx) + var styleMod = Basic.getStyleModule("style", dShape, ctx, vggParams) + styleMod.forward(Array(styleNp)) + val styleArray = styleMod.getOutputs().map(_.copyTo(Context.cpu())) + styleMod.dispose() + styleMod = null + + // content + val contentMod = Basic.getContentModule("content", dShape, ctx, vggParams) + + // loss + val (loss, gScale) = Basic.getLossModule("loss", dShape, ctx, vggParams) + val extraArgs = (0 until styleArray.length) + .map( i => s"target_gram_$i" -> styleArray(i)).toMap + loss.setParams(extraArgs) + var gradArray = Array[NDArray]() + for (i <- 0 until styleArray.length) { + gradArray = gradArray :+ (NDArray.ones(Shape(1), ctx) * (styleWeight / gScale(i))) + } + gradArray = gradArray :+ (NDArray.ones(Shape(1), ctx) * contentWeight) + + // generator + val gens = Array( + GenV4.getModule("g0", dShape, ctx), + GenV3.getModule("g1", dShape, ctx), + GenV3.getModule("g2", dShape, ctx), + GenV4.getModule("g3", dShape, ctx) + ) + gens.foreach { gen => + val opt = new SGD(learningRate = 1e-4f, + momentum = 0.9f, + wd = 5e-3f, + clipGradient = 5f) + gen.initOptimizer(opt) + } - var filelist = new File(stin.dataPath).list().toList - val numImage = filelist.length - logger.info(s"Dataset size: $numImage") + var filelist = new File(dataPath).list().toList + val numImage = filelist.length + logger.info(s"Dataset size: $numImage") - val tvWeight = 1e-2f + val tvWeight = 1e-2f - val startEpoch = 0 - val endEpoch = 3 + val startEpoch = 0 + val endEpoch = 3 - for (k <- 0 until gens.length) { - val path = new File(s"${stin.saveModelPath}/$k") - if (!path.exists()) path.mkdir() - } + for (k <- 0 until gens.length) { + val path = new File(s"${saveModelPath}/$k") + if (!path.exists()) path.mkdir() + } - // train - for (i <- startEpoch until endEpoch) { - filelist = Random.shuffle(filelist) - for (idx <- filelist.indices) { - var dataArray = Array[NDArray]() - var lossGradArray = Array[NDArray]() - val data = - DataProcessing.preprocessContentImage(s"${stin.dataPath}/${filelist(idx)}", dShape, ctx) - dataArray = dataArray :+ data - // get content - contentMod.forward(Array(data)) - // set target content - loss.setParams(Map("target_content" -> contentMod.getOutputs()(0))) - // gen_forward - for (k <- 0 until gens.length) { - gens(k).forward(dataArray.takeRight(1)) - dataArray = dataArray :+ gens(k).getOutputs()(0) - // loss forward - loss.forward(dataArray.takeRight(1)) - loss.backward(gradArray) - lossGradArray = lossGradArray :+ loss.getInputGrads()(0) - } - val grad = NDArray.zeros(data.shape, ctx) - for (k <- gens.length - 1 to 0 by -1) { - val tvGradExecutor = getTvGradExecutor(gens(k).getOutputs()(0), ctx, tvWeight) - tvGradExecutor.forward() - grad += lossGradArray(k) + tvGradExecutor.outputs(0) - val gNorm = NDArray.norm(grad) - if (gNorm.toScalar > clipNorm) { - grad *= clipNorm / gNorm.toScalar - } - gens(k).backward(Array(grad)) - gens(k).update() - gNorm.dispose() - tvGradExecutor.dispose() + // train + for (i <- startEpoch until endEpoch) { + filelist = Random.shuffle(filelist) + for (idx <- filelist.indices) { + var dataArray = Array[NDArray]() + var lossGradArray = Array[NDArray]() + val data = + DataProcessing.preprocessContentImage(s"${dataPath}/${filelist(idx)}", dShape, ctx) + dataArray = dataArray :+ data + // get content + contentMod.forward(Array(data)) + // set target content + loss.setParams(Map("target_content" -> contentMod.getOutputs()(0))) + // gen_forward + for (k <- 0 until gens.length) { + gens(k).forward(dataArray.takeRight(1)) + dataArray = dataArray :+ gens(k).getOutputs()(0) + // loss forward + loss.forward(dataArray.takeRight(1)) + loss.backward(gradArray) + lossGradArray = lossGradArray :+ loss.getInputGrads()(0) + } + val grad = NDArray.zeros(data.shape, ctx) + for (k <- gens.length - 1 to 0 by -1) { + val tvGradExecutor = getTvGradExecutor(gens(k).getOutputs()(0), ctx, tvWeight) + tvGradExecutor.forward() + grad += lossGradArray(k) + tvGradExecutor.outputs(0) + val gNorm = NDArray.norm(grad) + if (gNorm.toScalar > clipNorm) { + grad *= clipNorm / gNorm.toScalar } - grad.dispose() - if (idx % 20 == 0) { - logger.info(s"Epoch $i: Image $idx") - for (k <- 0 until gens.length) { - val n = NDArray.norm(gens(k).getInputGrads()(0)) - logger.info(s"Data Norm : ${n.toScalar / dShape.product}") - n.dispose() - } + gens(k).backward(Array(grad)) + gens(k).update() + gNorm.dispose() + tvGradExecutor.dispose() + } + grad.dispose() + if (idx % 20 == 0) { + logger.info(s"Epoch $i: Image $idx") + for (k <- 0 until gens.length) { + val n = NDArray.norm(gens(k).getInputGrads()(0)) + logger.info(s"Data Norm : ${n.toScalar / dShape.product}") + n.dispose() } - if (idx % 1000 == 0) { - for (k <- 0 until gens.length) { - gens(k).saveParams( - s"${stin.saveModelPath}/$k/${modelPrefix}_" + - s"${"%04d".format(i)}-${"%07d".format(idx)}.params") - } + } + if (idx % 1000 == 0) { + for (k <- 0 until gens.length) { + gens(k).saveParams( + s"${saveModelPath}/$k/${modelPrefix}_" + + s"${"%04d".format(i)}-${"%07d".format(idx)}.params") } - data.dispose() } + data.dispose() } + } + } + + def main(args: Array[String]): Unit = { + val stin = new BoostTrain + val parser: CmdLineParser = new CmdLineParser(stin) + try { + parser.parseArgument(args.toList.asJava) + assert(stin.dataPath != null + && stin.vggModelPath != null + && stin.saveModelPath != null + && stin.styleImage != null) + + val ctx = if (stin.gpu == -1) Context.cpu() else Context.gpu(stin.gpu) + runTraining(stin.dataPath, stin.vggModelPath, ctx, stin.styleImage, stin.saveModelPath) } catch { case ex: Exception => { logger.error(ex.getMessage, ex) diff --git a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala index 8ab3a4b364a7..08a5a99d692a 100644 --- a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala +++ b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala @@ -47,7 +47,7 @@ class GanExampleSuite extends FunSuite with BeforeAndAfterAll{ val context = Context.gpu() - val output = GanMnist.runTraining(modelDirPath, context, modelDirPath, 5) + val output = GanMnist.runTraining(modelDirPath, context, modelDirPath, 2) Process("rm -rf " + modelDirPath) ! assert(output >= 0.0f) diff --git a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala index a59a97780ee2..1b657e8ebdac 100644 --- a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala +++ b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala @@ -22,7 +22,7 @@ import java.net.URL import org.apache.commons.io.FileUtils import org.apache.mxnet.Context -import org.apache.mxnetexamples.neuralstyle.end2end.BoostInference +import org.apache.mxnetexamples.neuralstyle.end2end.{BoostInference, BoostTrain} import org.scalatest.{BeforeAndAfterAll, FunSuite} import org.slf4j.LoggerFactory @@ -43,24 +43,59 @@ class NeuralStyleSuite extends FunSuite with BeforeAndAfterAll { } } - test("Example CI: Test Boost Inference") { + override def beforeAll(): Unit = { logger.info("Downloading vgg model") val tempDirPath = System.getProperty("java.io.tmpdir") logger.info("tempDirPath: %s".format(tempDirPath)) val baseUrl = "https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/" downloadUrl(baseUrl + "IMG_4343.jpg", tempDirPath + "/NS/IMG_4343.jpg") + downloadUrl(baseUrl + "starry_night.jpg", tempDirPath + "/NS/starry_night.jpg") downloadUrl(baseUrl + "model.zip", tempDirPath + "/NS/model.zip") + downloadUrl(baseUrl + "vgg19.params", tempDirPath + "/NS/vgg19.params") + // TODO: Need to confirm with Windows + Process(s"unzip $tempDirPath/NS/model.zip -d $tempDirPath/NS/") ! + + Process(s"mkdir $tempDirPath/NS/images") ! + + for (i <- 0 until 20) { + Process(s"cp $tempDirPath/NS/IMG_4343.jpg $tempDirPath/NS/images/img$i.jpg") ! + } + } + + test("Example CI: Test Boost Inference") { + val tempDirPath = System.getProperty("java.io.tmpdir") var ctx = Context.cpu() if (System.getenv().containsKey("SCALA_TEST_ON_GPU") && System.getenv("SCALA_TEST_ON_GPU").toInt == 1) { ctx = Context.gpu() } - - // TODO: Need to confirm with Windows - Process("unzip " + tempDirPath + "/NS/model.zip -d " - + tempDirPath + "/NS/") ! - BoostInference.runInference(tempDirPath + "/NS/model", tempDirPath + "/NS", 2, tempDirPath + "/NS/IMG_4343.jpg", ctx) } + + test("Example CI: Test Boost Training") { + val tempDirPath = System.getProperty("java.io.tmpdir") + if (System.getenv().containsKey("SCALA_TEST_ON_GPU") && + System.getenv("SCALA_TEST_ON_GPU").toInt == 1) { + val ctx = Context.gpu() + BoostTrain.runTraining(tempDirPath + "/NS/images", tempDirPath + "/NS/vgg19.params", ctx, + tempDirPath + "/NS/starry_night.jpg", tempDirPath + "/NS") + } else { + logger.info("GPU test only, skip CPU...") + } + } + + test("Example CI: Test Neural Style") { + val tempDirPath = System.getProperty("java.io.tmpdir") + if (System.getenv().containsKey("SCALA_TEST_ON_GPU") && + System.getenv("SCALA_TEST_ON_GPU").toInt == 1) { + val ctx = Context.gpu() + NeuralStyle.runTraining("vgg19", tempDirPath + "/NS/IMG_4343.jpg", + tempDirPath + "/NS/starry_night.jpg", + ctx, tempDirPath + "/NS/vgg19.params", tempDirPath + "/NS", + 1f, 20f, 0.01f, 1, 10f, 60, 600, 50, 0.0005f) + } else { + logger.info("GPU test only, skip CPU") + } + } } From 7e649df69ac9121c8195c4abcfbbb160675a7037 Mon Sep 17 00:00:00 2001 From: Qing Date: Mon, 9 Jul 2018 15:33:14 -0700 Subject: [PATCH 3/9] kill comments --- .../apache/mxnetexamples/neuralstyle/end2end/Basic.scala | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Basic.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Basic.scala index e7dc439188ee..56303253f33d 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Basic.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/Basic.scala @@ -74,11 +74,6 @@ object Basic { shape = Some(Shape(shape(1), shape(2) * shape(3)))) val gram = Symbol.api.FullyConnected(data = Some(x), weight = Some(x), no_bias = Some(true), num_hidden = shape(1)) -// val x = Symbol.Reshape()()(Map("data" -> style.get(i), -// "shape" -> Shape(shape(1), shape(2) * shape(3)))) -// // use fully connected to quickly do dot(x, x^T) -// val gram = Symbol.FullyConnected()()(Map("data" -> x, "weight" -> x, -// "no_bias" -> true, "num_hidden" -> shape(1))) gramList = gramList :+ gram gradScale = gradScale :+ (shape(1) * shape(2) * shape(3) * shape(1)) } @@ -92,11 +87,9 @@ object Basic { gramLoss = gramLoss :+ Symbol.api.sum(Some( Symbol.api.square(Some(gvar - gram.get(i))) )) -// gramLoss = gramLoss :+ Symbol.sum()(Symbol.square()(gvar - gram.get(i))())() } val cvar = Symbol.Variable("target_content") val contentLoss = Symbol.api.sum(Some(Symbol.api.square(Some(cvar - content)))) -// val contentLoss = Symbol.sum()(Symbol.square()(cvar - content)())() (Symbol.Group(gramLoss: _*), contentLoss) } From 777e9a38ee12c78d9c33708ed7f0a31326149e21 Mon Sep 17 00:00:00 2001 From: Qing Date: Tue, 10 Jul 2018 00:44:21 -0700 Subject: [PATCH 4/9] patch on memory leaks fix --- .../neuralstyle/ModelVgg19.scala | 26 +++++----- .../neuralstyle/NeuralStyle.scala | 49 ++++++++++++------- .../neuralstyle/end2end/GenV3.scala | 22 +++++---- .../neuralstyle/end2end/GenV4.scala | 22 +++++---- 4 files changed, 71 insertions(+), 48 deletions(-) diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/ModelVgg19.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/ModelVgg19.scala index afaea5ad3649..ca4c242ab1ce 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/ModelVgg19.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/ModelVgg19.scala @@ -20,11 +20,11 @@ package org.apache.mxnetexamples.neuralstyle import org.apache.mxnet.{Context, Executor, NDArray, Shape, Symbol} /** - * Definition for the neuralstyle network and initialize it with pretrained weight - */ + * Definition for the neuralstyle network and initialize it with pretrained weight + */ object ModelVgg19 { case class ConvExecutor(executor: Executor, data: NDArray, dataGrad: NDArray, - style: Array[NDArray], content: NDArray, argDict: Map[String, NDArray]) + style: Array[NDArray], content: NDArray, argDict: Map[String, NDArray]) def ConvRelu(data : Symbol, convName : String, reluName : String, numFilter : Int, kernel : (Int, Int) = (3, 3), @@ -33,7 +33,9 @@ object ModelVgg19 { pad = Some(Shape(1, 1)), kernel = Shape(kernel._1, kernel._2), stride = Some(Shape(stride._1, stride._2)), no_bias = Some(false), workspace = Some(1024), name = convName) - Symbol.api.relu(data = Some(conv), name = reluName) + val relu = Symbol.api.relu(data = Some(conv), name = reluName) + conv.dispose() + relu } def getSymbol: (Symbol, Symbol) = { @@ -81,7 +83,7 @@ object ModelVgg19 { } def getExecutor(style: Symbol, content: Symbol, modelPath: String, - inputSize: (Int, Int), ctx: Context): ConvExecutor = { + inputSize: (Int, Int), ctx: Context): ConvExecutor = { val out = Symbol.Group(style, content) // make executor val (argShapes, outputShapes, auxShapes) = out.inferShape( @@ -95,15 +97,17 @@ object ModelVgg19 { val key = s"arg:$name" if (pretrained.contains(key)) argDict(name).set(pretrained(key)) } + pretrained.foreach(ele => ele._2.dispose()) val executor = out.bind(ctx, argDict, gradDict) + out.dispose() val outArray = executor.outputs ConvExecutor(executor = executor, - data = argDict("data"), - dataGrad = gradDict("data"), - style = outArray.take(outArray.length - 1), - content = outArray(outArray.length - 1), - argDict = argDict) - } + data = argDict("data"), + dataGrad = gradDict("data"), + style = outArray.take(outArray.length - 1), + content = outArray(outArray.length - 1), + argDict = argDict) + } def getModel(modelPath: String, inputSize: (Int, Int), ctx: Context): ConvExecutor = { val (style, content) = getSymbol diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala index e11c1c6d7027..f98d725c2304 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyle.scala @@ -28,10 +28,11 @@ import org.kohsuke.args4j.{CmdLineParser, Option} import org.slf4j.LoggerFactory import scala.collection.JavaConverters._ +import scala.collection.mutable.ListBuffer /** - * An Implementation of the paper A Neural Algorithm of Artistic Style - */ + * An Implementation of the paper A Neural Algorithm of Artistic Style + */ object NeuralStyle { case class NSExecutor(executor: Executor, data: NDArray, dataGrad: NDArray) @@ -108,11 +109,11 @@ object NeuralStyle { var gradScale = List[Int]() for (i <- 0 until style.listOutputs().length) { val shape = outputShape(i) - val x = Symbol.Reshape()()(Map("data" -> style.get(i), - "target_shape" -> Shape(shape(1), shape(2) * shape(3)))) - // use fully connected to quickly do dot(x, x^T) - val gram = Symbol.FullyConnected()()(Map("data" -> x, "weight" -> x, - "no_bias" -> true, "num_hidden" -> shape(1))) + val x = Symbol.api.Reshape(data = Some(style.get(i)), + target_shape = Some(Shape(shape(1), shape(2) * shape(3)))) + val gram = Symbol.api.FullyConnected(data = Some(x), weight = Some(x), + no_bias = Some(true), num_hidden = shape(1)) + x.dispose() gramList = gramList :+ gram gradScale = gradScale :+ (shape(1) * shape(2) * shape(3) * shape(1)) } @@ -120,13 +121,20 @@ object NeuralStyle { } def getLoss(gram: Symbol, content: Symbol): (Symbol, Symbol) = { - var gramLoss = List[Symbol]() + var gramLoss = ListBuffer[Symbol]() for (i <- 0 until gram.listOutputs().length) { val gvar = Symbol.Variable(s"target_gram_$i") - gramLoss = gramLoss :+ Symbol.sum()(Symbol.square()(gvar - gram.get(i))())() + Symbol.api.square(data = Some(gvar - gram.get(i))) + gramLoss += Symbol.api.sum( + Some(Symbol.api.square(data = Some(gvar - gram.get(i)))) + ) + gvar.dispose() } + gram.dispose() val cvar = Symbol.Variable("target_content") - val contentLoss = Symbol.sum()(Symbol.square()(cvar - content)())() + val contentLoss = Symbol.api.sum( + Some(Symbol.api.square(Some(cvar - content))) + ) (Symbol.Group(gramLoss: _*), contentLoss) } @@ -137,12 +145,13 @@ object NeuralStyle { val nChannel = img.shape(1) val sImg = Symbol.Variable("img") val sKernel = Symbol.Variable("kernel") - val channels = Symbol.SliceChannel()(sImg)(Map("num_outputs" -> nChannel)) - val out = Symbol.Concat()((0 until nChannel).map { i => - Symbol.Convolution()()(Map("data" -> channels.get(i), "weight" -> sKernel, - "num_filter" -> 1, "kernel" -> "(3,3)", "pad" -> "(1,1)", - "no_bias" -> true, "stride" -> "(1,1)")) - }: _*)() * tvWeight + val channels = Symbol.api.SliceChannel(data = Some(sImg), num_outputs = nChannel) + val result = (0 until nChannel).map { i => + Symbol.api.Convolution(data = Some(channels.get(i)), weight = Some(sKernel), + num_filter = 1, kernel = Shape(3, 3), pad = Some(Shape(1, 1)), no_bias = Some(true), + stride = Some(Shape(1, 1))) + }.toArray + val out = Symbol.api.Concat(result, result.length) * tvWeight val kernel = { val tmp = NDArray.empty(Shape(1, 1, 3, 3), ctx) tmp.set(Array[Float](0, -1, 0, -1, 4, -1, 0, -1, 0)) @@ -157,7 +166,7 @@ object NeuralStyle { //scalastyle:off def runTraining(model : String, contentImage : String, styleImage: String, dev : Context, - modelPath : String, outputDir : String, styleWeight : Float, + modelPath : String, outputDir : String, styleWeight : Float, contentWeight : Float, tvWeight : Float, gaussianRadius : Int, lr: Float, maxNumEpochs: Int, maxLongEdge: Int, saveEpochs : Int, stopEps: Float) : Unit = { @@ -179,6 +188,12 @@ object NeuralStyle { val contentArray = modelExecutor.content.copyTo(Context.cpu()) // delete the executor + modelExecutor.argDict.foreach(ele => ele._2.dispose()) + modelExecutor.content.dispose() + modelExecutor.data.dispose() + modelExecutor.dataGrad.dispose() + modelExecutor.style.foreach(_.dispose()) + modelExecutor.executor.dispose() modelExecutor = null val (styleLoss, contentLoss) = getLoss(gram, content) diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV3.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV3.scala index d36698cc122f..d7ab59e28402 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV3.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV3.scala @@ -22,18 +22,20 @@ import org.apache.mxnet.{Context, Shape, Symbol, Xavier} object GenV3 { def Conv(data: Symbol, numFilter: Int, kernel: (Int, Int) = (5, 5), - pad: (Int, Int) = (2, 2), stride: (Int, Int) = (2, 2)): Symbol = { - var sym = Symbol.api.Convolution(data = Some(data), num_filter = numFilter, + pad: (Int, Int) = (2, 2), stride: (Int, Int) = (2, 2)): Symbol = { + val sym1 = Symbol.api.Convolution(data = Some(data), num_filter = numFilter, kernel = Shape(kernel._1, kernel._2), stride = Some(Shape(stride._1, stride._2)), pad = Some(Shape(pad._1, pad._2)), no_bias = Some(false)) - sym = Symbol.api.BatchNorm(data = Some(sym), fix_gamma = Some(false)) - sym = Symbol.api.LeakyReLU(data = Some(sym), act_type = Some("leaky")) - sym + val sym2 = Symbol.api.BatchNorm(data = Some(sym1), fix_gamma = Some(false)) + val sym3 = Symbol.api.LeakyReLU(data = Some(sym2), act_type = Some("leaky")) + sym2.dispose() + sym1.dispose() + sym3 } def Deconv(data: Symbol, numFilter: Int, imHw: (Int, Int), - kernel: (Int, Int) = (7, 7), pad: (Int, Int) = (2, 2), stride: (Int, Int) = (2, 2), - crop: Boolean = true, out: Boolean = false): Symbol = { + kernel: (Int, Int) = (7, 7), pad: (Int, Int) = (2, 2), stride: (Int, Int) = (2, 2), + crop: Boolean = true, out: Boolean = false): Symbol = { var sym = Symbol.api.Deconvolution(data = Some(data), num_filter = numFilter, kernel = Shape(kernel._1, kernel._2), stride = Some(Shape(stride._1, stride._2)), pad = Some(Shape(pad._1, pad._2)), no_bias = Some(true)) @@ -74,9 +76,9 @@ object GenV3 { else (dataShape, false, false) } val mod = new Module(symbol = sym, context = ctx, - dataShapes = dataShapes, - initializer = new Xavier(magnitude = 2f), - forTraining = forTraining, inputsNeedGrad = inputsNeedGrad) + dataShapes = dataShapes, + initializer = new Xavier(magnitude = 2f), + forTraining = forTraining, inputsNeedGrad = inputsNeedGrad) mod } } diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala index df027673abb8..f3afd4d9f623 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala @@ -23,13 +23,15 @@ import org.apache.mxnet.{Context, Shape, Symbol, Xavier} object GenV4 { def Conv(data: Symbol, numFilter: Int, workspace : Long, kernel: (Int, Int) = (5, 5), - pad: (Int, Int) = (2, 2)): Symbol = { - var sym = Symbol.api.Convolution(data = Some(data), num_filter = numFilter, + pad: (Int, Int) = (2, 2)): Symbol = { + val sym1 = Symbol.api.Convolution(data = Some(data), num_filter = numFilter, kernel = Shape(kernel._1, kernel._2), workspace = Some(workspace), pad = Some(Shape(pad._1, pad._2)), no_bias = Some(false)) - sym = Symbol.api.BatchNorm(data = Some(sym), fix_gamma = Some(false)) - sym = Symbol.api.LeakyReLU(data = Some(sym), act_type = Some("leaky")) - sym + val sym2 = Symbol.api.BatchNorm(data = Some(sym1), fix_gamma = Some(false)) + val sym3 = Symbol.api.LeakyReLU(data = Some(sym2), act_type = Some("leaky")) + sym2.dispose() + sym1.dispose() + sym3 } def getGenerator(prefix: String, imHw: (Int, Int)): Symbol = { @@ -41,7 +43,7 @@ object GenV4 { var conv4_1 = Conv(conv3_1, 32, 4096) var conv5_1 = Conv(conv4_1, 48, 4096) var conv6_1 = Conv(conv5_1, 32, 4096) - var out = Symbol.api.Convolution(data = Some(conv6_1), num_filter = 3, kernel = Shape(3, 3), + var out = Symbol.api.Convolution(data = Some(conv6_1), num_filter = 3, kernel = Shape(3,3), pad = Some(Shape(1, 1)), no_bias = Some(true), workspace = Some(4096)) out = Symbol.api.BatchNorm(data = Some(out), fix_gamma = Some(false)) out = Symbol.api.Activation(data = Some(out), act_type = "tanh") @@ -62,9 +64,9 @@ object GenV4 { else (dataShape, false, false) } val mod = new Module(symbol = sym, context = ctx, - dataShapes = dataShapes, - initializer = new Xavier(magnitude = 2f), - forTraining = forTraining, inputsNeedGrad = inputsNeedGrad) + dataShapes = dataShapes, + initializer = new Xavier(magnitude = 2f), + forTraining = forTraining, inputsNeedGrad = inputsNeedGrad) mod } -} +} \ No newline at end of file From b3aa14621ad763381003973a05b9b08c7457f410 Mon Sep 17 00:00:00 2001 From: Qing Date: Tue, 10 Jul 2018 10:27:17 -0700 Subject: [PATCH 5/9] fix formatting issues --- .../org/apache/mxnet/NDArrayAPIBase.scala | 6859 +++++++++ .../scala/org/apache/mxnet/NDArrayBase.scala | 11488 ++++++++++++++++ .../org/apache/mxnet/SymbolAPIBase.scala | 6859 +++++++++ .../scala/org/apache/mxnet/SymbolBase.scala | 5755 ++++++++ .../neuralstyle/end2end/GenV4.scala | 4 +- 5 files changed, 30963 insertions(+), 2 deletions(-) create mode 100644 scala-package/core/src/main/scala/org/apache/mxnet/NDArrayAPIBase.scala create mode 100644 scala-package/core/src/main/scala/org/apache/mxnet/NDArrayBase.scala create mode 100644 scala-package/core/src/main/scala/org/apache/mxnet/SymbolAPIBase.scala create mode 100644 scala-package/core/src/main/scala/org/apache/mxnet/SymbolBase.scala diff --git a/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayAPIBase.scala b/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayAPIBase.scala new file mode 100644 index 000000000000..ddc1d9a526a6 --- /dev/null +++ b/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayAPIBase.scala @@ -0,0 +1,6859 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// scalastyle:off +package org.apache.mxnet +import org.apache.mxnet.annotation.Experimental +abstract class NDArrayAPIBase { + /** + * Applies an activation function element-wise to the input.
+ *
+ * The following activation functions are supported:
+ *
+ * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
+ * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
+ * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
+ * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
+ * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
+ *
+ *
+ *
+ * Defined in src/operator/nn/activation.cc:L161
+ * @param data The input array. + * @param act_type Activation function to be applied. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Activation (data : org.apache.mxnet.NDArray, act_type : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Batch normalization.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
+ * two outputs are blocked.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
+ * axis to be the last item in the input shape.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/nn/batch_norm.cc:L575
+ * @param data Input data to batch normalization + * @param gamma gamma array + * @param beta beta array + * @param moving_mean running mean of input + * @param moving_var running variance of input + * @param eps Epsilon to prevent div 0. Must be no less than CUDNN_BN_MIN_EPSILON defined in cudnn.h when using cudnn (usually 1e-5) + * @param momentum Momentum for moving average + * @param fix_gamma Fix gamma while training + * @param use_global_stats Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator. + * @param output_mean_var Output the mean and inverse std + * @param axis Specify which shape axis the channel is specified + * @param cudnn_off Do not select CUDNN operator, if available + * @return org.apache.mxnet.NDArray + */ +@Experimental +def BatchNorm (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, beta : org.apache.mxnet.NDArray, moving_mean : org.apache.mxnet.NDArray, moving_var : org.apache.mxnet.NDArray, eps : Option[Double] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, fix_gamma : Option[Boolean] = None, use_global_stats : Option[Boolean] = None, output_mean_var : Option[Boolean] = None, axis : Option[Int] = None, cudnn_off : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Batch normalization.
+ *
+ * This operator is DEPRECATED. Perform BatchNorm on the input.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_var`` as well, which are needed for the backward pass.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/batch_norm_v1.cc:L92
+ * @param data Input data to batch normalization + * @param gamma gamma array + * @param beta beta array + * @param eps Epsilon to prevent div 0 + * @param momentum Momentum for moving average + * @param fix_gamma Fix gamma while training + * @param use_global_stats Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator. + * @param output_mean_var Output All,normal mean and var + * @return org.apache.mxnet.NDArray + */ +@Experimental +def BatchNorm_v1 (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, beta : org.apache.mxnet.NDArray, eps : Option[org.apache.mxnet.Base.MXFloat] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, fix_gamma : Option[Boolean] = None, use_global_stats : Option[Boolean] = None, output_mean_var : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies bilinear sampling to input feature map.
+ *
+ * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
+ * except that the operator has the backward pass.
+ *
+ * Given :math:`data` and :math:`grid`, then the output is computed by
+ *
+ * .. math::
+ * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
+ * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
+ * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
+ *
+ * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
+ * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
+ *
+ * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
+ *
+ * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
+ * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
+ * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
+ *
+ * Example 1::
+ *
+ * ## Zoom out data two times
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * affine_matrix = array([[2, 0, 0],
+ * [0, 2, 0]])
+ *
+ * affine_matrix = reshape(affine_matrix, shape=(1, 6))
+ *
+ * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
+ *
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 0, 0, 0, 0],
+ * [ 0, 3.5, 6.5, 0],
+ * [ 0, 1.25, 2.5, 0],
+ * [ 0, 0, 0, 0]]]
+ *
+ *
+ * Example 2::
+ *
+ * ## shift data horizontally by -1 pixel
+ *
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * warp_maxtrix = array([[[[1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1]],
+ * [[0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0]]]])
+ *
+ * grid = GridGenerator(data=warp_matrix, transform_type='warp')
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 4, 3, 6, 0],
+ * [ 8, 8, 9, 0],
+ * [ 4, 1, 5, 0],
+ * [ 0, 1, 3, 0]]]
+ *
+ *
+ * Defined in src/operator/bilinear_sampler.cc:L245
+ * @param data Input data to the BilinearsamplerOp. + * @param grid Input grid to the BilinearsamplerOp.grid has two channels: x_src, y_src + * @return org.apache.mxnet.NDArray + */ +@Experimental +def BilinearSampler (data : org.apache.mxnet.NDArray, grid : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def BlockGrad (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @param data The input. + * @param dtype Output data type. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Cast (data : org.apache.mxnet.NDArray, dtype : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @param data List of arrays to concatenate + * @param num_args Number of inputs to be concated. + * @param dim the dimension to be concated. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Concat (data : Array[org.apache.mxnet.NDArray], num_args : Int, dim : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Compute *N*-D convolution on *(N+2)*-D input.
+ *
+ * In the 2-D convolution, given input data with shape *(batch_size,
+ * channel, height, width)*, the output is computed by
+ *
+ * .. math::
+ *
+ * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
+ * weight[i,j,:,:]
+ *
+ * where :math:`\star` is the 2-D cross-correlation operator.
+ *
+ * For general 2-D convolution, the shapes are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*.
+ *
+ * Define::
+ *
+ * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
+ *
+ * then we have::
+ *
+ * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
+ * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
+ * width)*. We can choose other layouts such as *NHWC*.
+ *
+ * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
+ * evenly into *g* parts along the channel axis, and also evenly split ``weight``
+ * along the first dimension. Next compute the convolution on the *i*-th part of
+ * the data with the *i*-th weight part. The output is obtained by concatenating all
+ * the *g* results.
+ *
+ * 1-D convolution does not have *height* dimension but only *width* in space.
+ *
+ * - **data**: *(batch_size, channel, width)*
+ * - **weight**: *(num_filter, channel, kernel[0])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * 3-D convolution adds an additional *depth* dimension besides *height* and
+ * *width*. The shapes are
+ *
+ * - **data**: *(batch_size, channel, depth, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
+ *
+ * Both ``weight`` and ``bias`` are learnable parameters.
+ *
+ * There are other options to tune the performance.
+ *
+ * - **cudnn_tune**: enable this option leads to higher startup time but may give
+ * faster speed. Options are
+ *
+ * - **off**: no tuning
+ * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
+ * exceed workspace limit.
+ * - **fastest**: pick the fastest algorithm and ignore workspace limit.
+ * - **None** (default): the behavior is determined by environment variable
+ * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
+ * (default), 2 for fastest.
+ *
+ * - **workspace**: A large number leads to more (GPU) memory usage but may improve
+ * the performance.
+ *
+ *
+ *
+ * Defined in src/operator/nn/convolution.cc:L470
+ * @param data Input data to the ConvolutionOp. + * @param weight Weight matrix. + * @param bias Bias parameter. + * @param kernel Convolution kernel size: (w,), (h, w) or (d, h, w) + * @param stride Convolution stride: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. + * @param dilate Convolution dilate: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. + * @param pad Zero pad for convolution: (w,), (h, w) or (d, h, w). Defaults to no padding. + * @param num_filter Convolution filter(channel) number + * @param num_group Number of group partitions. + * @param workspace Maximum temporary workspace allowed (MB) in convolution.This parameter has two usages. When CUDNN is not used, it determines the effective batch size of the convolution kernel. When CUDNN is used, it controls the maximum temporary storage used for tuning the best CUDNN kernel when `limited_workspace` strategy is used. + * @param no_bias Whether to disable bias parameter. + * @param cudnn_tune Whether to pick convolution algo by running performance test. + * @param cudnn_off Turn off cudnn for this layer. + * @param layout Set layout for input, output and weight. Empty for + default layout: NCW for 1d, NCHW for 2d and NCDHW for 3d. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Convolution (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, bias : org.apache.mxnet.NDArray, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * This operator is DEPRECATED. Apply convolution to input then add a bias.
+ * @param data Input data to the ConvolutionV1Op. + * @param weight Weight matrix. + * @param bias Bias parameter. + * @param kernel convolution kernel size: (h, w) or (d, h, w) + * @param stride convolution stride: (h, w) or (d, h, w) + * @param dilate convolution dilate: (h, w) or (d, h, w) + * @param pad pad for convolution: (h, w) or (d, h, w) + * @param num_filter convolution filter(channel) number + * @param num_group Number of group partitions. Equivalent to slicing input into num_group + partitions, apply convolution on each, then concatenate the results + * @param workspace Maximum temporary workspace allowed for convolution (MB).This parameter determines the effective batch size of the convolution kernel, which may be smaller than the given batch size. Also, the workspace will be automatically enlarged to make sure that we can run the kernel with batch_size=1 + * @param no_bias Whether to disable bias parameter. + * @param cudnn_tune Whether to pick convolution algo by running performance test. + Leads to higher startup time but may give faster speed. Options are: + 'off': no tuning + 'limited_workspace': run test and pick the fastest algorithm that doesn't exceed workspace limit. + 'fastest': pick the fastest algorithm and ignore workspace limit. + If set to None (default), behavior is determined by environment + variable MXNET_CUDNN_AUTOTUNE_DEFAULT: 0 for off, + 1 for limited workspace (default), 2 for fastest. + * @param cudnn_off Turn off cudnn for this layer. + * @param layout Set layout for input, output and weight. Empty for + default layout: NCHW for 2d and NCDHW for 3d. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Convolution_v1 (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, bias : org.apache.mxnet.NDArray, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies correlation to inputs.
+ *
+ * The correlation layer performs multiplicative patch comparisons between two feature maps.
+ *
+ * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
+ * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
+ *
+ * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
+ * :math:`x_{2}` in the second map is then defined as:
+ *
+ * .. math::
+ *
+ * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
+ *
+ * for a square patch of size :math:`K:=2k+1`.
+ *
+ * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
+ * data. For this reason, it has no training weights.
+ *
+ * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
+ *
+ * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
+ * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
+ * centered around :math:`x_{1}`.
+ *
+ * The final output is defined by the following expression:
+ *
+ * .. math::
+ * out[n, q, i, j] = c(x_{i, j}, x_{q})
+ *
+ * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
+ *
+ *
+ * Defined in src/operator/correlation.cc:L198
+ * @param data1 Input data1 to the correlation. + * @param data2 Input data2 to the correlation. + * @param kernel_size kernel size for Correlation must be an odd number + * @param max_displacement Max displacement of Correlation + * @param stride1 stride1 quantize data1 globally + * @param stride2 stride2 quantize data2 within the neighborhood centered around data1 + * @param pad_size pad for Correlation + * @param is_multiply operation type is either multiplication or subduction + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Correlation (data1 : org.apache.mxnet.NDArray, data2 : org.apache.mxnet.NDArray, kernel_size : Option[Int] = None, max_displacement : Option[Int] = None, stride1 : Option[Int] = None, stride2 : Option[Int] = None, pad_size : Option[Int] = None, is_multiply : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + *
+ *
+ * .. note:: `Crop` is deprecated. Use `slice` instead.
+ *
+ * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
+ * with width and height of the second input symbol, i.e., with one input, we need h_w to
+ * specify the crop height and width, otherwise the second input symbol's size will be used
+ *
+ *
+ * Defined in src/operator/crop.cc:L50
+ * @param data Tensor or List of Tensors, the second input will be used as crop_like shape reference + * @param num_args Number of inputs for crop, if equals one, then we will use the h_wfor crop height and width, else if equals two, then we will use the heightand width of the second input symbol, we name crop_like here + * @param offset crop offset coordinate: (y, x) + * @param h_w crop height and width: (h, w) + * @param center_crop If set to true, then it will use be the center_crop,or it will crop using the shape of crop_like + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Crop (data : Array[org.apache.mxnet.NDArray], num_args : Int, offset : Option[org.apache.mxnet.Shape] = None, h_w : Option[org.apache.mxnet.Shape] = None, center_crop : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Apply a custom operator implemented in a frontend language (like Python).
+ *
+ * Custom operators should override required methods like `forward` and `backward`.
+ * The custom operator must be registered before it can be used.
+ * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
+ *
+ *
+ *
+ * Defined in src/operator/custom/custom.cc:L547
+ * @param data Input data for the custom operator. + * @param op_type Name of the custom operator. This is the name that is passed to `mx.operator.register` to register the operator. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Custom (data : Array[org.apache.mxnet.NDArray], op_type : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
+ * @param data Input tensor to the deconvolution operation. + * @param weight Weights representing the kernel. + * @param bias Bias added to the result after the deconvolution operation. + * @param kernel Deconvolution kernel size: (w,), (h, w) or (d, h, w). This is same as the kernel size used for the corresponding convolution + * @param stride The stride used for the corresponding convolution: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. + * @param dilate Dilation factor for each dimension of the input: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. + * @param pad The amount of implicit zero padding added during convolution for each dimension of the input: (w,), (h, w) or (d, h, w). ``(kernel-1)/2`` is usually a good choice. If `target_shape` is set, `pad` will be ignored and a padding that will generate the target shape will be used. Defaults to no padding. + * @param adj Adjustment for output shape: (w,), (h, w) or (d, h, w). If `target_shape` is set, `adj` will be ignored and computed accordingly. + * @param target_shape Shape of the output tensor: (w,), (h, w) or (d, h, w). + * @param num_filter Number of output filters. + * @param num_group Number of groups partition. + * @param workspace Maximum temporary workspace allowed (MB) in deconvolution.This parameter has two usages. When CUDNN is not used, it determines the effective batch size of the deconvolution kernel. When CUDNN is used, it controls the maximum temporary storage used for tuning the best CUDNN kernel when `limited_workspace` strategy is used. + * @param no_bias Whether to disable bias parameter. + * @param cudnn_tune Whether to pick convolution algorithm by running performance test. + * @param cudnn_off Turn off cudnn for this layer. + * @param layout Set layout for input, output and weight. Empty for default layout, NCW for 1d, NCHW for 2d and NCDHW for 3d. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Deconvolution (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, bias : org.apache.mxnet.NDArray, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, adj : Option[org.apache.mxnet.Shape] = None, target_shape : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies dropout operation to input array.
+ *
+ * - During training, each element of the input is set to zero with probability p.
+ * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
+ * sum of the input unchanged.
+ *
+ * - During testing, this operator does not change the input if mode is 'training'.
+ * If mode is 'always', the same computaion as during training will be applied.
+ *
+ * Example::
+ *
+ * random.seed(998)
+ * input_array = array([[3., 0.5, -0.5, 2., 7.],
+ * [2., -0.4, 7., 3., 0.2]])
+ * a = symbol.Variable('a')
+ * dropout = symbol.Dropout(a, p = 0.2)
+ * executor = dropout.simple_bind(a = input_array.shape)
+ *
+ * ## If training
+ * executor.forward(is_train = True, a = input_array)
+ * executor.outputs
+ * [[ 3.75 0.625 -0. 2.5 8.75 ]
+ * [ 2.5 -0.5 8.75 3.75 0. ]]
+ *
+ * ## If testing
+ * executor.forward(is_train = False, a = input_array)
+ * executor.outputs
+ * [[ 3. 0.5 -0.5 2. 7. ]
+ * [ 2. -0.4 7. 3. 0.2 ]]
+ *
+ *
+ * Defined in src/operator/nn/dropout.cc:L76
+ * @param data Input array to which dropout will be applied. + * @param p Fraction of the input that gets dropped out during training time. + * @param mode Whether to only turn on dropout during training or to also turn on for inference. + * @param axes Axes for variational dropout kernel. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Dropout (data : org.apache.mxnet.NDArray, p : Option[org.apache.mxnet.Base.MXFloat] = None, mode : Option[String] = None, axes : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @param args Positional input arguments + * @return org.apache.mxnet.NDArray + */ +@Experimental +def ElementWiseSum (args : Array[org.apache.mxnet.NDArray], out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Maps integer indices to vector representations (embeddings).
+ *
+ * This operator maps words to real-valued vectors in a high-dimensional space,
+ * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
+ * For example, it has been noted that in the learned embedding spaces, similar words tend
+ * to be close to each other and dissimilar words far apart.
+ *
+ * For an input array of shape (d1, ..., dK),
+ * the shape of an output array is (d1, ..., dK, output_dim).
+ * All the input values should be integers in the range [0, input_dim).
+ *
+ * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
+ * (ip0, op0).
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last vector in an embedding matrix.
+ *
+ * Examples::
+ *
+ * input_dim = 4
+ * output_dim = 5
+ *
+ * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
+ * y = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.],
+ * [ 10., 11., 12., 13., 14.],
+ * [ 15., 16., 17., 18., 19.]]
+ *
+ * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
+ * x = [[ 1., 3.],
+ * [ 0., 2.]]
+ *
+ * // Mapped input x to its vector representation y.
+ * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
+ * [ 15., 16., 17., 18., 19.]],
+ *
+ * [[ 0., 1., 2., 3., 4.],
+ * [ 10., 11., 12., 13., 14.]]]
+ *
+ *
+ * The storage type of weight can be either row_sparse or default, while
+ * the storage type of weight's grad depends on the value of "sparse_grad".
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L232
+ * @param data The input array to the embedding operator. + * @param weight The embedding weight matrix. + * @param input_dim Vocabulary size of the input indices. + * @param output_dim Dimension of the embedding vectors. + * @param dtype Data type of weight. + * @param sparse_grad Compute row sparse gradient in the backward calculation. If set to True, the grad's storage type is row_sparse. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Embedding (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, input_dim : Int, output_dim : Int, dtype : Option[String] = None, sparse_grad : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @param data Input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Flatten (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies a linear transformation: :math:`Y = XW^T + b`.
+ *
+ * If ``flatten`` is set to be true, then the shapes are:
+ *
+ * - **data**: `(batch_size, x1, x2, ..., xn)`
+ * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(batch_size, num_hidden)`
+ *
+ * If ``flatten`` is set to be false, then the shapes are:
+ *
+ * - **data**: `(x1, x2, ..., xn, input_dim)`
+ * - **weight**: `(num_hidden, input_dim)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(x1, x2, ..., xn, num_hidden)`
+ *
+ * The learnable parameters include both ``weight`` and ``bias``.
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * Note that the operator also supports forward computation with `row_sparse` weight and bias,
+ * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
+ * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
+ *
+ *
+ *
+ * Defined in src/operator/nn/fully_connected.cc:L254
+ * @param data Input data. + * @param weight Weight matrix. + * @param bias Bias parameter. + * @param num_hidden Number of hidden nodes of the output. + * @param no_bias Whether to disable bias parameter. + * @param flatten Whether to collapse all but the first axis of the input data tensor. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def FullyConnected (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, bias : org.apache.mxnet.NDArray, num_hidden : Int, no_bias : Option[Boolean] = None, flatten : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Generates 2D sampling grid for bilinear sampling.
+ * @param data Input data to the function. + * @param transform_type The type of transformation. For `affine`, input data should be an affine matrix of size (batch, 6). For `warp`, input data should be an optical flow of size (batch, 2, h, w). + * @param target_shape Specifies the output shape (H, W). This is required if transformation type is `affine`. If transformation type is `warp`, this parameter is ignored. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def GridGenerator (data : org.apache.mxnet.NDArray, transform_type : String, target_shape : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Apply a sparse regularization to the output a sigmoid activation function.
+ * @param data Input data. + * @param sparseness_target The sparseness target + * @param penalty The tradeoff parameter for the sparseness penalty + * @param momentum The momentum for running average + * @return org.apache.mxnet.NDArray + */ +@Experimental +def IdentityAttachKLSparseReg (data : org.apache.mxnet.NDArray, sparseness_target : Option[org.apache.mxnet.Base.MXFloat] = None, penalty : Option[org.apache.mxnet.Base.MXFloat] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies instance normalization to the n-dimensional input array.
+ *
+ * This operator takes an n-dimensional input array where (n>2) and normalizes
+ * the input using the following formula:
+ *
+ * .. math::
+ *
+ * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
+ *
+ * This layer is similar to batch normalization layer (`BatchNorm`)
+ * with two differences: first, the normalization is
+ * carried out per example (instance), not over a batch. Second, the
+ * same normalization is applied both at test and train time. This
+ * operation is also known as `contrast normalization`.
+ *
+ * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
+ * `gamma` and `beta` parameters must be vectors of shape [channel].
+ *
+ * This implementation is based on paper:
+ *
+ * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
+ * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
+ *
+ * Examples::
+ *
+ * // Input of shape (2,1,2)
+ * x = [[[ 1.1, 2.2]],
+ * [[ 3.3, 4.4]]]
+ *
+ * // gamma parameter of length 1
+ * gamma = [1.5]
+ *
+ * // beta parameter of length 1
+ * beta = [0.5]
+ *
+ * // Instance normalization is calculated with the above formula
+ * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
+ * [[-0.99752653, 1.99752724]]]
+ *
+ *
+ *
+ * Defined in src/operator/instance_norm.cc:L95
+ * @param data An n-dimensional input array (n > 2) of the form [batch, channel, spatial_dim1, spatial_dim2, ...]. + * @param gamma A vector of length 'channel', which multiplies the normalized input. + * @param beta A vector of length 'channel', which is added to the product of the normalized input and the weight. + * @param eps An `epsilon` parameter to prevent division by 0. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def InstanceNorm (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, beta : org.apache.mxnet.NDArray, eps : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Normalize the input array using the L2 norm.
+ *
+ * For 1-D NDArray, it computes::
+ *
+ * out = data / sqrt(sum(data ** 2) + eps)
+ *
+ * For N-D NDArray, if the input array has shape (N, N, ..., N),
+ *
+ * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
+ * array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
+ * in the array by its L2 norm.::
+ *
+ * for dim in 2...N
+ * for i in 0...N
+ * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
+ * -dim-
+ *
+ * Example::
+ *
+ * x = [[[1,2],
+ * [3,4]],
+ * [[2,2],
+ * [5,6]]]
+ *
+ * L2Normalization(x, mode='instance')
+ * =[[[ 0.18257418 0.36514837]
+ * [ 0.54772252 0.73029673]]
+ * [[ 0.24077171 0.24077171]
+ * [ 0.60192931 0.72231513]]]
+ *
+ * L2Normalization(x, mode='channel')
+ * =[[[ 0.31622776 0.44721359]
+ * [ 0.94868326 0.89442718]]
+ * [[ 0.37139067 0.31622776]
+ * [ 0.92847669 0.94868326]]]
+ *
+ * L2Normalization(x, mode='spatial')
+ * =[[[ 0.44721359 0.89442718]
+ * [ 0.60000002 0.80000001]]
+ * [[ 0.70710677 0.70710677]
+ * [ 0.6401844 0.76822126]]]
+ *
+ *
+ *
+ * Defined in src/operator/l2_normalization.cc:L98
+ * @param data Input array to normalize. + * @param eps A small constant for numerical stability. + * @param mode Specify the dimension along which to compute L2 norm. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def L2Normalization (data : org.apache.mxnet.NDArray, eps : Option[org.apache.mxnet.Base.MXFloat] = None, mode : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies local response normalization to the input.
+ *
+ * The local response normalization layer performs "lateral inhibition" by normalizing
+ * over local input regions.
+ *
+ * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
+ * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
+ * activity :math:`b_{x,y}^{i}` is given by the expression:
+ *
+ * .. math::
+ * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
+ *
+ * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
+ * number of kernels in the layer.
+ *
+ *
+ *
+ * Defined in src/operator/nn/lrn.cc:L175
+ * @param data Input data to LRN + * @param alpha The variance scaling parameter :math:`lpha` in the LRN expression. + * @param beta The power parameter :math:`eta` in the LRN expression. + * @param knorm The parameter :math:`k` in the LRN expression. + * @param nsize normalization window width in elements. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def LRN (data : org.apache.mxnet.NDArray, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, knorm : Option[org.apache.mxnet.Base.MXFloat] = None, nsize : Int, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Layer normalization.
+ *
+ * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis and then
+ * compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters.
+ *
+ * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_std``. Note that no gradient will be passed through these two outputs.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is -1, which sets the channel
+ * axis to be the last item in the input shape.
+ *
+ *
+ *
+ * Defined in src/operator/nn/layer_norm.cc:L94
+ * @param data Input data to layer normalization + * @param gamma gamma array + * @param beta beta array + * @param axis The axis to perform layer normalization. Usually, this should be be axis of the channel dimension. Negative values means indexing from right to left. + * @param eps An `epsilon` parameter to prevent division by 0. + * @param output_mean_var Output the mean and std calculated along the given axis. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def LayerNorm (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, beta : org.apache.mxnet.NDArray, axis : Option[Int] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, output_mean_var : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies Leaky rectified linear unit activation element-wise to the input.
+ *
+ * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
+ * when the input is negative and has a slope of one when input is positive.
+ *
+ * The following modified ReLU Activation functions are supported:
+ *
+ * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
+ * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
+ * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
+ * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
+ * *[lower_bound, upper_bound)* for training, while fixed to be
+ * *(lower_bound+upper_bound)/2* for inference.
+ *
+ *
+ *
+ * Defined in src/operator/leaky_relu.cc:L63
+ * @param data Input data to activation function. + * @param gamma Slope parameter for PReLU. Only required when act_type is 'prelu'. It should be either a vector of size 1, or the same size as the second dimension of data. + * @param act_type Activation function to be applied. + * @param slope Init slope for the activation. (For leaky and elu only) + * @param lower_bound Lower bound of random slope. (For rrelu only) + * @param upper_bound Upper bound of random slope. (For rrelu only) + * @return org.apache.mxnet.NDArray + */ +@Experimental +def LeakyReLU (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, act_type : Option[String] = None, slope : Option[org.apache.mxnet.Base.MXFloat] = None, lower_bound : Option[org.apache.mxnet.Base.MXFloat] = None, upper_bound : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes and optimizes for squared loss during backward propagation.
+ * Just outputs ``data`` during forward propagation.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the squared loss estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
+ *
+ * .. note::
+ * Use the LinearRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LinearRegressionOutput(default, default) = default
+ * - LinearRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L92
+ * @param data Input data to the function. + * @param label Input label to the function. + * @param grad_scale Scale the gradient by a float factor + * @return org.apache.mxnet.NDArray + */ +@Experimental +def LinearRegressionOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies a logistic function to the input.
+ *
+ * The logistic function, also known as the sigmoid function, is computed as
+ * :math:`\frac{1}{1+exp(-\textbf{x})}`.
+ *
+ * Commonly, the sigmoid is used to squash the real-valued output of a linear model
+ * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
+ * It is suitable for binary classification or probability prediction tasks.
+ *
+ * .. note::
+ * Use the LogisticRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LogisticRegressionOutput(default, default) = default
+ * - LogisticRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L148
+ * @param data Input data to the function. + * @param label Input label to the function. + * @param grad_scale Scale the gradient by a float factor + * @return org.apache.mxnet.NDArray + */ +@Experimental +def LogisticRegressionOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes mean absolute error of the input.
+ *
+ * MAE is a risk metric corresponding to the expected value of the absolute error.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
+ *
+ * .. note::
+ * Use the MAERegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - MAERegressionOutput(default, default) = default
+ * - MAERegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L120
+ * @param data Input data to the function. + * @param label Input label to the function. + * @param grad_scale Scale the gradient by a float factor + * @return org.apache.mxnet.NDArray + */ +@Experimental +def MAERegressionOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = MakeLoss(cross_entropy)
+ *
+ * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * In addition, we can give a scale to the loss by setting ``grad_scale``,
+ * so that the gradient of the loss will be rescaled in the backpropagation.
+ *
+ * .. note:: This operator should be used as a Symbol instead of NDArray.
+ *
+ *
+ *
+ * Defined in src/operator/make_loss.cc:L71
+ * @param data Input array. + * @param grad_scale Gradient scale as a supplement to unary and binary operators + * @param valid_thresh clip each element in the array to 0 when it is less than ``valid_thresh``. This is used when ``normalization`` is set to ``'valid'``. + * @param normalization If this is set to null, the output gradient will not be normalized. If this is set to batch, the output gradient will be divided by the batch size. If this is set to valid, the output gradient will be divided by the number of valid input elements. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def MakeLoss (data : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, valid_thresh : Option[org.apache.mxnet.Base.MXFloat] = None, normalization : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @param data An n-dimensional input array. + * @param mode Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges. + * @param pad_width Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ... , before_N, after_N)``. It should be of length ``2*N`` where ``N`` is the number of dimensions of the array.This is equivalent to pad_width in numpy.pad, but flattened. + * @param constant_value The value used for padding when `mode` is "constant". + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Pad (data : org.apache.mxnet.NDArray, mode : String, pad_width : org.apache.mxnet.Shape, constant_value : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs pooling on the input.
+ *
+ * The shapes for 1-D pooling are
+ *
+ * - **data**: *(batch_size, channel, width)*,
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * The shapes for 2-D pooling are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ * - **lp**: Lp pooling
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ * Notes on Lp pooling:
+ *
+ * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
+ * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
+ * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
+ *
+ * For each window ``X``, the mathematical expression for Lp pooling is:
+ *
+ * ..math::
+ * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
+ *
+ *
+ *
+ * Defined in src/operator/nn/pooling.cc:L367
+ * @param data Input data to the pooling operator. + * @param kernel Pooling kernel size: (y, x) or (d, y, x) + * @param pool_type Pooling type to be applied. + * @param global_pool Ignore kernel size, do global pooling based on current input feature map. + * @param cudnn_off Turn off cudnn pooling and use MXNet pooling operator. + * @param pooling_convention Pooling convention to be applied. + * @param stride Stride: for pooling (y, x) or (d, y, x). Defaults to 1 for each dimension. + * @param pad Pad for pooling: (y, x) or (d, y, x). Defaults to no padding. + * @param p_value Value of p for Lp pooling, can be 1 or 2, required for Lp Pooling. + * @param count_include_pad Only used for AvgPool, specify whether to count padding elements for averagecalculation. For example, with a 5*5 kernel on a 3*3 corner of a image,the sum of the 9 valid elements will be divided by 25 if this is set to true,or it will be divided by 9 if this is set to false. Defaults to true. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Pooling (data : org.apache.mxnet.NDArray, kernel : Option[org.apache.mxnet.Shape] = None, pool_type : Option[String] = None, global_pool : Option[Boolean] = None, cudnn_off : Option[Boolean] = None, pooling_convention : Option[String] = None, stride : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, p_value : Option[Int] = None, count_include_pad : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * This operator is DEPRECATED.
+ * Perform pooling on the input.
+ *
+ * The shapes for 2-D pooling is
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ *
+ * 1-D pooling is special case of 2-D pooling with *weight=1* and
+ * *kernel[1]=1*.
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ *
+ *
+ * Defined in src/operator/pooling_v1.cc:L104
+ * @param data Input data to the pooling operator. + * @param kernel pooling kernel size: (y, x) or (d, y, x) + * @param pool_type Pooling type to be applied. + * @param global_pool Ignore kernel size, do global pooling based on current input feature map. + * @param pooling_convention Pooling convention to be applied. + * @param stride stride: for pooling (y, x) or (d, y, x) + * @param pad pad for pooling: (y, x) or (d, y, x) + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Pooling_v1 (data : org.apache.mxnet.NDArray, kernel : Option[org.apache.mxnet.Shape] = None, pool_type : Option[String] = None, global_pool : Option[Boolean] = None, pooling_convention : Option[String] = None, stride : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
+ * implemented, with both multi-layer and bidirectional support.
+ *
+ * **Vanilla RNN**
+ *
+ * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
+ * ReLU and Tanh.
+ *
+ * With ReLU activation function:
+ *
+ * .. math::
+ * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * With Tanh activtion function:
+ *
+ * .. math::
+ * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * Reference paper: Finding structure in time - Elman, 1988.
+ * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
+ *
+ * **LSTM**
+ *
+ * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
+ * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
+ * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
+ * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
+ * c_t = f_t * c_{(t-1)} + i_t * g_t \\
+ * h_t = o_t * \tanh(c_t)
+ * \end{array}
+ *
+ * **GRU**
+ *
+ * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
+ *
+ * The definition of GRU here is slightly different from paper but compatible with CUDNN.
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
+ * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
+ * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
+ * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
+ * \end{array}
+ * @param data Input data to RNN + * @param parameters Vector of all RNN trainable parameters concatenated + * @param state initial hidden state of the RNN + * @param state_cell initial cell state for LSTM networks (only for LSTM) + * @param state_size size of the state for each layer + * @param num_layers number of stacked layers + * @param bidirectional whether to use bidirectional recurrent layers + * @param mode the type of RNN to compute + * @param p Dropout probability, fraction of the input that gets dropped out at training time + * @param state_outputs Whether to have the states as symbol outputs. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def RNN (data : org.apache.mxnet.NDArray, parameters : org.apache.mxnet.NDArray, state : org.apache.mxnet.NDArray, state_cell : org.apache.mxnet.NDArray, state_size : Int, num_layers : Int, bidirectional : Option[Boolean] = None, mode : String, p : Option[org.apache.mxnet.Base.MXFloat] = None, state_outputs : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs region of interest(ROI) pooling on the input array.
+ *
+ * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
+ * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
+ * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
+ * layer mostly used in training a `Fast R-CNN` network for object detection.
+ *
+ * This operator takes a 4D feature map as an input array and region proposals as `rois`,
+ * then it pools over sub-regions of input and produces a fixed-sized output array
+ * regardless of the ROI size.
+ *
+ * To crop the feature map accordingly, you can resize the bounding box coordinates
+ * by changing the parameters `rois` and `spatial_scale`.
+ *
+ * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
+ * indicated by a `pooled_size` parameter. batch_size will change to the number of region
+ * bounding boxes after `ROIPooling`.
+ *
+ * The size of each region of interest doesn't have to be perfectly divisible by
+ * the number of pooling sections(`pooled_size`).
+ *
+ * Example::
+ *
+ * x = [[[[ 0., 1., 2., 3., 4., 5.],
+ * [ 6., 7., 8., 9., 10., 11.],
+ * [ 12., 13., 14., 15., 16., 17.],
+ * [ 18., 19., 20., 21., 22., 23.],
+ * [ 24., 25., 26., 27., 28., 29.],
+ * [ 30., 31., 32., 33., 34., 35.],
+ * [ 36., 37., 38., 39., 40., 41.],
+ * [ 42., 43., 44., 45., 46., 47.]]]]
+ *
+ * // region of interest i.e. bounding box coordinates.
+ * y = [[0,0,0,4,4]]
+ *
+ * // returns array of shape (2,2) according to the given roi with max pooling.
+ * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
+ * [ 26., 28.]]]]
+ *
+ * // region of interest is changed due to the change in `spacial_scale` parameter.
+ * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
+ * [ 19., 21.]]]]
+ *
+ *
+ *
+ * Defined in src/operator/roi_pooling.cc:L295
+ * @param data The input array to the pooling operator, a 4D Feature maps + * @param rois Bounding box coordinates, a 2D array of [[batch_index, x1, y1, x2, y2]], where (x1, y1) and (x2, y2) are top left and bottom right corners of designated region of interest. `batch_index` indicates the index of corresponding image in the input array + * @param pooled_size ROI pooling output shape (h,w) + * @param spatial_scale Ratio of input feature map height (or w) to raw image height (or w). Equals the reciprocal of total stride in convolutional layers + * @return org.apache.mxnet.NDArray + */ +@Experimental +def ROIPooling (data : org.apache.mxnet.NDArray, rois : org.apache.mxnet.NDArray, pooled_size : org.apache.mxnet.Shape, spatial_scale : org.apache.mxnet.Base.MXFloat, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @param data Input data to reshape. + * @param shape The target shape + * @param reverse If true then the special values are inferred from right to left + * @param target_shape (Deprecated! Use ``shape`` instead.) Target new shape. One and only one dim can be 0, in which case it will be inferred from the rest of dims + * @param keep_highest (Deprecated! Use ``shape`` instead.) Whether keep the highest dim unchanged.If set to true, then the first dim in target_shape is ignored,and always fixed as input + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Reshape (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, reverse : Option[Boolean] = None, target_shape : Option[org.apache.mxnet.Shape] = None, keep_highest : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes support vector machine based transformation of the input.
+ *
+ * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
+ * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
+ * @param data Input data for SVM transformation. + * @param label Class label for the input data. + * @param margin The loss function penalizes outputs that lie outside this margin. Default margin is 1. + * @param regularization_coefficient Regularization parameter for the SVM. This balances the tradeoff between coefficient size and error. + * @param use_linear Whether to use L1-SVM objective. L2-SVM objective is used by default. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def SVMOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, margin : Option[org.apache.mxnet.Base.MXFloat] = None, regularization_coefficient : Option[org.apache.mxnet.Base.MXFloat] = None, use_linear : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Takes the last element of a sequence.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
+ * of the form [batch_size, other_feature_dims].
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
+ * an input array of positive ints of dimension [batch_size]. To use this parameter,
+ * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
+ * to have the max sequence length.
+ *
+ * .. note:: Alternatively, you can also use `take` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]],
+ *
+ * [[ 10., 11., 12.],
+ * [ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]]
+ *
+ * // returns last sequence when sequence_length parameter is not used
+ * SequenceLast(x) = [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 13., 14., 15.],
+ * [ 25., 26., 27.]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_last.cc:L92
+ * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2 + * @param sequence_length vector of sequence lengths of the form [batch_size] + * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence + * @param axis The sequence axis. Only values of 0 and 1 are currently supported. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def SequenceLast (data : org.apache.mxnet.NDArray, sequence_length : org.apache.mxnet.NDArray, use_sequence_length : Option[Boolean] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Sets all elements outside the sequence to a constant value.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
+ * should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length and
+ * this operator works as the `identity` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // works as identity operator when sequence_length parameter is not used
+ * SequenceMask(x) = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [1,1] means 1 of each batch will be kept
+ * // and other rows are masked with default mask value = 0
+ * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
+ * // and other rows are masked with value = 1
+ * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 1., 1.],
+ * [ 16., 17., 18.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_mask.cc:L114
+ * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2 + * @param sequence_length vector of sequence lengths of the form [batch_size] + * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence + * @param value The value to be used as a mask. + * @param axis The sequence axis. Only values of 0 and 1 are currently supported. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def SequenceMask (data : org.apache.mxnet.NDArray, sequence_length : org.apache.mxnet.NDArray, use_sequence_length : Option[Boolean] = None, value : Option[org.apache.mxnet.Base.MXFloat] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reverses the elements of each sequence.
+ *
+ * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
+ * and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences.
+ * `sequence_length` should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // returns reverse sequence when sequence_length parameter is not used
+ * SequenceReverse(x) = [[[ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]]]
+ *
+ * // sequence_length [2,2] means 2 rows of
+ * // both batch B1 and B2 will be reversed.
+ * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
+ * // will be reversed.
+ * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14, 15.],
+ * [ 4., 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_reverse.cc:L113
+ * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other dims] where n>2 + * @param sequence_length vector of sequence lengths of the form [batch_size] + * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence + * @param axis The sequence axis. Only 0 is currently supported. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def SequenceReverse (data : org.apache.mxnet.NDArray, sequence_length : org.apache.mxnet.NDArray, use_sequence_length : Option[Boolean] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @param data The input + * @param num_outputs Number of splits. Note that this should evenly divide the length of the `axis`. + * @param axis Axis along which to split. + * @param squeeze_axis If true, Removes the axis with length 1 from the shapes of the output arrays. **Note** that setting `squeeze_axis` to ``true`` removes axis with length 1 only along the `axis` which it is split. Also `squeeze_axis` can be set to ``true`` only if ``input.shape[axis] == num_outputs``. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def SliceChannel (data : org.apache.mxnet.NDArray, num_outputs : Int, axis : Option[Int] = None, squeeze_axis : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Please use `SoftmaxOutput`.
+ *
+ * .. note::
+ *
+ * This operator has been renamed to `SoftmaxOutput`, which
+ * computes the gradient of cross-entropy loss w.r.t softmax output.
+ * To just compute softmax output, use the `softmax` operator.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L138
+ * @param data Input array. + * @param grad_scale Scales the gradient by a float factor. + * @param ignore_label The instances whose `labels` == `ignore_label` will be ignored during backward, if `use_ignore` is set to ``true``). + * @param multi_output If set to ``true``, the softmax function will be computed along axis ``1``. This is applied when the shape of input array differs from the shape of label array. + * @param use_ignore If set to ``true``, the `ignore_label` value will not contribute to the backward gradient. + * @param preserve_shape If set to ``true``, the softmax function will be computed along the last axis (``-1``). + * @param normalization Normalizes the gradient. + * @param out_grad Multiplies gradient with output gradient element-wise. + * @param smooth_alpha Constant for computing a label smoothed version of cross-entropyfor the backwards pass. This constant gets subtracted from theone-hot encoding of the gold label and distributed uniformly toall other labels. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def Softmax (data : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, ignore_label : Option[org.apache.mxnet.Base.MXFloat] = None, multi_output : Option[Boolean] = None, use_ignore : Option[Boolean] = None, preserve_shape : Option[Boolean] = None, normalization : Option[String] = None, out_grad : Option[Boolean] = None, smooth_alpha : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies softmax activation to input. This is intended for internal layers.
+ *
+ * .. note::
+ *
+ * This operator has been deprecated, please use `softmax`.
+ *
+ * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
+ * This is the default mode.
+ *
+ * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
+ * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
+ * has at least 3 dimensions.
+ * This can be used for `fully convolutional network`, `image segmentation`, etc.
+ *
+ * Example::
+ *
+ * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
+ * >>> [2., -.4, 7., 3., 0.2]])
+ * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
+ * >>> print softmax_act.asnumpy()
+ * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
+ * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax_activation.cc:L59
+ * @param data The input array. + * @param mode Specifies how to compute the softmax. If set to ``instance``, it computes softmax for each instance. If set to ``channel``, It computes cross channel softmax for each position of each instance. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def SoftmaxActivation (data : org.apache.mxnet.NDArray, mode : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the gradient of cross entropy loss with respect to softmax output.
+ *
+ * - This operator computes the gradient in two steps.
+ * The cross entropy loss does not actually need to be computed.
+ *
+ * - Applies softmax function on the input array.
+ * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
+ *
+ * - The softmax function, cross entropy loss and gradient is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * - The gradient of cross entropy loss w.r.t softmax output:
+ *
+ * .. math:: \text{gradient} = \text{output} - \text{label}
+ *
+ * - During forward propagation, the softmax function is computed for each instance in the input array.
+ *
+ * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
+ * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
+ * and `multi_output` to specify the way to compute softmax:
+ *
+ * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
+ * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
+ * each row in the reshaped array, and afterwards reshape it back to the original shape
+ * :math:`(d_1, d_2, ..., d_n)`.
+ * - If `preserve_shape` is ``true``, the softmax function will be computed along
+ * the last axis (`axis` = ``-1``).
+ * - If `multi_output` is ``true``, the softmax function will be computed along
+ * the second axis (`axis` = ``1``).
+ *
+ * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
+ * The provided label can be a one-hot label array or a probability label array.
+ *
+ * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
+ * with a particular label to be ignored during backward propagation. **This has no effect when
+ * softmax `output` has same shape as `label`**.
+ *
+ * Example::
+ *
+ * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
+ * label = [1,0,2,3]
+ * ignore_label = 1
+ * SoftmaxOutput(data=data, label = label,\
+ * multi_output=true, use_ignore=true,\
+ * ignore_label=ignore_label)
+ * ## forward softmax output
+ * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]]
+ * ## backward gradient output
+ * [[ 0. 0. 0. 0. ]
+ * [-0.75 0.25 0.25 0.25]
+ * [ 0.25 0.25 -0.75 0.25]
+ * [ 0.25 0.25 0.25 -0.75]]
+ * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
+ *
+ * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
+ * give each loss function different weights.
+ *
+ * - This operator also supports various ways to normalize the gradient by `normalization`,
+ * The `normalization` is applied if softmax output has different shape than the labels.
+ * The `normalization` mode can be set to the followings:
+ *
+ * - ``'null'``: do nothing.
+ * - ``'batch'``: divide the gradient by the batch size.
+ * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L123
+ * @param data Input array. + * @param label Ground truth label. + * @param grad_scale Scales the gradient by a float factor. + * @param ignore_label The instances whose `labels` == `ignore_label` will be ignored during backward, if `use_ignore` is set to ``true``). + * @param multi_output If set to ``true``, the softmax function will be computed along axis ``1``. This is applied when the shape of input array differs from the shape of label array. + * @param use_ignore If set to ``true``, the `ignore_label` value will not contribute to the backward gradient. + * @param preserve_shape If set to ``true``, the softmax function will be computed along the last axis (``-1``). + * @param normalization Normalizes the gradient. + * @param out_grad Multiplies gradient with output gradient element-wise. + * @param smooth_alpha Constant for computing a label smoothed version of cross-entropyfor the backwards pass. This constant gets subtracted from theone-hot encoding of the gold label and distributed uniformly toall other labels. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def SoftmaxOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, ignore_label : Option[org.apache.mxnet.Base.MXFloat] = None, multi_output : Option[Boolean] = None, use_ignore : Option[Boolean] = None, preserve_shape : Option[Boolean] = None, normalization : Option[String] = None, out_grad : Option[Boolean] = None, smooth_alpha : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies a spatial transformer to input feature map.
+ * @param data Input data to the SpatialTransformerOp. + * @param loc localisation net, the output dim should be 6 when transform_type is affine. You shold initialize the weight and bias with identity tranform. + * @param target_shape output shape(h, w) of spatial transformer: (y, x) + * @param transform_type transformation type + * @param sampler_type sampling type + * @return org.apache.mxnet.NDArray + */ +@Experimental +def SpatialTransformer (data : org.apache.mxnet.NDArray, loc : org.apache.mxnet.NDArray, target_shape : Option[org.apache.mxnet.Shape] = None, transform_type : String, sampler_type : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @param data Input array. + * @param dim1 the first axis to be swapped. + * @param dim2 the second axis to be swapped. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def SwapAxis (data : org.apache.mxnet.NDArray, dim1 : Option[Int] = None, dim2 : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs nearest neighbor/bilinear up sampling to inputs.
+ * @param data Array of tensors to upsample + * @param scale Up sampling scale + * @param num_filter Input filter. Only used by bilinear sample_type. + * @param sample_type upsampling method + * @param multi_input_mode How to handle multiple input. concat means concatenate upsampled images along the channel dimension. sum means add all images together, only available for nearest neighbor upsampling. + * @param num_args Number of inputs to be upsampled. For nearest neighbor upsampling, this can be 1-N; the size of output will be(scale*h_0,scale*w_0) and all other inputs will be upsampled to thesame size. For bilinear upsampling this must be 2; 1 input and 1 weight. + * @param workspace Tmp workspace for deconvolution (MB) + * @return org.apache.mxnet.NDArray + */ +@Experimental +def UpSampling (data : Array[org.apache.mxnet.NDArray], scale : Int, num_filter : Option[Int] = None, sample_type : String, multi_input_mode : Option[String] = None, num_args : Int, workspace : Option[Long] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise absolute value of the input.
+ *
+ * Example::
+ *
+ * abs([-2, 0, 3]) = [2, 0, 3]
+ *
+ * The storage type of ``abs`` output depends upon the input storage type:
+ *
+ * - abs(default) = default
+ * - abs(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def abs (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for Adam optimizer. Adam is seen as a generalization
+ * of AdaGrad.
+ *
+ * Adam update consists of the following steps, where g represents gradient and m, v
+ * are 1st and 2nd order moment estimates (mean and variance).
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
+ *
+ * It updates the weights using::
+ *
+ * m = beta1*m + (1-beta1)*grad
+ * v = beta2*v + (1-beta2)*(grad**2)
+ * w += - learning_rate * m / (sqrt(v) + epsilon)
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
+ * type of weight is the same as those of m and v,
+ * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
+ *
+ * for row in grad.indices:
+ * m[row] = beta1*m[row] + (1-beta1)*grad[row]
+ * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
+ * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L495
+ * @param weight Weight + * @param grad Gradient + * @param mean Moving mean + * @param vari Moving variance + * @param lr Learning rate + * @param beta1 The decay rate for the 1st moment estimates. + * @param beta2 The decay rate for the 2nd moment estimates. + * @param epsilon A small constant for numerical stability. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and all of w, m and v have the same stype + * @return org.apache.mxnet.NDArray + */ +@Experimental +def adam_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, mean : org.apache.mxnet.NDArray, vari : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, beta1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @param args Positional input arguments + * @return org.apache.mxnet.NDArray + */ +@Experimental +def add_n (args : Array[org.apache.mxnet.NDArray], out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse cosine of the input array.
+ *
+ * The input should be in range `[-1, 1]`.
+ * The output is in the closed interval :math:`[0, \pi]`
+ *
+ * .. math::
+ * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
+ *
+ * The storage type of ``arccos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def arccos (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the element-wise inverse hyperbolic cosine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arccosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def arccosh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse sine of the input array.
+ *
+ * The input should be in the range `[-1, 1]`.
+ * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
+ *
+ * .. math::
+ * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
+ *
+ * The storage type of ``arcsin`` output depends upon the input storage type:
+ *
+ * - arcsin(default) = default
+ * - arcsin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def arcsin (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the element-wise inverse hyperbolic sine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arcsinh`` output depends upon the input storage type:
+ *
+ * - arcsinh(default) = default
+ * - arcsinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def arcsinh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse tangent of the input array.
+ *
+ * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
+ *
+ * .. math::
+ * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
+ *
+ * The storage type of ``arctan`` output depends upon the input storage type:
+ *
+ * - arctan(default) = default
+ * - arctan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def arctan (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the element-wise inverse hyperbolic tangent of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arctanh`` output depends upon the input storage type:
+ *
+ * - arctanh(default) = default
+ * - arctanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def arctanh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns indices of the maximum values along an axis.
+ *
+ * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmax along axis 0
+ * argmax(x, axis=0) = [ 1., 1., 1.]
+ *
+ * // argmax along axis 1
+ * argmax(x, axis=1) = [ 2., 2.]
+ *
+ * // argmax along axis 1 keeping same dims as an input array
+ * argmax(x, axis=1, keepdims=True) = [[ 2.],
+ * [ 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
+ * @param data The input + * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` + * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def argmax (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, keepdims : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns argmax indices of each channel from the input array.
+ *
+ * The result will be an NDArray of shape (num_channel,).
+ *
+ * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * argmax_channel(x) = [ 2., 2.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
+ * @param data The input array + * @return org.apache.mxnet.NDArray + */ +@Experimental +def argmax_channel (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns indices of the minimum values along an axis.
+ *
+ * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmin along axis 0
+ * argmin(x, axis=0) = [ 0., 0., 0.]
+ *
+ * // argmin along axis 1
+ * argmin(x, axis=1) = [ 0., 0.]
+ *
+ * // argmin along axis 1 keeping same dims as an input array
+ * argmin(x, axis=1, keepdims=True) = [[ 0.],
+ * [ 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
+ * @param data The input + * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` + * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def argmin (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, keepdims : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the indices that would sort an input array along the given axis.
+ *
+ * This function performs sorting along the given axis and returns an array of indices having same shape
+ * as an input array that index data in sorted order.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // sort along axis -1
+ * argsort(x) = [[ 1., 0., 2.],
+ * [ 0., 2., 1.]]
+ *
+ * // sort along axis 0
+ * argsort(x, axis=0) = [[ 1., 0., 1.]
+ * [ 0., 1., 0.]]
+ *
+ * // flatten and then sort
+ * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L176
+ * @param data The input array + * @param axis Axis along which to sort the input tensor. If not given, the flattened array is used. Default is -1. + * @param is_ascend Whether to sort in ascending or descending order. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def argsort (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, is_ascend : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Batchwise dot product.
+ *
+ * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
+ * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
+ *
+ * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
+ * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
+ * which is computed by::
+ *
+ * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L117
+ * @param lhs The first input + * @param rhs The second input + * @param transpose_a If true then transpose the first input before dot. + * @param transpose_b If true then transpose the second input before dot. + * @param forward_stype The desired storage type of the forward output given by user, if thecombination of input storage types and this hint does not matchany implemented ones, the dot operator will perform fallback operationand still produce an output of the desired storage type. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def batch_dot (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, forward_stype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Takes elements from a data batch.
+ *
+ * .. note::
+ * `batch_take` is deprecated. Use `pick` instead.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // takes elements with specified indices
+ * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L444
+ * @param a The input array + * @param indices The index array + * @return org.apache.mxnet.NDArray + */ +@Experimental +def batch_take (a : org.apache.mxnet.NDArray, indices : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_add (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @param data The input + * @param axis The axes to perform the broadcasting. + * @param size Target sizes of the broadcasting axes. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_axes (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, size : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @param data The input + * @param axis The axes to perform the broadcasting. + * @param size Target sizes of the broadcasting axes. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_axis (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, size : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise division of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 6., 6., 6.],
+ * [ 6., 6., 6.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_div(x, y) = [[ 3., 3., 3.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_div(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_div (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_equal (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_greater (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_greater_equal (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hypotenuse of a right angled triangle, given its "legs"
+ * with broadcasting.
+ *
+ * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
+ *
+ * Example::
+ *
+ * x = [[ 3., 3., 3.]]
+ *
+ * y = [[ 4.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, y) = [[ 5., 5., 5.],
+ * [ 5., 5., 5.]]
+ *
+ * z = [[ 0.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, z) = [[ 3., 3., 3.],
+ * [ 5., 5., 5.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_hypot (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser(x, y) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_lesser (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_lesser_equal (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **logical and** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_logical_and (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **logical or** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_logical_or (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **logical xor** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_logical_xor (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise maximum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise maxima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_maximum (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise minimum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise minima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_minimum (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_minus (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise modulo of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 8., 8., 8.],
+ * [ 8., 8., 8.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_mod(x, y) = [[ 0., 0., 0.],
+ * [ 2., 2., 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_mod (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise product of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_mul(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_mul(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_mul (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_not_equal (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_plus (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_power(x, y) = [[ 2., 2., 2.],
+ * [ 4., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_power (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_sub (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Broadcasts the input array to a new shape.
+ *
+ * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
+ * with arrays of different shapes efficiently without creating multiple copies of arrays.
+ * Also see, `Broadcasting `_ for more explanation.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * For example::
+ *
+ * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
+ * [ 1., 2., 3.]])
+ *
+ * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
+ * So with `shape=(2,0)`, we will obtain the same result as in the above example.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
+ * @param data The input + * @param shape The shape of the desired array. We can set the dim to zero if it's same as the original. E.g `A = broadcast_to(B, shape=(10, 0, 0))` has the same meaning as `A = broadcast_axis(B, axis=0, size=10)`. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def broadcast_to (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @param data The input. + * @param dtype Output data type. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def cast (data : org.apache.mxnet.NDArray, dtype : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Casts tensor storage type to the new type.
+ *
+ * When an NDArray with default storage type is cast to csr or row_sparse storage,
+ * the result is compact, which means:
+ *
+ * - for csr, zero values will not be retained
+ * - for row_sparse, row slices of all zeros will not be retained
+ *
+ * The storage type of ``cast_storage`` output depends on stype parameter:
+ *
+ * - cast_storage(csr, 'default') = default
+ * - cast_storage(row_sparse, 'default') = default
+ * - cast_storage(default, 'csr') = csr
+ * - cast_storage(default, 'row_sparse') = row_sparse
+ * - cast_storage(csr, 'csr') = csr
+ * - cast_storage(row_sparse, 'row_sparse') = row_sparse
+ *
+ * Example::
+ *
+ * dense = [[ 0., 1., 0.],
+ * [ 2., 0., 3.],
+ * [ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * # cast to row_sparse storage type
+ * rsp = cast_storage(dense, 'row_sparse')
+ * rsp.indices = [0, 1]
+ * rsp.values = [[ 0., 1., 0.],
+ * [ 2., 0., 3.]]
+ *
+ * # cast to csr storage type
+ * csr = cast_storage(dense, 'csr')
+ * csr.indices = [1, 0, 2]
+ * csr.values = [ 1., 2., 3.]
+ * csr.indptr = [0, 1, 3, 3, 3]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/cast_storage.cc:L71
+ * @param data The input. + * @param stype Output storage type. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def cast_storage (data : org.apache.mxnet.NDArray, stype : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise cube-root value of the input.
+ *
+ * .. math::
+ * cbrt(x) = \sqrt[3]{x}
+ *
+ * Example::
+ *
+ * cbrt([1, 8, -125]) = [1, 2, -5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def cbrt (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise ceiling of the input.
+ *
+ * The ceil of the scalar x is the smallest integer i, such that i >= x.
+ *
+ * Example::
+ *
+ * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
+ *
+ * The storage type of ``ceil`` output depends upon the input storage type:
+ *
+ * - ceil(default) = default
+ * - ceil(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def ceil (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
+ * @param lhs Left operand to the function. + * @param rhs Right operand to the function. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def choose_element_0index (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Clips (limits) the values in an array.
+ *
+ * Given an interval, values outside the interval are clipped to the interval edges.
+ * Clipping ``x`` between `a_min` and `a_x` would be::
+ *
+ * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
+ *
+ * Example::
+ *
+ * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ *
+ * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
+ *
+ * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
+ * parameter values:
+ *
+ * - clip(default) = default
+ * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
+ * - clip(csr, a_min <= 0, a_max >= 0) = csr
+ * - clip(row_sparse, a_min < 0, a_max < 0) = default
+ * - clip(row_sparse, a_min > 0, a_max > 0) = default
+ * - clip(csr, a_min < 0, a_max < 0) = csr
+ * - clip(csr, a_min > 0, a_max > 0) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L617
+ * @param data Input array. + * @param a_min Minimum value + * @param a_max Maximum value + * @return org.apache.mxnet.NDArray + */ +@Experimental +def clip (data : org.apache.mxnet.NDArray, a_min : org.apache.mxnet.Base.MXFloat, a_max : org.apache.mxnet.Base.MXFloat, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @param data List of arrays to concatenate + * @param num_args Number of inputs to be concated. + * @param dim the dimension to be concated. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def concat (data : Array[org.apache.mxnet.NDArray], num_args : Int, dim : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the element-wise cosine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
+ *
+ * The storage type of ``cos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def cos (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hyperbolic cosine of the input array, computed element-wise.
+ *
+ * .. math::
+ * cosh(x) = 0.5\times(exp(x) + exp(-x))
+ *
+ * The storage type of ``cosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def cosh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @param data Source input + * @param begin starting indices for the slice operation, supports negative indices. + * @param end ending indices for the slice operation, supports negative indices. + * @param step step for the slice operation, supports negative values. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def crop (data : org.apache.mxnet.NDArray, begin : org.apache.mxnet.Shape, end : org.apache.mxnet.Shape, step : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts each element of the input array from radians to degrees.
+ *
+ * .. math::
+ * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
+ *
+ * The storage type of ``degrees`` output depends upon the input storage type:
+ *
+ * - degrees(default) = default
+ * - degrees(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def degrees (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Dot product of two arrays.
+ *
+ * ``dot``'s behavior depends on the input array dimensions:
+ *
+ * - 1-D arrays: inner product of vectors
+ * - 2-D arrays: matrix multiplication
+ * - N-D arrays: a sum product over the last axis of the first input and the first
+ * axis of the second input
+ *
+ * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
+ * result array will have shape `(n,m,r,s)`. It is computed by::
+ *
+ * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
+ *
+ * Example::
+ *
+ * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
+ * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
+ * dot(x,y)[0,0,1,1] = 0
+ * sum(x[0,0,:]*y[:,1,1]) = 0
+ *
+ * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
+ * forward_stype option for output storage type. Implemented sparse operations include:
+ *
+ * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
+ * - dot(csr, default, transpose_a=True) = default
+ * - dot(csr, default, transpose_a=True) = row_sparse
+ * - dot(csr, default) = default
+ * - dot(csr, row_sparse) = default
+ * - dot(default, csr) = csr (CPU only)
+ * - dot(default, csr, forward_stype='default') = default
+ * - dot(default, csr, transpose_b=True, forward_stype='default') = default
+ *
+ * If the combination of input storage types and forward_stype does not match any of the
+ * above patterns, ``dot`` will fallback and generate output with default storage.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L69
+ * @param lhs The first input + * @param rhs The second input + * @param transpose_a If true then transpose the first input before dot. + * @param transpose_b If true then transpose the second input before dot. + * @param forward_stype The desired storage type of the forward output given by user, if thecombination of input storage types and this hint does not matchany implemented ones, the dot operator will perform fallback operationand still produce an output of the desired storage type. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def dot (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, forward_stype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Adds arguments element-wise.
+ *
+ * The storage type of ``elemwise_add`` output depends on storage types of inputs
+ *
+ * - elemwise_add(row_sparse, row_sparse) = row_sparse
+ * - elemwise_add(csr, csr) = csr
+ * - elemwise_add(default, csr) = default
+ * - elemwise_add(csr, default) = default
+ * - elemwise_add(default, rsp) = default
+ * - elemwise_add(rsp, default) = default
+ * - otherwise, ``elemwise_add`` generates output with default storage
+ * @param lhs first input + * @param rhs second input + * @return org.apache.mxnet.NDArray + */ +@Experimental +def elemwise_add (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Divides arguments element-wise.
+ *
+ * The storage type of ``elemwise_div`` output is always dense
+ * @param lhs first input + * @param rhs second input + * @return org.apache.mxnet.NDArray + */ +@Experimental +def elemwise_div (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Multiplies arguments element-wise.
+ *
+ * The storage type of ``elemwise_mul`` output depends on storage types of inputs
+ *
+ * - elemwise_mul(default, default) = default
+ * - elemwise_mul(row_sparse, row_sparse) = row_sparse
+ * - elemwise_mul(default, row_sparse) = row_sparse
+ * - elemwise_mul(row_sparse, default) = row_sparse
+ * - elemwise_mul(csr, csr) = csr
+ * - otherwise, ``elemwise_mul`` generates output with default storage
+ * @param lhs first input + * @param rhs second input + * @return org.apache.mxnet.NDArray + */ +@Experimental +def elemwise_mul (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Subtracts arguments element-wise.
+ *
+ * The storage type of ``elemwise_sub`` output depends on storage types of inputs
+ *
+ * - elemwise_sub(row_sparse, row_sparse) = row_sparse
+ * - elemwise_sub(csr, csr) = csr
+ * - elemwise_sub(default, csr) = default
+ * - elemwise_sub(csr, default) = default
+ * - elemwise_sub(default, rsp) = default
+ * - elemwise_sub(rsp, default) = default
+ * - otherwise, ``elemwise_sub`` generates output with default storage
+ * @param lhs first input + * @param rhs second input + * @return org.apache.mxnet.NDArray + */ +@Experimental +def elemwise_sub (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise exponential value of the input.
+ *
+ * .. math::
+ * exp(x) = e^x \approx 2.718^x
+ *
+ * Example::
+ *
+ * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
+ *
+ * The storage type of ``exp`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def exp (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Inserts a new axis of size 1 into the array shape
+ *
+ * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
+ * will return a new array with shape ``(2,1,3,4)``.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L346
+ * @param data Source input + * @param axis Position where new axis is to be inserted. Suppose that the input `NDArray`'s dimension is `ndim`, the range of the inserted axis is `[-ndim, ndim]` + * @return org.apache.mxnet.NDArray + */ +@Experimental +def expand_dims (data : org.apache.mxnet.NDArray, axis : Int, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns ``exp(x) - 1`` computed element-wise on the input.
+ *
+ * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
+ *
+ * The storage type of ``expm1`` output depends upon the input storage type:
+ *
+ * - expm1(default) = default
+ * - expm1(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def expm1 (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
+ * @param lhs Left operand to the function. + * @param mhs Middle operand to the function. + * @param rhs Right operand to the function. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def fill_element_0index (lhs : org.apache.mxnet.NDArray, mhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise rounded value to the nearest \
+ * integer towards zero of the input.
+ *
+ * Example::
+ *
+ * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
+ *
+ * The storage type of ``fix`` output depends upon the input storage type:
+ *
+ * - fix(default) = default
+ * - fix(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def fix (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @param data Input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def flatten (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @param data Input data array + * @param axis The axis which to reverse elements. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def flip (data : org.apache.mxnet.NDArray, axis : org.apache.mxnet.Shape, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise floor of the input.
+ *
+ * The floor of the scalar x is the largest integer i, such that i <= x.
+ *
+ * Example::
+ *
+ * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
+ *
+ * The storage type of ``floor`` output depends upon the input storage type:
+ *
+ * - floor(default) = default
+ * - floor(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def floor (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * The FTML optimizer described in
+ * *FTML - Follow the Moving Leader in Deep Learning*,
+ * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
+ * \sigma_t = d_t - \beta_1 d_{t-1}
+ * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
+ * W_t = - \frac{ z_t }{ d_t }
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L447
+ * @param weight Weight + * @param grad Gradient + * @param d Internal state ``d_t`` + * @param v Internal state ``v_t`` + * @param z Internal state ``z_t`` + * @param lr Learning rate. + * @param beta1 Generally close to 0.5. + * @param beta2 Generally close to 1. + * @param epsilon Epsilon to prevent div 0. + * @param t Number of update. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_grad Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def ftml_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, d : org.apache.mxnet.NDArray, v : org.apache.mxnet.NDArray, z : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, beta1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[Double] = None, t : Int, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_grad : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for Ftrl optimizer.
+ * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
+ * http://dl.acm.org/citation.cfm?id=2488200.
+ *
+ * It updates the weights using::
+ *
+ * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
+ * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
+ * n += rescaled_grad**2
+ * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
+ *
+ * If w, z and n are all of ``row_sparse`` storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
+ *
+ * for row in grad.indices:
+ * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
+ * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
+ * n[row] += rescaled_grad[row]**2
+ * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L632
+ * @param weight Weight + * @param grad Gradient + * @param z z + * @param n Square of grad + * @param lr Learning rate + * @param lamda1 The L1 regularization coefficient. + * @param beta Per-Coordinate Learning Rate beta. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def ftrl_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, z : org.apache.mxnet.NDArray, n : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, lamda1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the gamma function (extension of the factorial function \
+ * to the reals), computed element-wise on the input array.
+ *
+ * The storage type of ``gamma`` output is always dense
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def gamma (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise log of the absolute value of the gamma function \
+ * of the input.
+ *
+ * The storage type of ``gammaln`` output is always dense
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def gammaln (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Gather elements or slices from `data` and store to a tensor whose
+ * shape is defined by `indices`.
+ *
+ * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}]
+ *
+ * Examples::
+ *
+ * data = [[0, 1], [2, 3]]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * gather_nd(data, indices) = [2, 3, 0]
+ * @param data data + * @param indices indices + * @return org.apache.mxnet.NDArray + */ +@Experimental +def gather_nd (data : org.apache.mxnet.NDArray, indices : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes hard sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = max(0, min(1, alpha * x + beta))
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
+ * @param data The input array. + * @param alpha Slope of hard sigmoid + * @param beta Bias of hard sigmoid. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def hard_sigmoid (data : org.apache.mxnet.NDArray, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns a copy of the input.
+ *
+ * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def identity (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the Khatri-Rao product of the input matrices.
+ *
+ * Given a collection of :math:`n` input matrices,
+ *
+ * .. math::
+ * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
+ *
+ * the (column-wise) Khatri-Rao product is defined as the matrix,
+ *
+ * .. math::
+ * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
+ *
+ * where the :math:`k` th column is equal to the column-wise outer product
+ * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
+ * column of the ith matrix.
+ *
+ * Example::
+ *
+ * >>> A = mx.nd.array([[1, -1],
+ * >>> [2, -3]])
+ * >>> B = mx.nd.array([[1, 4],
+ * >>> [2, 5],
+ * >>> [3, 6]])
+ * >>> C = mx.nd.khatri_rao(A, B)
+ * >>> print(C.asnumpy())
+ * [[ 1. -4.]
+ * [ 2. -5.]
+ * [ 3. -6.]
+ * [ 2. -12.]
+ * [ 4. -15.]
+ * [ 6. -18.]]
+ *
+ *
+ *
+ * Defined in src/operator/contrib/krprod.cc:L108
+ * @param args Positional input matrices + * @return org.apache.mxnet.NDArray + */ +@Experimental +def khatri_rao (args : Array[org.apache.mxnet.NDArray], out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * LQ factorization for general matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
+ * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
+ * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
+ * that:
+ *
+ * *A* = *L* \* *Q*
+ *
+ * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
+ * and *Q* is row-orthonormal, meaning that
+ *
+ * *Q* \* *Q*\ :sup:`T`
+ *
+ * is equal to the identity matrix of shape *(x, x)*.
+ *
+ * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single LQ factorization
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * Q, L = gelqf(A)
+ * Q = [[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]]
+ * L = [[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]]
+ *
+ * // Batch LQ factorization
+ * A = [[[1., 2., 3.], [4., 5., 6.]],
+ * [[7., 8., 9.], [10., 11., 12.]]]
+ * Q, L = gelqf(A)
+ * Q = [[[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]],
+ * [[-0.50257071, -0.57436653, -0.64616234],
+ * [0.7620735, 0.05862104, -0.64483142]]]
+ * L = [[[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]],
+ * [[-13.92838828, 0.],
+ * [-19.09768702, 0.52758934]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L552
+ * @param A Tensor of input matrices to be factorized + * @return org.apache.mxnet.NDArray + */ +@Experimental +def linalg_gelqf (A : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs general matrix multiplication and accumulation.
+ * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
+ *
+ * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
+ * matrix transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = swapaxes(C, dim1=1, dim2=3)
+ * C = gemm(A1, B1, C)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply-add
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
+ * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
+ *
+ * // Batch matrix multiply-add
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * C = [[[10.0]], [[0.01]]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
+ * = [[[104.0]], [[0.14]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L81
+ * @param A Tensor of input matrices + * @param B Tensor of input matrices + * @param C Tensor of input matrices + * @param transpose_a Multiply with transposed of first input (A). + * @param transpose_b Multiply with transposed of second input (B). + * @param alpha Scalar factor multiplied with A*B. + * @param beta Scalar factor multiplied with C. + * @param axis Axis corresponding to the matrix rows. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def linalg_gemm (A : org.apache.mxnet.NDArray, B : org.apache.mxnet.NDArray, C : org.apache.mxnet.NDArray, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, alpha : Option[Double] = None, beta : Option[Double] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs general matrix multiplication.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
+ *
+ * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
+ * transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = gemm2(A1, B1)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[[4.0]], [[0.04 ]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L151
+ * @param A Tensor of input matrices + * @param B Tensor of input matrices + * @param transpose_a Multiply with transposed of first input (A). + * @param transpose_b Multiply with transposed of second input (B). + * @param alpha Scalar factor multiplied with A*B. + * @param axis Axis corresponding to the matrix row indices. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def linalg_gemm2 (A : org.apache.mxnet.NDArray, B : org.apache.mxnet.NDArray, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, alpha : Option[Double] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs Cholesky factorization of a symmetric positive-definite matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
+ * computed. *L* is lower triangular (entries of upper triangle are all zero), has
+ * positive diagonal entries, and:
+ *
+ * *A* = *L* \* *L*\ :sup:`T`
+ *
+ * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix factorization
+ * A = [[4.0, 1.0], [1.0, 4.25]]
+ * potrf(A) = [[2.0, 0], [0.5, 2.0]]
+ *
+ * // Batch matrix factorization
+ * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
+ * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L201
+ * @param A Tensor of input matrices to be decomposed + * @return org.apache.mxnet.NDArray + */ +@Experimental +def linalg_potrf (A : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs matrix inversion from a Cholesky factorization.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
+ * with positive diagonal. We compute:
+ *
+ * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
+ *
+ * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
+ * *B* (obtained by *potrf*), then
+ *
+ * *out* = *B*\ :sup:`-1`
+ *
+ * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
+ * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
+ * (*trsm*). The latter is numerically much safer, and also cheaper.
+ *
+ * Examples::
+ *
+ * // Single matrix inverse
+ * A = [[2.0, 0], [0.5, 2.0]]
+ * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
+ *
+ * // Batch matrix inverse
+ * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
+ * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L259
+ * @param A Tensor of lower triangular matrices + * @return org.apache.mxnet.NDArray + */ +@Experimental +def linalg_potri (A : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of the logarithms of the diagonal elements of a square matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
+ * logarithms of the diagonal elements, the result has shape (1,).
+ *
+ * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix reduction
+ * A = [[1.0, 1.0], [1.0, 7.0]]
+ * sumlogdiag(A) = [1.9459]
+ *
+ * // Batch matrix reduction
+ * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
+ * sumlogdiag(A) = [1.9459, 3.9318]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L428
+ * @param A Tensor of square matrices + * @return org.apache.mxnet.NDArray + */ +@Experimental +def linalg_sumlogdiag (A : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Multiplication of matrix with its transpose.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the operator performs the BLAS3 function *syrk*:
+ *
+ * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
+ *
+ * if *transpose=False*, or
+ *
+ * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
+ *
+ * if *transpose=True*.
+ *
+ * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * syrk(A, alpha=1., transpose=False)
+ * = [[14., 32.],
+ * [32., 77.]]
+ * syrk(A, alpha=1., transpose=True)
+ * = [[17., 22., 27.],
+ * [22., 29., 36.],
+ * [27., 36., 45.]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1., 1.]], [[0.1, 0.1]]]
+ * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L484
+ * @param A Tensor of input matrices + * @param transpose Use transpose of input matrix. + * @param alpha Scalar factor to be applied to the result. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def linalg_syrk (A : org.apache.mxnet.NDArray, transpose : Option[Boolean] = None, alpha : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs multiplication with a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trmm*:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* = *alpha* \* *B* \* *op*\ (*A*)
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ *
+ * Examples::
+ *
+ * // Single triangular matrix multiply
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch triangular matrix multiply
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
+ * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L316
+ * @param A Tensor of lower triangular matrices + * @param B Tensor of matrices + * @param transpose Use transposed of the triangular matrix + * @param rightside Multiply triangular matrix from the right to non-triangular one. + * @param alpha Scalar factor to be applied to the result. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def linalg_trmm (A : org.apache.mxnet.NDArray, B : org.apache.mxnet.NDArray, transpose : Option[Boolean] = None, rightside : Option[Boolean] = None, alpha : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Solves matrix equation involving a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trsm*, solving for *out* in:
+ *
+ * *op*\ (*A*) \* *out* = *alpha* \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* \* *op*\ (*A*) = *alpha* \* *B*
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix solve
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ *
+ * // Batch matrix solve
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
+ * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
+ * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L379
+ * @param A Tensor of lower triangular matrices + * @param B Tensor of matrices + * @param transpose Use transposed of the triangular matrix + * @param rightside Multiply triangular matrix from the right to non-triangular one. + * @param alpha Scalar factor to be applied to the result. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def linalg_trsm (A : org.apache.mxnet.NDArray, B : org.apache.mxnet.NDArray, transpose : Option[Boolean] = None, rightside : Option[Boolean] = None, alpha : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise Natural logarithmic value of the input.
+ *
+ * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
+ *
+ * The storage type of ``log`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def log (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise Base-10 logarithmic value of the input.
+ *
+ * ``10**log10(x) = x``
+ *
+ * The storage type of ``log10`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def log10 (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise ``log(1 + x)`` value of the input.
+ *
+ * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
+ * :math:`1+x\approx 1`
+ *
+ * The storage type of ``log1p`` output depends upon the input storage type:
+ *
+ * - log1p(default) = default
+ * - log1p(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def log1p (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise Base-2 logarithmic value of the input.
+ *
+ * ``2**log2(x) = x``
+ *
+ * The storage type of ``log2`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def log2 (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the log softmax of the input.
+ * This is equivalent to computing softmax followed by log.
+ *
+ * Examples::
+ *
+ * >>> x = mx.nd.array([1, 2, .1])
+ * >>> mx.nd.log_softmax(x).asnumpy()
+ * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
+ *
+ * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
+ * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
+ * array([[-0.34115392, -0.69314718, -1.24115396],
+ * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
+ * @param data The input array. + * @param axis The axis along which to compute softmax. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def log_softmax (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of logical NOT (!) function
+ *
+ * Example:
+ * logical_not([-2., 0., 1.]) = [0., 1., 0.]
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def logical_not (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = make_loss(cross_entropy)
+ *
+ * We will need to use ``make_loss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * The storage type of ``make_loss`` output depends upon the input storage type:
+ *
+ * - make_loss(default) = default
+ * - make_loss(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def make_loss (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def max (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def max_axis (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the mean of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def mean (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def min (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def min_axis (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Updater function for multi-precision sgd optimizer
+ * @param weight Weight + * @param grad Gradient + * @param mom Momentum + * @param weight32 Weight32 + * @param lr Learning rate + * @param momentum The decay rate of momentum estimates at each epoch. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and both weight and momentum have the same stype + * @return org.apache.mxnet.NDArray + */ +@Experimental +def mp_sgd_mom_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, mom : org.apache.mxnet.NDArray, weight32 : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Updater function for multi-precision sgd optimizer
+ * @param weight Weight + * @param grad gradient + * @param weight32 Weight32 + * @param lr Learning rate + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def mp_sgd_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, weight32 : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def nanprod (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def nansum (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Numerical negative of the argument, element-wise.
+ *
+ * The storage type of ``negative`` output depends upon the input storage type:
+ *
+ * - negative(default) = default
+ * - negative(row_sparse) = row_sparse
+ * - negative(csr) = csr
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def negative (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the norm on an NDArray.
+ *
+ * This operator computes the norm on an NDArray with the specified axis, depending
+ * on the value of the ord parameter. By default, it computes the L2 norm on the entire
+ * array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * norm(x) = [5.47722578]
+ *
+ * rsp = x.cast_storage('row_sparse')
+ *
+ * norm(rsp) = [5.47722578]
+ *
+ * csr = x.cast_storage('csr')
+ *
+ * norm(csr) = [5.47722578]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
+ * @param data The input + * @param ord Order of the norm. Currently ord=2 is supported. + * @param axis The axis or axes along which to perform the reduction. + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + If `axis` is int, a reduction is performed on a particular axis. + If `axis` is a 2-tuple, it specifies the axes that hold 2-D matrices, + and the matrix norms of these matrices are computed. + * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def norm (data : org.apache.mxnet.NDArray, ord : Option[Int] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @param loc Mean of the distribution. + * @param scale Standard deviation of the distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def normal (loc : Option[org.apache.mxnet.Base.MXFloat] = None, scale : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns a one-hot array.
+ *
+ * The locations represented by `indices` take value `on_value`, while all
+ * other locations take value `off_value`.
+ *
+ * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
+ * in an output array of shape ``(i0, i1, d)`` with::
+ *
+ * output[i,j,:] = off_value
+ * output[i,j,indices[i,j]] = on_value
+ *
+ * Examples::
+ *
+ * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
+ * [ 1. 0. 0.]
+ * [ 0. 0. 1.]
+ * [ 1. 0. 0.]]
+ *
+ * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
+ * dtype='int32') = [[1 8 1]
+ * [8 1 1]
+ * [1 1 8]
+ * [8 1 1]]
+ *
+ * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 0. 1.]
+ * [ 1. 0. 0.]]]
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L490
+ * @param indices array of locations where to set on_value + * @param depth Depth of the one hot dimension. + * @param on_value The value assigned to the locations represented by indices. + * @param off_value The value assigned to the locations not represented by indices. + * @param dtype DType of the output + * @return org.apache.mxnet.NDArray + */ +@Experimental +def one_hot (indices : org.apache.mxnet.NDArray, depth : Int, on_value : Option[Double] = None, off_value : Option[Double] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return an array of ones with the same shape and type
+ * as the input array.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * ones_like(x) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ * @param data The input + * @return org.apache.mxnet.NDArray + */ +@Experimental +def ones_like (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @param data An n-dimensional input array. + * @param mode Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges. + * @param pad_width Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ... , before_N, after_N)``. It should be of length ``2*N`` where ``N`` is the number of dimensions of the array.This is equivalent to pad_width in numpy.pad, but flattened. + * @param constant_value The value used for padding when `mode` is "constant". + * @return org.apache.mxnet.NDArray + */ +@Experimental +def pad (data : org.apache.mxnet.NDArray, mode : String, pad_width : org.apache.mxnet.Shape, constant_value : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Picks elements from an input array according to the input indices along the given axis.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last element along an axis (the `clip` mode).
+ *
+ * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // picks elements with specified indices along axis 0
+ * pick(x, y=[0,1], 0) = [ 1., 4.]
+ *
+ * // picks elements with specified indices along axis 1
+ * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
+ *
+ * y = [[ 1.],
+ * [ 0.],
+ * [ 2.]]
+ *
+ * // picks elements with specified indices along axis 1 and dims are maintained
+ * pick(x,y, 1, keepdims=True) = [[ 2.],
+ * [ 3.],
+ * [ 6.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
+ * @param data The input array + * @param index The index array + * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` + * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def pick (data : org.apache.mxnet.NDArray, index : org.apache.mxnet.NDArray, axis : Option[Int] = None, keepdims : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the product of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def prod (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts each element of the input array from degrees to radians.
+ *
+ * .. math::
+ * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
+ *
+ * The storage type of ``radians`` output depends upon the input storage type:
+ *
+ * - radians(default) = default
+ * - radians(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def radians (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from an exponential distribution.
+ *
+ * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
+ *
+ * Example::
+ *
+ * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
+ * [ 0.04146638, 0.31715935]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L115
+ * @param lam Lambda parameter (rate) of the exponential distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def random_exponential (lam : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a gamma distribution.
+ *
+ * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
+ *
+ * Example::
+ *
+ * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
+ * [ 3.91697288, 3.65933681]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L100
+ * @param alpha Alpha parameter (shape) of the gamma distribution. + * @param beta Beta parameter (scale) of the gamma distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def random_gamma (alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a generalized negative binomial distribution.
+ *
+ * Samples are distributed according to a generalized negative binomial distribution parametrized by
+ * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
+ * number of unsuccessful experiments (generalized to real numbers).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
+ * [ 6., 4.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L168
+ * @param mu Mean of the negative binomial distribution. + * @param alpha Alpha (dispersion) parameter of the negative binomial distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def random_generalized_negative_binomial (mu : Option[org.apache.mxnet.Base.MXFloat] = None, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a negative binomial distribution.
+ *
+ * Samples are distributed according to a negative binomial distribution parametrized by
+ * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
+ * [ 2., 5.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L149
+ * @param k Limit of unsuccessful experiments. + * @param p Failure probability in each experiment. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def random_negative_binomial (k : Option[Int] = None, p : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @param loc Mean of the distribution. + * @param scale Standard deviation of the distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def random_normal (loc : Option[org.apache.mxnet.Base.MXFloat] = None, scale : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a Poisson distribution.
+ *
+ * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
+ * [ 4., 6.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L132
+ * @param lam Lambda parameter (rate) of the Poisson distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def random_poisson (lam : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @param low Lower bound of the distribution. + * @param high Upper bound of the distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def random_uniform (low : Option[org.apache.mxnet.Base.MXFloat] = None, high : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
+ *
+ * Examples::
+ *
+ * A = [[3,6,6],[4,5,1]]
+ * ravel(A, shape=(7,6)) = [22,41,37]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L41
+ * @param data Batch of multi-indices + * @param shape Shape of the array into which the multi-indices apply. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def ravel_multi_index (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse cube-root value of the input.
+ *
+ * .. math::
+ * rcbrt(x) = 1/\sqrt[3]{x}
+ *
+ * Example::
+ *
+ * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def rcbrt (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the reciprocal of the argument, element-wise.
+ *
+ * Calculates 1/x.
+ *
+ * Example::
+ *
+ * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def reciprocal (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes rectified linear.
+ *
+ * .. math::
+ * max(features, 0)
+ *
+ * The storage type of ``relu`` output depends upon the input storage type:
+ *
+ * - relu(default) = default
+ * - relu(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def relu (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Repeats elements of an array.
+ *
+ * By default, ``repeat`` flattens the input array into 1-D and then repeats the
+ * elements::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
+ *
+ * The parameter ``axis`` specifies the axis along which to perform repeat::
+ *
+ * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
+ * [ 1., 2.],
+ * [ 3., 4.],
+ * [ 3., 4.]]
+ *
+ * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L690
+ * @param data Input data array + * @param repeats The number of repetitions for each element. + * @param axis The axis along which to repeat values. The negative numbers are interpreted counting from the backward. By default, use the flattened input array, and return a flat output array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def repeat (data : org.apache.mxnet.NDArray, repeats : Int, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @param data Input data to reshape. + * @param shape The target shape + * @param reverse If true then the special values are inferred from right to left + * @param target_shape (Deprecated! Use ``shape`` instead.) Target new shape. One and only one dim can be 0, in which case it will be inferred from the rest of dims + * @param keep_highest (Deprecated! Use ``shape`` instead.) Whether keep the highest dim unchanged.If set to true, then the first dim in target_shape is ignored,and always fixed as input + * @return org.apache.mxnet.NDArray + */ +@Experimental +def reshape (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, reverse : Option[Boolean] = None, target_shape : Option[org.apache.mxnet.Shape] = None, keep_highest : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reshape lhs to have the same shape as rhs.
+ * @param lhs First input. + * @param rhs Second input. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def reshape_like (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @param data Input data array + * @param axis The axis which to reverse elements. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def reverse (data : org.apache.mxnet.NDArray, axis : org.apache.mxnet.Shape, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * .. note::
+ * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
+ * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
+ *
+ * Example::
+ *
+ * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
+ *
+ * The storage type of ``rint`` output depends upon the input storage type:
+ *
+ * - rint(default) = default
+ * - rint(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def rint (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for `RMSProp` optimizer.
+ *
+ * `RMSprop` is a variant of stochastic gradient descent where the gradients are
+ * divided by a cache which grows with the sum of squares of recent gradients?
+ *
+ * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
+ * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
+ * each parameter monotonically over the course of training.
+ * While this is analytically motivated for convex optimizations, it may not be ideal
+ * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
+ * learning rates to rebound as the denominator decays over time.
+ *
+ * Define the Root Mean Square (RMS) error criterion of the gradient as
+ * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
+ * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
+ *
+ * The :math:`E[g^2]_t` is given by:
+ *
+ * .. math::
+ * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
+ *
+ * The RMSProp code follows the version in
+ * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
+ * Tieleman & Hinton, 2012.
+ *
+ * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
+ * :math:`\eta` to be 0.001.
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L553
+ * @param weight Weight + * @param grad Gradient + * @param n n + * @param lr Learning rate + * @param gamma1 The decay rate of momentum estimates. + * @param epsilon A small constant for numerical stability. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param clip_weights Clip weights to the range of [-clip_weights, clip_weights] If clip_weights <= 0, weight clipping is turned off. weights = max(min(weights, clip_weights), -clip_weights). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def rmsprop_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, n : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, gamma1 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, clip_weights : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for RMSPropAlex optimizer.
+ *
+ * `RMSPropAlex` is non-centered version of `RMSProp`.
+ *
+ * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
+ * :math:`E[g]_t` is the decaying average over past gradient.
+ *
+ * .. math::
+ * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
+ * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
+ * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t + \Delta_t
+ *
+ * The RMSPropAlex code follows the version in
+ * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
+ *
+ * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
+ * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L592
+ * @param weight Weight + * @param grad Gradient + * @param n n + * @param g g + * @param delta delta + * @param lr Learning rate + * @param gamma1 Decay rate. + * @param gamma2 Decay rate. + * @param epsilon A small constant for numerical stability. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param clip_weights Clip weights to the range of [-clip_weights, clip_weights] If clip_weights <= 0, weight clipping is turned off. weights = max(min(weights, clip_weights), -clip_weights). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def rmspropalex_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, n : org.apache.mxnet.NDArray, g : org.apache.mxnet.NDArray, delta : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, gamma1 : Option[org.apache.mxnet.Base.MXFloat] = None, gamma2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, clip_weights : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * Example::
+ *
+ * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
+ *
+ * The storage type of ``round`` output depends upon the input storage type:
+ *
+ * - round(default) = default
+ * - round(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def round (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse square-root value of the input.
+ *
+ * .. math::
+ * rsqrt(x) = 1/\sqrt{x}
+ *
+ * Example::
+ *
+ * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
+ *
+ * The storage type of ``rsqrt`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def rsqrt (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * exponential distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_exponential(lam) = [ 0.51837951, 0.09994757]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
+ * [ 0.09994757, 0.50447971]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L284
+ * @param lam Lambda (rate) parameters of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sample_exponential (lam : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * alpha = [ 0.0, 2.5 ]
+ * beta = [ 1.0, 0.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
+ * [ 2.25797319, 1.70734084]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L282
+ * @param alpha Alpha (shape) parameters of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param beta Beta (scale) parameters of the distributions. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sample_gamma (alpha : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, beta : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * mu = [ 2.0, 2.5 ]
+ * alpha = [ 1.0, 0.1 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
+ * [ 3., 1.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L293
+ * @param mu Means of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param alpha Alpha (dispersion) parameters of the distributions. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sample_generalized_negative_binomial (mu : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, alpha : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple multinomial distributions.
+ *
+ * *data* is an *n* dimensional array whose last dimension has length *k*, where
+ * *k* is the number of possible outcomes of each multinomial distribution. This
+ * operator will draw *shape* samples from each distribution. If shape is empty
+ * one sample will be drawn from each distribution.
+ *
+ * If *get_prob* is true, a second array containing log likelihood of the drawn
+ * samples will also be returned. This is usually used for reinforcement learning
+ * where you can provide reward as head gradient for this array to estimate
+ * gradient.
+ *
+ * Note that the input distribution must be normalized, i.e. *data* must sum to
+ * 1 along its last axis.
+ *
+ * Examples::
+ *
+ * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
+ *
+ * // Draw a single sample for each distribution
+ * sample_multinomial(probs) = [3, 0]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_multinomial(probs, shape=(2)) = [[4, 2],
+ * [0, 0]]
+ *
+ * // requests log likelihood
+ * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
+ * @param data Distribution probabilities. Must sum to one on the last axis. + * @param shape Shape to be sampled from each random distribution. + * @param get_prob Whether to also return the log probability of sampled result. This is usually used for differentiating through stochastic variables, e.g. in reinforcement learning. + * @param dtype DType of the output in case this can't be inferred. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sample_multinomial (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, get_prob : Option[Boolean] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * k = [ 20, 49 ]
+ * p = [ 0.4 , 0.77 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_negative_binomial(k, p) = [ 15., 16.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
+ * [ 16., 12.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L289
+ * @param k Limits of unsuccessful experiments. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param p Failure probabilities in each experiment. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sample_negative_binomial (k : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, p : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * mu = [ 0.0, 2.5 ]
+ * sigma = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
+ * [ 0.95934606, 4.48287058]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L279
+ * @param mu Means of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param sigma Standard deviations of the distributions. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sample_normal (mu : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, sigma : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * Poisson distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_poisson(lam) = [ 0., 13.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
+ * [ 13., 8.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L286
+ * @param lam Lambda (rate) parameters of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sample_poisson (lam : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * uniform distributions on the intervals given by *[low,high)*.
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * low = [ 0.0, 2.5 ]
+ * high = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
+ * [ 3.18687344, 3.68352246]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L277
+ * @param low Lower bounds of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param high Upper bounds of the distributions. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sample_uniform (low : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, high : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Scatters data into a new tensor according to indices.
+ *
+ * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
+ *
+ * all other entries in output are 0.
+ *
+ * .. warning::
+ *
+ * If the indices have duplicates, the result will be non-deterministic and
+ * the gradient of `scatter_nd` will not be correct!!
+ *
+ *
+ * Examples::
+ *
+ * data = [2, 3, 0]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * shape = (2, 2)
+ * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
+ * @param data data + * @param indices indices + * @param shape Shape of output. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def scatter_nd (data : org.apache.mxnet.NDArray, indices : org.apache.mxnet.NDArray, shape : org.apache.mxnet.Shape, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
+ *
+ * Momentum update has better convergence rates on neural networks. Mathematically it looks
+ * like below:
+ *
+ * .. math::
+ *
+ * v_1 = \alpha * \nabla J(W_0)\\
+ * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} + v_t
+ *
+ * It updates the weights using::
+ *
+ * v = momentum * v - learning_rate * gradient
+ * weight += v
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
+ * type is the same as momentum's storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
+ *
+ * for row in gradient.indices:
+ * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
+ * weight[row] += v[row]
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L372
+ * @param weight Weight + * @param grad Gradient + * @param mom Momentum + * @param lr Learning rate + * @param momentum The decay rate of momentum estimates at each epoch. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and both weight and momentum have the same stype + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sgd_mom_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, mom : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for Stochastic Gradient Descent (SDG) optimizer.
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * (gradient + wd * weight)
+ *
+ * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
+ * only the row slices whose indices appear in grad.indices are updated::
+ *
+ * for row in gradient.indices:
+ * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L331
+ * @param weight Weight + * @param grad Gradient + * @param lr Learning rate + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sgd_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Randomly shuffle the elements.
+ *
+ * This shuffles the array along the first axis.
+ * The order of the elements in each subarray does not change.
+ * For example, if a 2D array is given, the order of the rows randomly changes,
+ * but the order of the elements in each row does not change.
+ * @param data Data to be shuffled. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def shuffle (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = 1 / (1 + exp(-x))
+ *
+ * The storage type of ``sigmoid`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sigmoid (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise sign of the input.
+ *
+ * Example::
+ *
+ * sign([-2, 0, 3]) = [-1, 0, 1]
+ *
+ * The storage type of ``sign`` output depends upon the input storage type:
+ *
+ * - sign(default) = default
+ * - sign(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sign (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for SignSGD optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * sign(gradient)
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L57
+ * @param weight Weight + * @param grad Gradient + * @param lr Learning rate + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def signsgd_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * SIGN momentUM (Signum) optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
+ *
+ * It updates the weights using::
+ * state = momentum * state + (1-momentum) * gradient
+ * weight = weight - learning_rate * sign(state)
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L86
+ * @param weight Weight + * @param grad Gradient + * @param mom Momentum + * @param lr Learning rate + * @param momentum The decay rate of momentum estimates at each epoch. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param wd_lh The amount of weight decay that does not go into gradient/momentum calculationsotherwise do weight decay algorithmically only. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def signum_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, mom : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, wd_lh : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the element-wise sine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
+ *
+ * The storage type of ``sin`` output depends upon the input storage type:
+ *
+ * - sin(default) = default
+ * - sin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sin (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hyperbolic sine of the input array, computed element-wise.
+ *
+ * .. math::
+ * sinh(x) = 0.5\times(exp(x) - exp(-x))
+ *
+ * The storage type of ``sinh`` output depends upon the input storage type:
+ *
+ * - sinh(default) = default
+ * - sinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sinh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @param data Source input + * @param begin starting indices for the slice operation, supports negative indices. + * @param end ending indices for the slice operation, supports negative indices. + * @param step step for the slice operation, supports negative values. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def slice (data : org.apache.mxnet.NDArray, begin : org.apache.mxnet.Shape, end : org.apache.mxnet.Shape, step : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices along a given axis.
+ *
+ * Returns an array slice along a given `axis` starting from the `begin` index
+ * to the `end` index.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
+ * [ 5., 6.],
+ * [ 9., 10.]]
+ *
+ * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
+ * [ 6., 7.],
+ * [ 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L499
+ * @param data Source input + * @param axis Axis along which to be sliced, supports negative indexes. + * @param begin The beginning index along the axis to be sliced, supports negative indexes. + * @param end The ending index along the axis to be sliced, supports negative indexes. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def slice_axis (data : org.apache.mxnet.NDArray, axis : Int, begin : Int, end : Int, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices a region of the array like the shape of another array.
+ *
+ * This function is similar to ``slice``, however, the `begin` are always `0`s
+ * and `end` of specific axes are inferred from the second input `shape_like`.
+ *
+ * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * a ``slice_like`` operator with default empty `axes`, it performs the
+ * following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
+ *
+ * When `axes` is not empty, it is used to speficy which axes are being sliced.
+ *
+ * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
+ * will perform the following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
+ *
+ * Note that it is allowed to have first and second input with different dimensions,
+ * however, you have to make sure the `axes` are specified and not exceeding the
+ * dimension limits.
+ *
+ * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
+ * ``shape=(1,2,3)``, it is not allowed to use:
+ *
+ * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
+ * is 3.
+ *
+ * The following is allowed in this situation:
+ *
+ * `` out = slice_like(a, b, axes=(0, 2))``
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * y = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * slice_like(x, y) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
+ * [ 5., 6., 7., 8.]]
+ * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]
+ * [ 9., 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L568
+ * @param data Source input + * @param shape_like Shape like input + * @param axes List of axes on which input data will be sliced according to the corresponding size of the second input. By default will slice on all axes. Negative axes are supported. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def slice_like (data : org.apache.mxnet.NDArray, shape_like : org.apache.mxnet.NDArray, axes : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Calculate Smooth L1 Loss(lhs, scalar) by summing
+ *
+ * .. math::
+ *
+ * f(x) =
+ * \begin{cases}
+ * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
+ * |x|-0.5/\sigma^2,& \text{otherwise}
+ * \end{cases}
+ *
+ * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
+ *
+ * Example::
+ *
+ * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
+ * @param data source input + * @param scalar scalar input + * @return org.apache.mxnet.NDArray + */ +@Experimental +def smooth_l1 (data : org.apache.mxnet.NDArray, scalar : org.apache.mxnet.Base.MXFloat, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies the softmax function.
+ *
+ * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
+ *
+ * .. math::
+ * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
+ *
+ * for :math:`j = 1, ..., K`
+ *
+ * Example::
+ *
+ * x = [[ 1. 1. 1.]
+ * [ 1. 1. 1.]]
+ *
+ * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
+ * [ 0.5 0.5 0.5]]
+ *
+ * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
+ * [ 0.33333334, 0.33333334, 0.33333334]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax.cc:L95
+ * @param data The input array. + * @param axis The axis along which to compute softmax. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def softmax (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Calculate cross entropy of softmax output and one-hot label.
+ *
+ * - This operator computes the cross entropy in two steps:
+ * - Applies softmax function on the input array.
+ * - Computes and returns the cross entropy loss between the softmax output and the labels.
+ *
+ * - The softmax function and cross entropy loss is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * Example::
+ *
+ * x = [[1, 2, 3],
+ * [11, 7, 5]]
+ *
+ * label = [2, 0]
+ *
+ * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
+ * [0.97962922, 0.01794253, 0.00242826]]
+ *
+ * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
+ *
+ *
+ *
+ * Defined in src/operator/loss_binary_op.cc:L59
+ * @param data Input data + * @param label Input label + * @return org.apache.mxnet.NDArray + */ +@Experimental +def softmax_cross_entropy (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes softsign of x element-wise.
+ *
+ * .. math::
+ * y = x / (1 + abs(x))
+ *
+ * The storage type of ``softsign`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def softsign (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns a sorted copy of an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 4],
+ * [ 3, 1]]
+ *
+ * // sorts along the last axis
+ * sort(x) = [[ 1., 4.],
+ * [ 1., 3.]]
+ *
+ * // flattens and then sorts
+ * sort(x) = [ 1., 1., 3., 4.]
+ *
+ * // sorts along the first axis
+ * sort(x, axis=0) = [[ 1., 1.],
+ * [ 3., 4.]]
+ *
+ * // in a descend order
+ * sort(x, is_ascend=0) = [[ 4., 1.],
+ * [ 3., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L126
+ * @param data The input array + * @param axis Axis along which to choose sort the input tensor. If not given, the flattened array is used. Default is -1. + * @param is_ascend Whether to sort in ascending or descending order. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sort (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, is_ascend : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @param data The input + * @param num_outputs Number of splits. Note that this should evenly divide the length of the `axis`. + * @param axis Axis along which to split. + * @param squeeze_axis If true, Removes the axis with length 1 from the shapes of the output arrays. **Note** that setting `squeeze_axis` to ``true`` removes axis with length 1 only along the `axis` which it is split. Also `squeeze_axis` can be set to ``true`` only if ``input.shape[axis] == num_outputs``. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def split (data : org.apache.mxnet.NDArray, num_outputs : Int, axis : Option[Int] = None, squeeze_axis : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise square-root value of the input.
+ *
+ * .. math::
+ * \textrm{sqrt}(x) = \sqrt{x}
+ *
+ * Example::
+ *
+ * sqrt([4, 9, 16]) = [2, 3, 4]
+ *
+ * The storage type of ``sqrt`` output depends upon the input storage type:
+ *
+ * - sqrt(default) = default
+ * - sqrt(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sqrt (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise squared value of the input.
+ *
+ * .. math::
+ * square(x) = x^2
+ *
+ * Example::
+ *
+ * square([2, 3, 4]) = [4, 9, 16]
+ *
+ * The storage type of ``square`` output depends upon the input storage type:
+ *
+ * - square(default) = default
+ * - square(row_sparse) = row_sparse
+ * - square(csr) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def square (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Remove single-dimensional entries from the shape of an array.
+ * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
+ * See the following note for exception.
+ *
+ * Examples::
+ *
+ * data = [[[0], [1], [2]]]
+ * squeeze(data) = [0, 1, 2]
+ * squeeze(data, axis=0) = [[0], [1], [2]]
+ * squeeze(data, axis=2) = [[0, 1, 2]]
+ * squeeze(data, axis=(0, 2)) = [0, 1, 2]
+ *
+ * .. Note::
+ * The output of this operator will keep at least one dimension not removed. For example,
+ * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
+ * @param data data to squeeze + * @param axis Selects a subset of the single-dimensional entries in the shape. If an axis is selected with shape entry greater than one, an error is raised. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def squeeze (data : Array[org.apache.mxnet.NDArray], axis : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Join a sequence of arrays along a new axis.
+ *
+ * The axis parameter specifies the index of the new axis in the dimensions of the
+ * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
+ * will be the last dimension.
+ *
+ * Examples::
+ *
+ * x = [1, 2]
+ * y = [3, 4]
+ *
+ * stack(x, y) = [[1, 2],
+ * [3, 4]]
+ * stack(x, y, axis=1) = [[1, 3],
+ * [2, 4]]
+ * @param data List of arrays to stack + * @param axis The axis in the result array along which the input arrays are stacked. + * @param num_args Number of inputs to be stacked. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def stack (data : Array[org.apache.mxnet.NDArray], axis : Option[Int] = None, num_args : Int, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def stop_gradient (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sum (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def sum_axis (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @param data Input array. + * @param dim1 the first axis to be swapped. + * @param dim2 the second axis to be swapped. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def swapaxes (data : org.apache.mxnet.NDArray, dim1 : Option[Int] = None, dim2 : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Takes elements from an input array along the given axis.
+ *
+ * This function slices the input array along a particular axis with the provided indices.
+ *
+ * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
+ * will have shape ``(i0, i1, d1, d2)``, computed by::
+ *
+ * output[i,j,:,:] = input[indices[i,j],:,:]
+ *
+ * .. note::
+ * - `axis`- Only slicing along axis 0 is supported for now.
+ * - `mode`- Only `clip` mode is supported for now.
+ *
+ * Examples::
+ * x = [4. 5. 6.]
+ *
+ * // Trivial case, take the second element along the first axis.
+ * take(x, [1]) = [ 5. ]
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
+ * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 3., 4.],
+ * [ 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L389
+ * @param a The input array. + * @param indices The indices of the values to be extracted. + * @param axis The axis of input array to be taken. + * @param mode Specify how out-of-bound indices bahave. "clip" means clip to the range. So, if all indices mentioned are too large, they are replaced by the index that addresses the last element along an axis. "wrap" means to wrap around. "raise" means to raise an error. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def take (a : org.apache.mxnet.NDArray, indices : org.apache.mxnet.NDArray, axis : Option[Int] = None, mode : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the element-wise tangent of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
+ *
+ * The storage type of ``tan`` output depends upon the input storage type:
+ *
+ * - tan(default) = default
+ * - tan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def tan (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hyperbolic tangent of the input array, computed element-wise.
+ *
+ * .. math::
+ * tanh(x) = sinh(x) / cosh(x)
+ *
+ * The storage type of ``tanh`` output depends upon the input storage type:
+ *
+ * - tanh(default) = default
+ * - tanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def tanh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Repeats the whole array multiple times.
+ *
+ * If ``reps`` has length *d*, and input array has dimension of *n*. There are
+ * three cases:
+ *
+ * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]
+ *
+ * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
+ * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
+ *
+ *
+ * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4.]]
+ *
+ * - **n + * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
+ *
+ * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]],
+ *
+ * [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L751
+ * @param data Input data array + * @param reps The number of times for repeating the tensor a. Each dim size of reps must be a positive integer. If reps has length d, the result will have dimension of max(d, a.ndim); If a.ndim < d, a is promoted to be d-dimensional by prepending new axes. If a.ndim > d, reps is promoted to a.ndim by pre-pending 1's to it. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def tile (data : org.apache.mxnet.NDArray, reps : org.apache.mxnet.Shape, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the top *k* elements in an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // returns an index of the largest element on last axis
+ * topk(x) = [[ 2.],
+ * [ 1.]]
+ *
+ * // returns the value of top-2 largest elements on last axis
+ * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
+ * [ 0.3, 0.2]]
+ *
+ * // returns the value of top-2 smallest elements on last axis
+ * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
+ * [ 0.1 , 0.2]]
+ *
+ * // returns the value of top-2 largest elements on axis 0
+ * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
+ * [ 0.1, 0.2, 0.2]]
+ *
+ * // flattens and then returns list of both values and indices
+ * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L63
+ * @param data The input array + * @param axis Axis along which to choose the top k indices. If not given, the flattened array is used. Default is -1. + * @param k Number of top elements to select, should be always smaller than or equal to the element number in the given axis. A global sort is performed if set k < 1. + * @param ret_typ The return type. + "value" means to return the top k values, "indices" means to return the indices of the top k values, "mask" means to return a mask array containing 0 and 1. 1 means the top k values. "both" means to return a list of both values and indices of top k elements. + * @param is_ascend Whether to choose k largest or k smallest elements. Top K largest elements will be chosen if set to false. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def topk (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, k : Option[Int] = None, ret_typ : Option[String] = None, is_ascend : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Permutes the dimensions of an array.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * transpose(x) = [[ 1., 3.],
+ * [ 2., 4.]]
+ *
+ * x = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 5., 6.],
+ * [ 7., 8.]]]
+ *
+ * transpose(x) = [[[ 1., 5.],
+ * [ 3., 7.]],
+ *
+ * [[ 2., 6.],
+ * [ 4., 8.]]]
+ *
+ * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
+ * [ 5., 6.]],
+ *
+ * [[ 3., 4.],
+ * [ 7., 8.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L310
+ * @param data Source input + * @param axes Target axis order. By default the axes will be inverted. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def transpose (data : org.apache.mxnet.NDArray, axes : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return the element-wise truncated value of the input.
+ *
+ * The truncated value of the scalar x is the nearest integer i which is closer to
+ * zero than x is. In short, the fractional part of the signed number x is discarded.
+ *
+ * Example::
+ *
+ * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
+ *
+ * The storage type of ``trunc`` output depends upon the input storage type:
+ *
+ * - trunc(default) = default
+ * - trunc(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
+ * @param data The input array. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def trunc (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @param low Lower bound of the distribution. + * @param high Upper bound of the distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.NDArray + */ +@Experimental +def uniform (low : Option[org.apache.mxnet.Base.MXFloat] = None, high : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
+ *
+ * Examples::
+ *
+ * A = [22,41,37]
+ * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L65
+ * @param data Array of flat indices + * @param shape Shape of the array into which the multi-indices apply. + * @return org.apache.mxnet.NDArray + */ +@Experimental +def unravel_index (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return the elements, either from x or y, depending on the condition.
+ *
+ * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
+ * depending on the elements from condition are true or false. x and y must have the same shape.
+ * If condition has the same shape as x, each element in the output array is from x if the
+ * corresponding element in the condition is true, and from y if false.
+ *
+ * If condition does not have the same shape as x, it must be a 1D array whose size is
+ * the same as x's first dimension size. Each row of the output array is from x's row
+ * if the corresponding element from condition is true, and from y's row if false.
+ *
+ * Note that all non-zero values are interpreted as ``True`` in condition.
+ *
+ * Examples::
+ *
+ * x = [[1, 2], [3, 4]]
+ * y = [[5, 6], [7, 8]]
+ * cond = [[0, 1], [-1, 0]]
+ *
+ * where(cond, x, y) = [[5, 2], [3, 8]]
+ *
+ * csr_cond = cast_storage(cond, 'csr')
+ *
+ * where(csr_cond, x, y) = [[5, 2], [3, 8]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/control_flow_op.cc:L57
+ * @param condition condition array + * @param x + * @param y + * @return org.apache.mxnet.NDArray + */ +@Experimental +def where (condition : org.apache.mxnet.NDArray, x : org.apache.mxnet.NDArray, y : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return an array of zeros with the same shape, type and storage type
+ * as the input array.
+ *
+ * The storage type of ``zeros_like`` output depends on the storage type of the input
+ *
+ * - zeros_like(row_sparse) = row_sparse
+ * - zeros_like(csr) = csr
+ * - zeros_like(default) = default
+ *
+ * Examples::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * zeros_like(x) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ * @param data The input + * @return org.apache.mxnet.NDArray + */ +@Experimental +def zeros_like (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn +} \ No newline at end of file diff --git a/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayBase.scala b/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayBase.scala new file mode 100644 index 000000000000..b646e9962813 --- /dev/null +++ b/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayBase.scala @@ -0,0 +1,11488 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// scalastyle:off +package org.apache.mxnet +import org.apache.mxnet.annotation.Experimental +abstract class NDArrayBase { + /** + * Applies an activation function element-wise to the input.
+ *
+ * The following activation functions are supported:
+ *
+ * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
+ * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
+ * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
+ * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
+ * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
+ *
+ *
+ *
+ * Defined in src/operator/nn/activation.cc:L161
+ * @return org.apache.mxnet.NDArray + */ +def Activation(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies an activation function element-wise to the input.
+ *
+ * The following activation functions are supported:
+ *
+ * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
+ * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
+ * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
+ * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
+ * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
+ *
+ *
+ *
+ * Defined in src/operator/nn/activation.cc:L161
+ * @return org.apache.mxnet.NDArray + */ +def Activation(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Batch normalization.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
+ * two outputs are blocked.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
+ * axis to be the last item in the input shape.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/nn/batch_norm.cc:L575
+ * @return org.apache.mxnet.NDArray + */ +def BatchNorm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Batch normalization.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
+ * two outputs are blocked.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
+ * axis to be the last item in the input shape.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/nn/batch_norm.cc:L575
+ * @return org.apache.mxnet.NDArray + */ +def BatchNorm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Batch normalization.
+ *
+ * This operator is DEPRECATED. Perform BatchNorm on the input.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_var`` as well, which are needed for the backward pass.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/batch_norm_v1.cc:L92
+ * @return org.apache.mxnet.NDArray + */ +def BatchNorm_v1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Batch normalization.
+ *
+ * This operator is DEPRECATED. Perform BatchNorm on the input.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_var`` as well, which are needed for the backward pass.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/batch_norm_v1.cc:L92
+ * @return org.apache.mxnet.NDArray + */ +def BatchNorm_v1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies bilinear sampling to input feature map.
+ *
+ * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
+ * except that the operator has the backward pass.
+ *
+ * Given :math:`data` and :math:`grid`, then the output is computed by
+ *
+ * .. math::
+ * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
+ * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
+ * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
+ *
+ * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
+ * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
+ *
+ * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
+ *
+ * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
+ * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
+ * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
+ *
+ * Example 1::
+ *
+ * ## Zoom out data two times
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * affine_matrix = array([[2, 0, 0],
+ * [0, 2, 0]])
+ *
+ * affine_matrix = reshape(affine_matrix, shape=(1, 6))
+ *
+ * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
+ *
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 0, 0, 0, 0],
+ * [ 0, 3.5, 6.5, 0],
+ * [ 0, 1.25, 2.5, 0],
+ * [ 0, 0, 0, 0]]]
+ *
+ *
+ * Example 2::
+ *
+ * ## shift data horizontally by -1 pixel
+ *
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * warp_maxtrix = array([[[[1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1]],
+ * [[0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0]]]])
+ *
+ * grid = GridGenerator(data=warp_matrix, transform_type='warp')
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 4, 3, 6, 0],
+ * [ 8, 8, 9, 0],
+ * [ 4, 1, 5, 0],
+ * [ 0, 1, 3, 0]]]
+ *
+ *
+ * Defined in src/operator/bilinear_sampler.cc:L245
+ * @return org.apache.mxnet.NDArray + */ +def BilinearSampler(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies bilinear sampling to input feature map.
+ *
+ * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
+ * except that the operator has the backward pass.
+ *
+ * Given :math:`data` and :math:`grid`, then the output is computed by
+ *
+ * .. math::
+ * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
+ * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
+ * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
+ *
+ * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
+ * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
+ *
+ * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
+ *
+ * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
+ * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
+ * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
+ *
+ * Example 1::
+ *
+ * ## Zoom out data two times
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * affine_matrix = array([[2, 0, 0],
+ * [0, 2, 0]])
+ *
+ * affine_matrix = reshape(affine_matrix, shape=(1, 6))
+ *
+ * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
+ *
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 0, 0, 0, 0],
+ * [ 0, 3.5, 6.5, 0],
+ * [ 0, 1.25, 2.5, 0],
+ * [ 0, 0, 0, 0]]]
+ *
+ *
+ * Example 2::
+ *
+ * ## shift data horizontally by -1 pixel
+ *
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * warp_maxtrix = array([[[[1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1]],
+ * [[0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0]]]])
+ *
+ * grid = GridGenerator(data=warp_matrix, transform_type='warp')
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 4, 3, 6, 0],
+ * [ 8, 8, 9, 0],
+ * [ 4, 1, 5, 0],
+ * [ 0, 1, 3, 0]]]
+ *
+ *
+ * Defined in src/operator/bilinear_sampler.cc:L245
+ * @return org.apache.mxnet.NDArray + */ +def BilinearSampler(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @return org.apache.mxnet.NDArray + */ +def BlockGrad(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @return org.apache.mxnet.NDArray + */ +def BlockGrad(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @return org.apache.mxnet.NDArray + */ +def Cast(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @return org.apache.mxnet.NDArray + */ +def Cast(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @return org.apache.mxnet.NDArray + */ +def Concat(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @return org.apache.mxnet.NDArray + */ +def Concat(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Compute *N*-D convolution on *(N+2)*-D input.
+ *
+ * In the 2-D convolution, given input data with shape *(batch_size,
+ * channel, height, width)*, the output is computed by
+ *
+ * .. math::
+ *
+ * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
+ * weight[i,j,:,:]
+ *
+ * where :math:`\star` is the 2-D cross-correlation operator.
+ *
+ * For general 2-D convolution, the shapes are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*.
+ *
+ * Define::
+ *
+ * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
+ *
+ * then we have::
+ *
+ * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
+ * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
+ * width)*. We can choose other layouts such as *NHWC*.
+ *
+ * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
+ * evenly into *g* parts along the channel axis, and also evenly split ``weight``
+ * along the first dimension. Next compute the convolution on the *i*-th part of
+ * the data with the *i*-th weight part. The output is obtained by concatenating all
+ * the *g* results.
+ *
+ * 1-D convolution does not have *height* dimension but only *width* in space.
+ *
+ * - **data**: *(batch_size, channel, width)*
+ * - **weight**: *(num_filter, channel, kernel[0])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * 3-D convolution adds an additional *depth* dimension besides *height* and
+ * *width*. The shapes are
+ *
+ * - **data**: *(batch_size, channel, depth, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
+ *
+ * Both ``weight`` and ``bias`` are learnable parameters.
+ *
+ * There are other options to tune the performance.
+ *
+ * - **cudnn_tune**: enable this option leads to higher startup time but may give
+ * faster speed. Options are
+ *
+ * - **off**: no tuning
+ * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
+ * exceed workspace limit.
+ * - **fastest**: pick the fastest algorithm and ignore workspace limit.
+ * - **None** (default): the behavior is determined by environment variable
+ * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
+ * (default), 2 for fastest.
+ *
+ * - **workspace**: A large number leads to more (GPU) memory usage but may improve
+ * the performance.
+ *
+ *
+ *
+ * Defined in src/operator/nn/convolution.cc:L470
+ * @return org.apache.mxnet.NDArray + */ +def Convolution(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Compute *N*-D convolution on *(N+2)*-D input.
+ *
+ * In the 2-D convolution, given input data with shape *(batch_size,
+ * channel, height, width)*, the output is computed by
+ *
+ * .. math::
+ *
+ * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
+ * weight[i,j,:,:]
+ *
+ * where :math:`\star` is the 2-D cross-correlation operator.
+ *
+ * For general 2-D convolution, the shapes are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*.
+ *
+ * Define::
+ *
+ * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
+ *
+ * then we have::
+ *
+ * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
+ * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
+ * width)*. We can choose other layouts such as *NHWC*.
+ *
+ * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
+ * evenly into *g* parts along the channel axis, and also evenly split ``weight``
+ * along the first dimension. Next compute the convolution on the *i*-th part of
+ * the data with the *i*-th weight part. The output is obtained by concatenating all
+ * the *g* results.
+ *
+ * 1-D convolution does not have *height* dimension but only *width* in space.
+ *
+ * - **data**: *(batch_size, channel, width)*
+ * - **weight**: *(num_filter, channel, kernel[0])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * 3-D convolution adds an additional *depth* dimension besides *height* and
+ * *width*. The shapes are
+ *
+ * - **data**: *(batch_size, channel, depth, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
+ *
+ * Both ``weight`` and ``bias`` are learnable parameters.
+ *
+ * There are other options to tune the performance.
+ *
+ * - **cudnn_tune**: enable this option leads to higher startup time but may give
+ * faster speed. Options are
+ *
+ * - **off**: no tuning
+ * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
+ * exceed workspace limit.
+ * - **fastest**: pick the fastest algorithm and ignore workspace limit.
+ * - **None** (default): the behavior is determined by environment variable
+ * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
+ * (default), 2 for fastest.
+ *
+ * - **workspace**: A large number leads to more (GPU) memory usage but may improve
+ * the performance.
+ *
+ *
+ *
+ * Defined in src/operator/nn/convolution.cc:L470
+ * @return org.apache.mxnet.NDArray + */ +def Convolution(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * This operator is DEPRECATED. Apply convolution to input then add a bias.
+ * @return org.apache.mxnet.NDArray + */ +def Convolution_v1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * This operator is DEPRECATED. Apply convolution to input then add a bias.
+ * @return org.apache.mxnet.NDArray + */ +def Convolution_v1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies correlation to inputs.
+ *
+ * The correlation layer performs multiplicative patch comparisons between two feature maps.
+ *
+ * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
+ * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
+ *
+ * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
+ * :math:`x_{2}` in the second map is then defined as:
+ *
+ * .. math::
+ *
+ * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
+ *
+ * for a square patch of size :math:`K:=2k+1`.
+ *
+ * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
+ * data. For this reason, it has no training weights.
+ *
+ * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
+ *
+ * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
+ * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
+ * centered around :math:`x_{1}`.
+ *
+ * The final output is defined by the following expression:
+ *
+ * .. math::
+ * out[n, q, i, j] = c(x_{i, j}, x_{q})
+ *
+ * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
+ *
+ *
+ * Defined in src/operator/correlation.cc:L198
+ * @return org.apache.mxnet.NDArray + */ +def Correlation(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies correlation to inputs.
+ *
+ * The correlation layer performs multiplicative patch comparisons between two feature maps.
+ *
+ * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
+ * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
+ *
+ * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
+ * :math:`x_{2}` in the second map is then defined as:
+ *
+ * .. math::
+ *
+ * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
+ *
+ * for a square patch of size :math:`K:=2k+1`.
+ *
+ * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
+ * data. For this reason, it has no training weights.
+ *
+ * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
+ *
+ * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
+ * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
+ * centered around :math:`x_{1}`.
+ *
+ * The final output is defined by the following expression:
+ *
+ * .. math::
+ * out[n, q, i, j] = c(x_{i, j}, x_{q})
+ *
+ * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
+ *
+ *
+ * Defined in src/operator/correlation.cc:L198
+ * @return org.apache.mxnet.NDArray + */ +def Correlation(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + *
+ *
+ * .. note:: `Crop` is deprecated. Use `slice` instead.
+ *
+ * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
+ * with width and height of the second input symbol, i.e., with one input, we need h_w to
+ * specify the crop height and width, otherwise the second input symbol's size will be used
+ *
+ *
+ * Defined in src/operator/crop.cc:L50
+ * @return org.apache.mxnet.NDArray + */ +def Crop(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + *
+ *
+ * .. note:: `Crop` is deprecated. Use `slice` instead.
+ *
+ * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
+ * with width and height of the second input symbol, i.e., with one input, we need h_w to
+ * specify the crop height and width, otherwise the second input symbol's size will be used
+ *
+ *
+ * Defined in src/operator/crop.cc:L50
+ * @return org.apache.mxnet.NDArray + */ +def Crop(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Apply a custom operator implemented in a frontend language (like Python).
+ *
+ * Custom operators should override required methods like `forward` and `backward`.
+ * The custom operator must be registered before it can be used.
+ * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
+ *
+ *
+ *
+ * Defined in src/operator/custom/custom.cc:L547
+ * @return org.apache.mxnet.NDArray + */ +def Custom(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Apply a custom operator implemented in a frontend language (like Python).
+ *
+ * Custom operators should override required methods like `forward` and `backward`.
+ * The custom operator must be registered before it can be used.
+ * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
+ *
+ *
+ *
+ * Defined in src/operator/custom/custom.cc:L547
+ * @return org.apache.mxnet.NDArray + */ +def Custom(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
+ * @return org.apache.mxnet.NDArray + */ +def Deconvolution(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
+ * @return org.apache.mxnet.NDArray + */ +def Deconvolution(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies dropout operation to input array.
+ *
+ * - During training, each element of the input is set to zero with probability p.
+ * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
+ * sum of the input unchanged.
+ *
+ * - During testing, this operator does not change the input if mode is 'training'.
+ * If mode is 'always', the same computaion as during training will be applied.
+ *
+ * Example::
+ *
+ * random.seed(998)
+ * input_array = array([[3., 0.5, -0.5, 2., 7.],
+ * [2., -0.4, 7., 3., 0.2]])
+ * a = symbol.Variable('a')
+ * dropout = symbol.Dropout(a, p = 0.2)
+ * executor = dropout.simple_bind(a = input_array.shape)
+ *
+ * ## If training
+ * executor.forward(is_train = True, a = input_array)
+ * executor.outputs
+ * [[ 3.75 0.625 -0. 2.5 8.75 ]
+ * [ 2.5 -0.5 8.75 3.75 0. ]]
+ *
+ * ## If testing
+ * executor.forward(is_train = False, a = input_array)
+ * executor.outputs
+ * [[ 3. 0.5 -0.5 2. 7. ]
+ * [ 2. -0.4 7. 3. 0.2 ]]
+ *
+ *
+ * Defined in src/operator/nn/dropout.cc:L76
+ * @return org.apache.mxnet.NDArray + */ +def Dropout(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies dropout operation to input array.
+ *
+ * - During training, each element of the input is set to zero with probability p.
+ * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
+ * sum of the input unchanged.
+ *
+ * - During testing, this operator does not change the input if mode is 'training'.
+ * If mode is 'always', the same computaion as during training will be applied.
+ *
+ * Example::
+ *
+ * random.seed(998)
+ * input_array = array([[3., 0.5, -0.5, 2., 7.],
+ * [2., -0.4, 7., 3., 0.2]])
+ * a = symbol.Variable('a')
+ * dropout = symbol.Dropout(a, p = 0.2)
+ * executor = dropout.simple_bind(a = input_array.shape)
+ *
+ * ## If training
+ * executor.forward(is_train = True, a = input_array)
+ * executor.outputs
+ * [[ 3.75 0.625 -0. 2.5 8.75 ]
+ * [ 2.5 -0.5 8.75 3.75 0. ]]
+ *
+ * ## If testing
+ * executor.forward(is_train = False, a = input_array)
+ * executor.outputs
+ * [[ 3. 0.5 -0.5 2. 7. ]
+ * [ 2. -0.4 7. 3. 0.2 ]]
+ *
+ *
+ * Defined in src/operator/nn/dropout.cc:L76
+ * @return org.apache.mxnet.NDArray + */ +def Dropout(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @return org.apache.mxnet.NDArray + */ +def ElementWiseSum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @return org.apache.mxnet.NDArray + */ +def ElementWiseSum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Maps integer indices to vector representations (embeddings).
+ *
+ * This operator maps words to real-valued vectors in a high-dimensional space,
+ * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
+ * For example, it has been noted that in the learned embedding spaces, similar words tend
+ * to be close to each other and dissimilar words far apart.
+ *
+ * For an input array of shape (d1, ..., dK),
+ * the shape of an output array is (d1, ..., dK, output_dim).
+ * All the input values should be integers in the range [0, input_dim).
+ *
+ * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
+ * (ip0, op0).
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last vector in an embedding matrix.
+ *
+ * Examples::
+ *
+ * input_dim = 4
+ * output_dim = 5
+ *
+ * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
+ * y = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.],
+ * [ 10., 11., 12., 13., 14.],
+ * [ 15., 16., 17., 18., 19.]]
+ *
+ * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
+ * x = [[ 1., 3.],
+ * [ 0., 2.]]
+ *
+ * // Mapped input x to its vector representation y.
+ * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
+ * [ 15., 16., 17., 18., 19.]],
+ *
+ * [[ 0., 1., 2., 3., 4.],
+ * [ 10., 11., 12., 13., 14.]]]
+ *
+ *
+ * The storage type of weight can be either row_sparse or default, while
+ * the storage type of weight's grad depends on the value of "sparse_grad".
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L232
+ * @return org.apache.mxnet.NDArray + */ +def Embedding(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Maps integer indices to vector representations (embeddings).
+ *
+ * This operator maps words to real-valued vectors in a high-dimensional space,
+ * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
+ * For example, it has been noted that in the learned embedding spaces, similar words tend
+ * to be close to each other and dissimilar words far apart.
+ *
+ * For an input array of shape (d1, ..., dK),
+ * the shape of an output array is (d1, ..., dK, output_dim).
+ * All the input values should be integers in the range [0, input_dim).
+ *
+ * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
+ * (ip0, op0).
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last vector in an embedding matrix.
+ *
+ * Examples::
+ *
+ * input_dim = 4
+ * output_dim = 5
+ *
+ * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
+ * y = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.],
+ * [ 10., 11., 12., 13., 14.],
+ * [ 15., 16., 17., 18., 19.]]
+ *
+ * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
+ * x = [[ 1., 3.],
+ * [ 0., 2.]]
+ *
+ * // Mapped input x to its vector representation y.
+ * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
+ * [ 15., 16., 17., 18., 19.]],
+ *
+ * [[ 0., 1., 2., 3., 4.],
+ * [ 10., 11., 12., 13., 14.]]]
+ *
+ *
+ * The storage type of weight can be either row_sparse or default, while
+ * the storage type of weight's grad depends on the value of "sparse_grad".
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L232
+ * @return org.apache.mxnet.NDArray + */ +def Embedding(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @return org.apache.mxnet.NDArray + */ +def Flatten(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @return org.apache.mxnet.NDArray + */ +def Flatten(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies a linear transformation: :math:`Y = XW^T + b`.
+ *
+ * If ``flatten`` is set to be true, then the shapes are:
+ *
+ * - **data**: `(batch_size, x1, x2, ..., xn)`
+ * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(batch_size, num_hidden)`
+ *
+ * If ``flatten`` is set to be false, then the shapes are:
+ *
+ * - **data**: `(x1, x2, ..., xn, input_dim)`
+ * - **weight**: `(num_hidden, input_dim)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(x1, x2, ..., xn, num_hidden)`
+ *
+ * The learnable parameters include both ``weight`` and ``bias``.
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * Note that the operator also supports forward computation with `row_sparse` weight and bias,
+ * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
+ * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
+ *
+ *
+ *
+ * Defined in src/operator/nn/fully_connected.cc:L254
+ * @return org.apache.mxnet.NDArray + */ +def FullyConnected(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies a linear transformation: :math:`Y = XW^T + b`.
+ *
+ * If ``flatten`` is set to be true, then the shapes are:
+ *
+ * - **data**: `(batch_size, x1, x2, ..., xn)`
+ * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(batch_size, num_hidden)`
+ *
+ * If ``flatten`` is set to be false, then the shapes are:
+ *
+ * - **data**: `(x1, x2, ..., xn, input_dim)`
+ * - **weight**: `(num_hidden, input_dim)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(x1, x2, ..., xn, num_hidden)`
+ *
+ * The learnable parameters include both ``weight`` and ``bias``.
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * Note that the operator also supports forward computation with `row_sparse` weight and bias,
+ * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
+ * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
+ *
+ *
+ *
+ * Defined in src/operator/nn/fully_connected.cc:L254
+ * @return org.apache.mxnet.NDArray + */ +def FullyConnected(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Generates 2D sampling grid for bilinear sampling.
+ * @return org.apache.mxnet.NDArray + */ +def GridGenerator(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Generates 2D sampling grid for bilinear sampling.
+ * @return org.apache.mxnet.NDArray + */ +def GridGenerator(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Apply a sparse regularization to the output a sigmoid activation function.
+ * @return org.apache.mxnet.NDArray + */ +def IdentityAttachKLSparseReg(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Apply a sparse regularization to the output a sigmoid activation function.
+ * @return org.apache.mxnet.NDArray + */ +def IdentityAttachKLSparseReg(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies instance normalization to the n-dimensional input array.
+ *
+ * This operator takes an n-dimensional input array where (n>2) and normalizes
+ * the input using the following formula:
+ *
+ * .. math::
+ *
+ * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
+ *
+ * This layer is similar to batch normalization layer (`BatchNorm`)
+ * with two differences: first, the normalization is
+ * carried out per example (instance), not over a batch. Second, the
+ * same normalization is applied both at test and train time. This
+ * operation is also known as `contrast normalization`.
+ *
+ * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
+ * `gamma` and `beta` parameters must be vectors of shape [channel].
+ *
+ * This implementation is based on paper:
+ *
+ * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
+ * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
+ *
+ * Examples::
+ *
+ * // Input of shape (2,1,2)
+ * x = [[[ 1.1, 2.2]],
+ * [[ 3.3, 4.4]]]
+ *
+ * // gamma parameter of length 1
+ * gamma = [1.5]
+ *
+ * // beta parameter of length 1
+ * beta = [0.5]
+ *
+ * // Instance normalization is calculated with the above formula
+ * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
+ * [[-0.99752653, 1.99752724]]]
+ *
+ *
+ *
+ * Defined in src/operator/instance_norm.cc:L95
+ * @return org.apache.mxnet.NDArray + */ +def InstanceNorm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies instance normalization to the n-dimensional input array.
+ *
+ * This operator takes an n-dimensional input array where (n>2) and normalizes
+ * the input using the following formula:
+ *
+ * .. math::
+ *
+ * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
+ *
+ * This layer is similar to batch normalization layer (`BatchNorm`)
+ * with two differences: first, the normalization is
+ * carried out per example (instance), not over a batch. Second, the
+ * same normalization is applied both at test and train time. This
+ * operation is also known as `contrast normalization`.
+ *
+ * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
+ * `gamma` and `beta` parameters must be vectors of shape [channel].
+ *
+ * This implementation is based on paper:
+ *
+ * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
+ * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
+ *
+ * Examples::
+ *
+ * // Input of shape (2,1,2)
+ * x = [[[ 1.1, 2.2]],
+ * [[ 3.3, 4.4]]]
+ *
+ * // gamma parameter of length 1
+ * gamma = [1.5]
+ *
+ * // beta parameter of length 1
+ * beta = [0.5]
+ *
+ * // Instance normalization is calculated with the above formula
+ * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
+ * [[-0.99752653, 1.99752724]]]
+ *
+ *
+ *
+ * Defined in src/operator/instance_norm.cc:L95
+ * @return org.apache.mxnet.NDArray + */ +def InstanceNorm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Normalize the input array using the L2 norm.
+ *
+ * For 1-D NDArray, it computes::
+ *
+ * out = data / sqrt(sum(data ** 2) + eps)
+ *
+ * For N-D NDArray, if the input array has shape (N, N, ..., N),
+ *
+ * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
+ * array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
+ * in the array by its L2 norm.::
+ *
+ * for dim in 2...N
+ * for i in 0...N
+ * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
+ * -dim-
+ *
+ * Example::
+ *
+ * x = [[[1,2],
+ * [3,4]],
+ * [[2,2],
+ * [5,6]]]
+ *
+ * L2Normalization(x, mode='instance')
+ * =[[[ 0.18257418 0.36514837]
+ * [ 0.54772252 0.73029673]]
+ * [[ 0.24077171 0.24077171]
+ * [ 0.60192931 0.72231513]]]
+ *
+ * L2Normalization(x, mode='channel')
+ * =[[[ 0.31622776 0.44721359]
+ * [ 0.94868326 0.89442718]]
+ * [[ 0.37139067 0.31622776]
+ * [ 0.92847669 0.94868326]]]
+ *
+ * L2Normalization(x, mode='spatial')
+ * =[[[ 0.44721359 0.89442718]
+ * [ 0.60000002 0.80000001]]
+ * [[ 0.70710677 0.70710677]
+ * [ 0.6401844 0.76822126]]]
+ *
+ *
+ *
+ * Defined in src/operator/l2_normalization.cc:L98
+ * @return org.apache.mxnet.NDArray + */ +def L2Normalization(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Normalize the input array using the L2 norm.
+ *
+ * For 1-D NDArray, it computes::
+ *
+ * out = data / sqrt(sum(data ** 2) + eps)
+ *
+ * For N-D NDArray, if the input array has shape (N, N, ..., N),
+ *
+ * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
+ * array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
+ * in the array by its L2 norm.::
+ *
+ * for dim in 2...N
+ * for i in 0...N
+ * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
+ * -dim-
+ *
+ * Example::
+ *
+ * x = [[[1,2],
+ * [3,4]],
+ * [[2,2],
+ * [5,6]]]
+ *
+ * L2Normalization(x, mode='instance')
+ * =[[[ 0.18257418 0.36514837]
+ * [ 0.54772252 0.73029673]]
+ * [[ 0.24077171 0.24077171]
+ * [ 0.60192931 0.72231513]]]
+ *
+ * L2Normalization(x, mode='channel')
+ * =[[[ 0.31622776 0.44721359]
+ * [ 0.94868326 0.89442718]]
+ * [[ 0.37139067 0.31622776]
+ * [ 0.92847669 0.94868326]]]
+ *
+ * L2Normalization(x, mode='spatial')
+ * =[[[ 0.44721359 0.89442718]
+ * [ 0.60000002 0.80000001]]
+ * [[ 0.70710677 0.70710677]
+ * [ 0.6401844 0.76822126]]]
+ *
+ *
+ *
+ * Defined in src/operator/l2_normalization.cc:L98
+ * @return org.apache.mxnet.NDArray + */ +def L2Normalization(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies local response normalization to the input.
+ *
+ * The local response normalization layer performs "lateral inhibition" by normalizing
+ * over local input regions.
+ *
+ * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
+ * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
+ * activity :math:`b_{x,y}^{i}` is given by the expression:
+ *
+ * .. math::
+ * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
+ *
+ * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
+ * number of kernels in the layer.
+ *
+ *
+ *
+ * Defined in src/operator/nn/lrn.cc:L175
+ * @return org.apache.mxnet.NDArray + */ +def LRN(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies local response normalization to the input.
+ *
+ * The local response normalization layer performs "lateral inhibition" by normalizing
+ * over local input regions.
+ *
+ * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
+ * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
+ * activity :math:`b_{x,y}^{i}` is given by the expression:
+ *
+ * .. math::
+ * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
+ *
+ * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
+ * number of kernels in the layer.
+ *
+ *
+ *
+ * Defined in src/operator/nn/lrn.cc:L175
+ * @return org.apache.mxnet.NDArray + */ +def LRN(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Layer normalization.
+ *
+ * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis and then
+ * compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters.
+ *
+ * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_std``. Note that no gradient will be passed through these two outputs.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is -1, which sets the channel
+ * axis to be the last item in the input shape.
+ *
+ *
+ *
+ * Defined in src/operator/nn/layer_norm.cc:L94
+ * @return org.apache.mxnet.NDArray + */ +def LayerNorm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Layer normalization.
+ *
+ * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis and then
+ * compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters.
+ *
+ * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_std``. Note that no gradient will be passed through these two outputs.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is -1, which sets the channel
+ * axis to be the last item in the input shape.
+ *
+ *
+ *
+ * Defined in src/operator/nn/layer_norm.cc:L94
+ * @return org.apache.mxnet.NDArray + */ +def LayerNorm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies Leaky rectified linear unit activation element-wise to the input.
+ *
+ * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
+ * when the input is negative and has a slope of one when input is positive.
+ *
+ * The following modified ReLU Activation functions are supported:
+ *
+ * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
+ * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
+ * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
+ * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
+ * *[lower_bound, upper_bound)* for training, while fixed to be
+ * *(lower_bound+upper_bound)/2* for inference.
+ *
+ *
+ *
+ * Defined in src/operator/leaky_relu.cc:L63
+ * @return org.apache.mxnet.NDArray + */ +def LeakyReLU(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies Leaky rectified linear unit activation element-wise to the input.
+ *
+ * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
+ * when the input is negative and has a slope of one when input is positive.
+ *
+ * The following modified ReLU Activation functions are supported:
+ *
+ * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
+ * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
+ * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
+ * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
+ * *[lower_bound, upper_bound)* for training, while fixed to be
+ * *(lower_bound+upper_bound)/2* for inference.
+ *
+ *
+ *
+ * Defined in src/operator/leaky_relu.cc:L63
+ * @return org.apache.mxnet.NDArray + */ +def LeakyReLU(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes and optimizes for squared loss during backward propagation.
+ * Just outputs ``data`` during forward propagation.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the squared loss estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
+ *
+ * .. note::
+ * Use the LinearRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LinearRegressionOutput(default, default) = default
+ * - LinearRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L92
+ * @return org.apache.mxnet.NDArray + */ +def LinearRegressionOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes and optimizes for squared loss during backward propagation.
+ * Just outputs ``data`` during forward propagation.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the squared loss estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
+ *
+ * .. note::
+ * Use the LinearRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LinearRegressionOutput(default, default) = default
+ * - LinearRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L92
+ * @return org.apache.mxnet.NDArray + */ +def LinearRegressionOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies a logistic function to the input.
+ *
+ * The logistic function, also known as the sigmoid function, is computed as
+ * :math:`\frac{1}{1+exp(-\textbf{x})}`.
+ *
+ * Commonly, the sigmoid is used to squash the real-valued output of a linear model
+ * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
+ * It is suitable for binary classification or probability prediction tasks.
+ *
+ * .. note::
+ * Use the LogisticRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LogisticRegressionOutput(default, default) = default
+ * - LogisticRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L148
+ * @return org.apache.mxnet.NDArray + */ +def LogisticRegressionOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies a logistic function to the input.
+ *
+ * The logistic function, also known as the sigmoid function, is computed as
+ * :math:`\frac{1}{1+exp(-\textbf{x})}`.
+ *
+ * Commonly, the sigmoid is used to squash the real-valued output of a linear model
+ * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
+ * It is suitable for binary classification or probability prediction tasks.
+ *
+ * .. note::
+ * Use the LogisticRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LogisticRegressionOutput(default, default) = default
+ * - LogisticRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L148
+ * @return org.apache.mxnet.NDArray + */ +def LogisticRegressionOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes mean absolute error of the input.
+ *
+ * MAE is a risk metric corresponding to the expected value of the absolute error.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
+ *
+ * .. note::
+ * Use the MAERegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - MAERegressionOutput(default, default) = default
+ * - MAERegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L120
+ * @return org.apache.mxnet.NDArray + */ +def MAERegressionOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes mean absolute error of the input.
+ *
+ * MAE is a risk metric corresponding to the expected value of the absolute error.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
+ *
+ * .. note::
+ * Use the MAERegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - MAERegressionOutput(default, default) = default
+ * - MAERegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L120
+ * @return org.apache.mxnet.NDArray + */ +def MAERegressionOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = MakeLoss(cross_entropy)
+ *
+ * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * In addition, we can give a scale to the loss by setting ``grad_scale``,
+ * so that the gradient of the loss will be rescaled in the backpropagation.
+ *
+ * .. note:: This operator should be used as a Symbol instead of NDArray.
+ *
+ *
+ *
+ * Defined in src/operator/make_loss.cc:L71
+ * @return org.apache.mxnet.NDArray + */ +def MakeLoss(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = MakeLoss(cross_entropy)
+ *
+ * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * In addition, we can give a scale to the loss by setting ``grad_scale``,
+ * so that the gradient of the loss will be rescaled in the backpropagation.
+ *
+ * .. note:: This operator should be used as a Symbol instead of NDArray.
+ *
+ *
+ *
+ * Defined in src/operator/make_loss.cc:L71
+ * @return org.apache.mxnet.NDArray + */ +def MakeLoss(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @return org.apache.mxnet.NDArray + */ +def Pad(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @return org.apache.mxnet.NDArray + */ +def Pad(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs pooling on the input.
+ *
+ * The shapes for 1-D pooling are
+ *
+ * - **data**: *(batch_size, channel, width)*,
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * The shapes for 2-D pooling are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ * - **lp**: Lp pooling
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ * Notes on Lp pooling:
+ *
+ * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
+ * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
+ * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
+ *
+ * For each window ``X``, the mathematical expression for Lp pooling is:
+ *
+ * ..math::
+ * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
+ *
+ *
+ *
+ * Defined in src/operator/nn/pooling.cc:L367
+ * @return org.apache.mxnet.NDArray + */ +def Pooling(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs pooling on the input.
+ *
+ * The shapes for 1-D pooling are
+ *
+ * - **data**: *(batch_size, channel, width)*,
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * The shapes for 2-D pooling are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ * - **lp**: Lp pooling
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ * Notes on Lp pooling:
+ *
+ * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
+ * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
+ * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
+ *
+ * For each window ``X``, the mathematical expression for Lp pooling is:
+ *
+ * ..math::
+ * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
+ *
+ *
+ *
+ * Defined in src/operator/nn/pooling.cc:L367
+ * @return org.apache.mxnet.NDArray + */ +def Pooling(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * This operator is DEPRECATED.
+ * Perform pooling on the input.
+ *
+ * The shapes for 2-D pooling is
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ *
+ * 1-D pooling is special case of 2-D pooling with *weight=1* and
+ * *kernel[1]=1*.
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ *
+ *
+ * Defined in src/operator/pooling_v1.cc:L104
+ * @return org.apache.mxnet.NDArray + */ +def Pooling_v1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * This operator is DEPRECATED.
+ * Perform pooling on the input.
+ *
+ * The shapes for 2-D pooling is
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ *
+ * 1-D pooling is special case of 2-D pooling with *weight=1* and
+ * *kernel[1]=1*.
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ *
+ *
+ * Defined in src/operator/pooling_v1.cc:L104
+ * @return org.apache.mxnet.NDArray + */ +def Pooling_v1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
+ * implemented, with both multi-layer and bidirectional support.
+ *
+ * **Vanilla RNN**
+ *
+ * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
+ * ReLU and Tanh.
+ *
+ * With ReLU activation function:
+ *
+ * .. math::
+ * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * With Tanh activtion function:
+ *
+ * .. math::
+ * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * Reference paper: Finding structure in time - Elman, 1988.
+ * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
+ *
+ * **LSTM**
+ *
+ * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
+ * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
+ * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
+ * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
+ * c_t = f_t * c_{(t-1)} + i_t * g_t \\
+ * h_t = o_t * \tanh(c_t)
+ * \end{array}
+ *
+ * **GRU**
+ *
+ * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
+ *
+ * The definition of GRU here is slightly different from paper but compatible with CUDNN.
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
+ * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
+ * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
+ * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
+ * \end{array}
+ * @return org.apache.mxnet.NDArray + */ +def RNN(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
+ * implemented, with both multi-layer and bidirectional support.
+ *
+ * **Vanilla RNN**
+ *
+ * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
+ * ReLU and Tanh.
+ *
+ * With ReLU activation function:
+ *
+ * .. math::
+ * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * With Tanh activtion function:
+ *
+ * .. math::
+ * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * Reference paper: Finding structure in time - Elman, 1988.
+ * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
+ *
+ * **LSTM**
+ *
+ * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
+ * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
+ * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
+ * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
+ * c_t = f_t * c_{(t-1)} + i_t * g_t \\
+ * h_t = o_t * \tanh(c_t)
+ * \end{array}
+ *
+ * **GRU**
+ *
+ * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
+ *
+ * The definition of GRU here is slightly different from paper but compatible with CUDNN.
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
+ * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
+ * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
+ * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
+ * \end{array}
+ * @return org.apache.mxnet.NDArray + */ +def RNN(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs region of interest(ROI) pooling on the input array.
+ *
+ * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
+ * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
+ * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
+ * layer mostly used in training a `Fast R-CNN` network for object detection.
+ *
+ * This operator takes a 4D feature map as an input array and region proposals as `rois`,
+ * then it pools over sub-regions of input and produces a fixed-sized output array
+ * regardless of the ROI size.
+ *
+ * To crop the feature map accordingly, you can resize the bounding box coordinates
+ * by changing the parameters `rois` and `spatial_scale`.
+ *
+ * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
+ * indicated by a `pooled_size` parameter. batch_size will change to the number of region
+ * bounding boxes after `ROIPooling`.
+ *
+ * The size of each region of interest doesn't have to be perfectly divisible by
+ * the number of pooling sections(`pooled_size`).
+ *
+ * Example::
+ *
+ * x = [[[[ 0., 1., 2., 3., 4., 5.],
+ * [ 6., 7., 8., 9., 10., 11.],
+ * [ 12., 13., 14., 15., 16., 17.],
+ * [ 18., 19., 20., 21., 22., 23.],
+ * [ 24., 25., 26., 27., 28., 29.],
+ * [ 30., 31., 32., 33., 34., 35.],
+ * [ 36., 37., 38., 39., 40., 41.],
+ * [ 42., 43., 44., 45., 46., 47.]]]]
+ *
+ * // region of interest i.e. bounding box coordinates.
+ * y = [[0,0,0,4,4]]
+ *
+ * // returns array of shape (2,2) according to the given roi with max pooling.
+ * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
+ * [ 26., 28.]]]]
+ *
+ * // region of interest is changed due to the change in `spacial_scale` parameter.
+ * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
+ * [ 19., 21.]]]]
+ *
+ *
+ *
+ * Defined in src/operator/roi_pooling.cc:L295
+ * @return org.apache.mxnet.NDArray + */ +def ROIPooling(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs region of interest(ROI) pooling on the input array.
+ *
+ * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
+ * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
+ * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
+ * layer mostly used in training a `Fast R-CNN` network for object detection.
+ *
+ * This operator takes a 4D feature map as an input array and region proposals as `rois`,
+ * then it pools over sub-regions of input and produces a fixed-sized output array
+ * regardless of the ROI size.
+ *
+ * To crop the feature map accordingly, you can resize the bounding box coordinates
+ * by changing the parameters `rois` and `spatial_scale`.
+ *
+ * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
+ * indicated by a `pooled_size` parameter. batch_size will change to the number of region
+ * bounding boxes after `ROIPooling`.
+ *
+ * The size of each region of interest doesn't have to be perfectly divisible by
+ * the number of pooling sections(`pooled_size`).
+ *
+ * Example::
+ *
+ * x = [[[[ 0., 1., 2., 3., 4., 5.],
+ * [ 6., 7., 8., 9., 10., 11.],
+ * [ 12., 13., 14., 15., 16., 17.],
+ * [ 18., 19., 20., 21., 22., 23.],
+ * [ 24., 25., 26., 27., 28., 29.],
+ * [ 30., 31., 32., 33., 34., 35.],
+ * [ 36., 37., 38., 39., 40., 41.],
+ * [ 42., 43., 44., 45., 46., 47.]]]]
+ *
+ * // region of interest i.e. bounding box coordinates.
+ * y = [[0,0,0,4,4]]
+ *
+ * // returns array of shape (2,2) according to the given roi with max pooling.
+ * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
+ * [ 26., 28.]]]]
+ *
+ * // region of interest is changed due to the change in `spacial_scale` parameter.
+ * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
+ * [ 19., 21.]]]]
+ *
+ *
+ *
+ * Defined in src/operator/roi_pooling.cc:L295
+ * @return org.apache.mxnet.NDArray + */ +def ROIPooling(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @return org.apache.mxnet.NDArray + */ +def Reshape(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @return org.apache.mxnet.NDArray + */ +def Reshape(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes support vector machine based transformation of the input.
+ *
+ * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
+ * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
+ * @return org.apache.mxnet.NDArray + */ +def SVMOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes support vector machine based transformation of the input.
+ *
+ * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
+ * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
+ * @return org.apache.mxnet.NDArray + */ +def SVMOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Takes the last element of a sequence.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
+ * of the form [batch_size, other_feature_dims].
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
+ * an input array of positive ints of dimension [batch_size]. To use this parameter,
+ * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
+ * to have the max sequence length.
+ *
+ * .. note:: Alternatively, you can also use `take` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]],
+ *
+ * [[ 10., 11., 12.],
+ * [ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]]
+ *
+ * // returns last sequence when sequence_length parameter is not used
+ * SequenceLast(x) = [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 13., 14., 15.],
+ * [ 25., 26., 27.]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_last.cc:L92
+ * @return org.apache.mxnet.NDArray + */ +def SequenceLast(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Takes the last element of a sequence.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
+ * of the form [batch_size, other_feature_dims].
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
+ * an input array of positive ints of dimension [batch_size]. To use this parameter,
+ * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
+ * to have the max sequence length.
+ *
+ * .. note:: Alternatively, you can also use `take` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]],
+ *
+ * [[ 10., 11., 12.],
+ * [ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]]
+ *
+ * // returns last sequence when sequence_length parameter is not used
+ * SequenceLast(x) = [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 13., 14., 15.],
+ * [ 25., 26., 27.]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_last.cc:L92
+ * @return org.apache.mxnet.NDArray + */ +def SequenceLast(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Sets all elements outside the sequence to a constant value.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
+ * should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length and
+ * this operator works as the `identity` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // works as identity operator when sequence_length parameter is not used
+ * SequenceMask(x) = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [1,1] means 1 of each batch will be kept
+ * // and other rows are masked with default mask value = 0
+ * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
+ * // and other rows are masked with value = 1
+ * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 1., 1.],
+ * [ 16., 17., 18.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_mask.cc:L114
+ * @return org.apache.mxnet.NDArray + */ +def SequenceMask(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Sets all elements outside the sequence to a constant value.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
+ * should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length and
+ * this operator works as the `identity` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // works as identity operator when sequence_length parameter is not used
+ * SequenceMask(x) = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [1,1] means 1 of each batch will be kept
+ * // and other rows are masked with default mask value = 0
+ * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
+ * // and other rows are masked with value = 1
+ * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 1., 1.],
+ * [ 16., 17., 18.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_mask.cc:L114
+ * @return org.apache.mxnet.NDArray + */ +def SequenceMask(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reverses the elements of each sequence.
+ *
+ * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
+ * and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences.
+ * `sequence_length` should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // returns reverse sequence when sequence_length parameter is not used
+ * SequenceReverse(x) = [[[ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]]]
+ *
+ * // sequence_length [2,2] means 2 rows of
+ * // both batch B1 and B2 will be reversed.
+ * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
+ * // will be reversed.
+ * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14, 15.],
+ * [ 4., 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_reverse.cc:L113
+ * @return org.apache.mxnet.NDArray + */ +def SequenceReverse(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reverses the elements of each sequence.
+ *
+ * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
+ * and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences.
+ * `sequence_length` should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // returns reverse sequence when sequence_length parameter is not used
+ * SequenceReverse(x) = [[[ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]]]
+ *
+ * // sequence_length [2,2] means 2 rows of
+ * // both batch B1 and B2 will be reversed.
+ * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
+ * // will be reversed.
+ * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14, 15.],
+ * [ 4., 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_reverse.cc:L113
+ * @return org.apache.mxnet.NDArray + */ +def SequenceReverse(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @return org.apache.mxnet.NDArray + */ +def SliceChannel(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @return org.apache.mxnet.NDArray + */ +def SliceChannel(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Please use `SoftmaxOutput`.
+ *
+ * .. note::
+ *
+ * This operator has been renamed to `SoftmaxOutput`, which
+ * computes the gradient of cross-entropy loss w.r.t softmax output.
+ * To just compute softmax output, use the `softmax` operator.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L138
+ * @return org.apache.mxnet.NDArray + */ +def Softmax(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Please use `SoftmaxOutput`.
+ *
+ * .. note::
+ *
+ * This operator has been renamed to `SoftmaxOutput`, which
+ * computes the gradient of cross-entropy loss w.r.t softmax output.
+ * To just compute softmax output, use the `softmax` operator.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L138
+ * @return org.apache.mxnet.NDArray + */ +def Softmax(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies softmax activation to input. This is intended for internal layers.
+ *
+ * .. note::
+ *
+ * This operator has been deprecated, please use `softmax`.
+ *
+ * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
+ * This is the default mode.
+ *
+ * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
+ * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
+ * has at least 3 dimensions.
+ * This can be used for `fully convolutional network`, `image segmentation`, etc.
+ *
+ * Example::
+ *
+ * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
+ * >>> [2., -.4, 7., 3., 0.2]])
+ * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
+ * >>> print softmax_act.asnumpy()
+ * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
+ * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax_activation.cc:L59
+ * @return org.apache.mxnet.NDArray + */ +def SoftmaxActivation(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies softmax activation to input. This is intended for internal layers.
+ *
+ * .. note::
+ *
+ * This operator has been deprecated, please use `softmax`.
+ *
+ * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
+ * This is the default mode.
+ *
+ * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
+ * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
+ * has at least 3 dimensions.
+ * This can be used for `fully convolutional network`, `image segmentation`, etc.
+ *
+ * Example::
+ *
+ * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
+ * >>> [2., -.4, 7., 3., 0.2]])
+ * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
+ * >>> print softmax_act.asnumpy()
+ * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
+ * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax_activation.cc:L59
+ * @return org.apache.mxnet.NDArray + */ +def SoftmaxActivation(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the gradient of cross entropy loss with respect to softmax output.
+ *
+ * - This operator computes the gradient in two steps.
+ * The cross entropy loss does not actually need to be computed.
+ *
+ * - Applies softmax function on the input array.
+ * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
+ *
+ * - The softmax function, cross entropy loss and gradient is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * - The gradient of cross entropy loss w.r.t softmax output:
+ *
+ * .. math:: \text{gradient} = \text{output} - \text{label}
+ *
+ * - During forward propagation, the softmax function is computed for each instance in the input array.
+ *
+ * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
+ * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
+ * and `multi_output` to specify the way to compute softmax:
+ *
+ * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
+ * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
+ * each row in the reshaped array, and afterwards reshape it back to the original shape
+ * :math:`(d_1, d_2, ..., d_n)`.
+ * - If `preserve_shape` is ``true``, the softmax function will be computed along
+ * the last axis (`axis` = ``-1``).
+ * - If `multi_output` is ``true``, the softmax function will be computed along
+ * the second axis (`axis` = ``1``).
+ *
+ * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
+ * The provided label can be a one-hot label array or a probability label array.
+ *
+ * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
+ * with a particular label to be ignored during backward propagation. **This has no effect when
+ * softmax `output` has same shape as `label`**.
+ *
+ * Example::
+ *
+ * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
+ * label = [1,0,2,3]
+ * ignore_label = 1
+ * SoftmaxOutput(data=data, label = label,\
+ * multi_output=true, use_ignore=true,\
+ * ignore_label=ignore_label)
+ * ## forward softmax output
+ * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]]
+ * ## backward gradient output
+ * [[ 0. 0. 0. 0. ]
+ * [-0.75 0.25 0.25 0.25]
+ * [ 0.25 0.25 -0.75 0.25]
+ * [ 0.25 0.25 0.25 -0.75]]
+ * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
+ *
+ * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
+ * give each loss function different weights.
+ *
+ * - This operator also supports various ways to normalize the gradient by `normalization`,
+ * The `normalization` is applied if softmax output has different shape than the labels.
+ * The `normalization` mode can be set to the followings:
+ *
+ * - ``'null'``: do nothing.
+ * - ``'batch'``: divide the gradient by the batch size.
+ * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L123
+ * @return org.apache.mxnet.NDArray + */ +def SoftmaxOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the gradient of cross entropy loss with respect to softmax output.
+ *
+ * - This operator computes the gradient in two steps.
+ * The cross entropy loss does not actually need to be computed.
+ *
+ * - Applies softmax function on the input array.
+ * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
+ *
+ * - The softmax function, cross entropy loss and gradient is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * - The gradient of cross entropy loss w.r.t softmax output:
+ *
+ * .. math:: \text{gradient} = \text{output} - \text{label}
+ *
+ * - During forward propagation, the softmax function is computed for each instance in the input array.
+ *
+ * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
+ * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
+ * and `multi_output` to specify the way to compute softmax:
+ *
+ * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
+ * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
+ * each row in the reshaped array, and afterwards reshape it back to the original shape
+ * :math:`(d_1, d_2, ..., d_n)`.
+ * - If `preserve_shape` is ``true``, the softmax function will be computed along
+ * the last axis (`axis` = ``-1``).
+ * - If `multi_output` is ``true``, the softmax function will be computed along
+ * the second axis (`axis` = ``1``).
+ *
+ * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
+ * The provided label can be a one-hot label array or a probability label array.
+ *
+ * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
+ * with a particular label to be ignored during backward propagation. **This has no effect when
+ * softmax `output` has same shape as `label`**.
+ *
+ * Example::
+ *
+ * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
+ * label = [1,0,2,3]
+ * ignore_label = 1
+ * SoftmaxOutput(data=data, label = label,\
+ * multi_output=true, use_ignore=true,\
+ * ignore_label=ignore_label)
+ * ## forward softmax output
+ * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]]
+ * ## backward gradient output
+ * [[ 0. 0. 0. 0. ]
+ * [-0.75 0.25 0.25 0.25]
+ * [ 0.25 0.25 -0.75 0.25]
+ * [ 0.25 0.25 0.25 -0.75]]
+ * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
+ *
+ * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
+ * give each loss function different weights.
+ *
+ * - This operator also supports various ways to normalize the gradient by `normalization`,
+ * The `normalization` is applied if softmax output has different shape than the labels.
+ * The `normalization` mode can be set to the followings:
+ *
+ * - ``'null'``: do nothing.
+ * - ``'batch'``: divide the gradient by the batch size.
+ * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L123
+ * @return org.apache.mxnet.NDArray + */ +def SoftmaxOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies a spatial transformer to input feature map.
+ * @return org.apache.mxnet.NDArray + */ +def SpatialTransformer(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies a spatial transformer to input feature map.
+ * @return org.apache.mxnet.NDArray + */ +def SpatialTransformer(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @return org.apache.mxnet.NDArray + */ +def SwapAxis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @return org.apache.mxnet.NDArray + */ +def SwapAxis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs nearest neighbor/bilinear up sampling to inputs.
+ * @return org.apache.mxnet.NDArray + */ +def UpSampling(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs nearest neighbor/bilinear up sampling to inputs.
+ * @return org.apache.mxnet.NDArray + */ +def UpSampling(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise absolute value of the input.
+ *
+ * Example::
+ *
+ * abs([-2, 0, 3]) = [2, 0, 3]
+ *
+ * The storage type of ``abs`` output depends upon the input storage type:
+ *
+ * - abs(default) = default
+ * - abs(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
+ * @return org.apache.mxnet.NDArray + */ +def abs(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise absolute value of the input.
+ *
+ * Example::
+ *
+ * abs([-2, 0, 3]) = [2, 0, 3]
+ *
+ * The storage type of ``abs`` output depends upon the input storage type:
+ *
+ * - abs(default) = default
+ * - abs(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
+ * @return org.apache.mxnet.NDArray + */ +def abs(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for Adam optimizer. Adam is seen as a generalization
+ * of AdaGrad.
+ *
+ * Adam update consists of the following steps, where g represents gradient and m, v
+ * are 1st and 2nd order moment estimates (mean and variance).
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
+ *
+ * It updates the weights using::
+ *
+ * m = beta1*m + (1-beta1)*grad
+ * v = beta2*v + (1-beta2)*(grad**2)
+ * w += - learning_rate * m / (sqrt(v) + epsilon)
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
+ * type of weight is the same as those of m and v,
+ * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
+ *
+ * for row in grad.indices:
+ * m[row] = beta1*m[row] + (1-beta1)*grad[row]
+ * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
+ * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L495
+ * @return org.apache.mxnet.NDArray + */ +def adam_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for Adam optimizer. Adam is seen as a generalization
+ * of AdaGrad.
+ *
+ * Adam update consists of the following steps, where g represents gradient and m, v
+ * are 1st and 2nd order moment estimates (mean and variance).
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
+ *
+ * It updates the weights using::
+ *
+ * m = beta1*m + (1-beta1)*grad
+ * v = beta2*v + (1-beta2)*(grad**2)
+ * w += - learning_rate * m / (sqrt(v) + epsilon)
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
+ * type of weight is the same as those of m and v,
+ * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
+ *
+ * for row in grad.indices:
+ * m[row] = beta1*m[row] + (1-beta1)*grad[row]
+ * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
+ * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L495
+ * @return org.apache.mxnet.NDArray + */ +def adam_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @return org.apache.mxnet.NDArray + */ +def add_n(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @return org.apache.mxnet.NDArray + */ +def add_n(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse cosine of the input array.
+ *
+ * The input should be in range `[-1, 1]`.
+ * The output is in the closed interval :math:`[0, \pi]`
+ *
+ * .. math::
+ * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
+ *
+ * The storage type of ``arccos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
+ * @return org.apache.mxnet.NDArray + */ +def arccos(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse cosine of the input array.
+ *
+ * The input should be in range `[-1, 1]`.
+ * The output is in the closed interval :math:`[0, \pi]`
+ *
+ * .. math::
+ * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
+ *
+ * The storage type of ``arccos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
+ * @return org.apache.mxnet.NDArray + */ +def arccos(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the element-wise inverse hyperbolic cosine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arccosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
+ * @return org.apache.mxnet.NDArray + */ +def arccosh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the element-wise inverse hyperbolic cosine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arccosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
+ * @return org.apache.mxnet.NDArray + */ +def arccosh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse sine of the input array.
+ *
+ * The input should be in the range `[-1, 1]`.
+ * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
+ *
+ * .. math::
+ * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
+ *
+ * The storage type of ``arcsin`` output depends upon the input storage type:
+ *
+ * - arcsin(default) = default
+ * - arcsin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
+ * @return org.apache.mxnet.NDArray + */ +def arcsin(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse sine of the input array.
+ *
+ * The input should be in the range `[-1, 1]`.
+ * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
+ *
+ * .. math::
+ * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
+ *
+ * The storage type of ``arcsin`` output depends upon the input storage type:
+ *
+ * - arcsin(default) = default
+ * - arcsin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
+ * @return org.apache.mxnet.NDArray + */ +def arcsin(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the element-wise inverse hyperbolic sine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arcsinh`` output depends upon the input storage type:
+ *
+ * - arcsinh(default) = default
+ * - arcsinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
+ * @return org.apache.mxnet.NDArray + */ +def arcsinh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the element-wise inverse hyperbolic sine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arcsinh`` output depends upon the input storage type:
+ *
+ * - arcsinh(default) = default
+ * - arcsinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
+ * @return org.apache.mxnet.NDArray + */ +def arcsinh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse tangent of the input array.
+ *
+ * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
+ *
+ * .. math::
+ * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
+ *
+ * The storage type of ``arctan`` output depends upon the input storage type:
+ *
+ * - arctan(default) = default
+ * - arctan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
+ * @return org.apache.mxnet.NDArray + */ +def arctan(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse tangent of the input array.
+ *
+ * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
+ *
+ * .. math::
+ * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
+ *
+ * The storage type of ``arctan`` output depends upon the input storage type:
+ *
+ * - arctan(default) = default
+ * - arctan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
+ * @return org.apache.mxnet.NDArray + */ +def arctan(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the element-wise inverse hyperbolic tangent of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arctanh`` output depends upon the input storage type:
+ *
+ * - arctanh(default) = default
+ * - arctanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
+ * @return org.apache.mxnet.NDArray + */ +def arctanh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the element-wise inverse hyperbolic tangent of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arctanh`` output depends upon the input storage type:
+ *
+ * - arctanh(default) = default
+ * - arctanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
+ * @return org.apache.mxnet.NDArray + */ +def arctanh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns indices of the maximum values along an axis.
+ *
+ * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmax along axis 0
+ * argmax(x, axis=0) = [ 1., 1., 1.]
+ *
+ * // argmax along axis 1
+ * argmax(x, axis=1) = [ 2., 2.]
+ *
+ * // argmax along axis 1 keeping same dims as an input array
+ * argmax(x, axis=1, keepdims=True) = [[ 2.],
+ * [ 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
+ * @return org.apache.mxnet.NDArray + */ +def argmax(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns indices of the maximum values along an axis.
+ *
+ * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmax along axis 0
+ * argmax(x, axis=0) = [ 1., 1., 1.]
+ *
+ * // argmax along axis 1
+ * argmax(x, axis=1) = [ 2., 2.]
+ *
+ * // argmax along axis 1 keeping same dims as an input array
+ * argmax(x, axis=1, keepdims=True) = [[ 2.],
+ * [ 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
+ * @return org.apache.mxnet.NDArray + */ +def argmax(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns argmax indices of each channel from the input array.
+ *
+ * The result will be an NDArray of shape (num_channel,).
+ *
+ * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * argmax_channel(x) = [ 2., 2.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
+ * @return org.apache.mxnet.NDArray + */ +def argmax_channel(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns argmax indices of each channel from the input array.
+ *
+ * The result will be an NDArray of shape (num_channel,).
+ *
+ * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * argmax_channel(x) = [ 2., 2.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
+ * @return org.apache.mxnet.NDArray + */ +def argmax_channel(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns indices of the minimum values along an axis.
+ *
+ * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmin along axis 0
+ * argmin(x, axis=0) = [ 0., 0., 0.]
+ *
+ * // argmin along axis 1
+ * argmin(x, axis=1) = [ 0., 0.]
+ *
+ * // argmin along axis 1 keeping same dims as an input array
+ * argmin(x, axis=1, keepdims=True) = [[ 0.],
+ * [ 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
+ * @return org.apache.mxnet.NDArray + */ +def argmin(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns indices of the minimum values along an axis.
+ *
+ * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmin along axis 0
+ * argmin(x, axis=0) = [ 0., 0., 0.]
+ *
+ * // argmin along axis 1
+ * argmin(x, axis=1) = [ 0., 0.]
+ *
+ * // argmin along axis 1 keeping same dims as an input array
+ * argmin(x, axis=1, keepdims=True) = [[ 0.],
+ * [ 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
+ * @return org.apache.mxnet.NDArray + */ +def argmin(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the indices that would sort an input array along the given axis.
+ *
+ * This function performs sorting along the given axis and returns an array of indices having same shape
+ * as an input array that index data in sorted order.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // sort along axis -1
+ * argsort(x) = [[ 1., 0., 2.],
+ * [ 0., 2., 1.]]
+ *
+ * // sort along axis 0
+ * argsort(x, axis=0) = [[ 1., 0., 1.]
+ * [ 0., 1., 0.]]
+ *
+ * // flatten and then sort
+ * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L176
+ * @return org.apache.mxnet.NDArray + */ +def argsort(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the indices that would sort an input array along the given axis.
+ *
+ * This function performs sorting along the given axis and returns an array of indices having same shape
+ * as an input array that index data in sorted order.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // sort along axis -1
+ * argsort(x) = [[ 1., 0., 2.],
+ * [ 0., 2., 1.]]
+ *
+ * // sort along axis 0
+ * argsort(x, axis=0) = [[ 1., 0., 1.]
+ * [ 0., 1., 0.]]
+ *
+ * // flatten and then sort
+ * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L176
+ * @return org.apache.mxnet.NDArray + */ +def argsort(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Batchwise dot product.
+ *
+ * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
+ * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
+ *
+ * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
+ * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
+ * which is computed by::
+ *
+ * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L117
+ * @return org.apache.mxnet.NDArray + */ +def batch_dot(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Batchwise dot product.
+ *
+ * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
+ * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
+ *
+ * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
+ * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
+ * which is computed by::
+ *
+ * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L117
+ * @return org.apache.mxnet.NDArray + */ +def batch_dot(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Takes elements from a data batch.
+ *
+ * .. note::
+ * `batch_take` is deprecated. Use `pick` instead.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // takes elements with specified indices
+ * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L444
+ * @return org.apache.mxnet.NDArray + */ +def batch_take(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Takes elements from a data batch.
+ *
+ * .. note::
+ * `batch_take` is deprecated. Use `pick` instead.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // takes elements with specified indices
+ * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L444
+ * @return org.apache.mxnet.NDArray + */ +def batch_take(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_add(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_add(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_axes(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_axes(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise division of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 6., 6., 6.],
+ * [ 6., 6., 6.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_div(x, y) = [[ 3., 3., 3.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_div(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_div(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise division of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 6., 6., 6.],
+ * [ 6., 6., 6.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_div(x, y) = [[ 3., 3., 3.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_div(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_div(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_equal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_equal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_greater(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_greater(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_greater_equal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_greater_equal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hypotenuse of a right angled triangle, given its "legs"
+ * with broadcasting.
+ *
+ * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
+ *
+ * Example::
+ *
+ * x = [[ 3., 3., 3.]]
+ *
+ * y = [[ 4.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, y) = [[ 5., 5., 5.],
+ * [ 5., 5., 5.]]
+ *
+ * z = [[ 0.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, z) = [[ 3., 3., 3.],
+ * [ 5., 5., 5.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_hypot(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hypotenuse of a right angled triangle, given its "legs"
+ * with broadcasting.
+ *
+ * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
+ *
+ * Example::
+ *
+ * x = [[ 3., 3., 3.]]
+ *
+ * y = [[ 4.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, y) = [[ 5., 5., 5.],
+ * [ 5., 5., 5.]]
+ *
+ * z = [[ 0.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, z) = [[ 3., 3., 3.],
+ * [ 5., 5., 5.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_hypot(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser(x, y) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_lesser(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser(x, y) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_lesser(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_lesser_equal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_lesser_equal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **logical and** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_logical_and(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **logical and** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_logical_and(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **logical or** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_logical_or(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **logical or** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_logical_or(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **logical xor** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_logical_xor(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **logical xor** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_logical_xor(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise maximum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise maxima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_maximum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise maximum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise maxima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_maximum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise minimum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise minima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_minimum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise minimum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise minima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_minimum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_minus(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_minus(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise modulo of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 8., 8., 8.],
+ * [ 8., 8., 8.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_mod(x, y) = [[ 0., 0., 0.],
+ * [ 2., 2., 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_mod(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise modulo of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 8., 8., 8.],
+ * [ 8., 8., 8.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_mod(x, y) = [[ 0., 0., 0.],
+ * [ 2., 2., 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_mod(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise product of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_mul(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_mul(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_mul(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise product of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_mul(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_mul(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_mul(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_not_equal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_not_equal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_plus(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_plus(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_power(x, y) = [[ 2., 2., 2.],
+ * [ 4., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_power(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_power(x, y) = [[ 2., 2., 2.],
+ * [ 4., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_power(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_sub(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_sub(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Broadcasts the input array to a new shape.
+ *
+ * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
+ * with arrays of different shapes efficiently without creating multiple copies of arrays.
+ * Also see, `Broadcasting `_ for more explanation.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * For example::
+ *
+ * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
+ * [ 1., 2., 3.]])
+ *
+ * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
+ * So with `shape=(2,0)`, we will obtain the same result as in the above example.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_to(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Broadcasts the input array to a new shape.
+ *
+ * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
+ * with arrays of different shapes efficiently without creating multiple copies of arrays.
+ * Also see, `Broadcasting `_ for more explanation.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * For example::
+ *
+ * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
+ * [ 1., 2., 3.]])
+ *
+ * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
+ * So with `shape=(2,0)`, we will obtain the same result as in the above example.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
+ * @return org.apache.mxnet.NDArray + */ +def broadcast_to(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @return org.apache.mxnet.NDArray + */ +def cast(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @return org.apache.mxnet.NDArray + */ +def cast(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Casts tensor storage type to the new type.
+ *
+ * When an NDArray with default storage type is cast to csr or row_sparse storage,
+ * the result is compact, which means:
+ *
+ * - for csr, zero values will not be retained
+ * - for row_sparse, row slices of all zeros will not be retained
+ *
+ * The storage type of ``cast_storage`` output depends on stype parameter:
+ *
+ * - cast_storage(csr, 'default') = default
+ * - cast_storage(row_sparse, 'default') = default
+ * - cast_storage(default, 'csr') = csr
+ * - cast_storage(default, 'row_sparse') = row_sparse
+ * - cast_storage(csr, 'csr') = csr
+ * - cast_storage(row_sparse, 'row_sparse') = row_sparse
+ *
+ * Example::
+ *
+ * dense = [[ 0., 1., 0.],
+ * [ 2., 0., 3.],
+ * [ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * # cast to row_sparse storage type
+ * rsp = cast_storage(dense, 'row_sparse')
+ * rsp.indices = [0, 1]
+ * rsp.values = [[ 0., 1., 0.],
+ * [ 2., 0., 3.]]
+ *
+ * # cast to csr storage type
+ * csr = cast_storage(dense, 'csr')
+ * csr.indices = [1, 0, 2]
+ * csr.values = [ 1., 2., 3.]
+ * csr.indptr = [0, 1, 3, 3, 3]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/cast_storage.cc:L71
+ * @return org.apache.mxnet.NDArray + */ +def cast_storage(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Casts tensor storage type to the new type.
+ *
+ * When an NDArray with default storage type is cast to csr or row_sparse storage,
+ * the result is compact, which means:
+ *
+ * - for csr, zero values will not be retained
+ * - for row_sparse, row slices of all zeros will not be retained
+ *
+ * The storage type of ``cast_storage`` output depends on stype parameter:
+ *
+ * - cast_storage(csr, 'default') = default
+ * - cast_storage(row_sparse, 'default') = default
+ * - cast_storage(default, 'csr') = csr
+ * - cast_storage(default, 'row_sparse') = row_sparse
+ * - cast_storage(csr, 'csr') = csr
+ * - cast_storage(row_sparse, 'row_sparse') = row_sparse
+ *
+ * Example::
+ *
+ * dense = [[ 0., 1., 0.],
+ * [ 2., 0., 3.],
+ * [ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * # cast to row_sparse storage type
+ * rsp = cast_storage(dense, 'row_sparse')
+ * rsp.indices = [0, 1]
+ * rsp.values = [[ 0., 1., 0.],
+ * [ 2., 0., 3.]]
+ *
+ * # cast to csr storage type
+ * csr = cast_storage(dense, 'csr')
+ * csr.indices = [1, 0, 2]
+ * csr.values = [ 1., 2., 3.]
+ * csr.indptr = [0, 1, 3, 3, 3]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/cast_storage.cc:L71
+ * @return org.apache.mxnet.NDArray + */ +def cast_storage(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise cube-root value of the input.
+ *
+ * .. math::
+ * cbrt(x) = \sqrt[3]{x}
+ *
+ * Example::
+ *
+ * cbrt([1, 8, -125]) = [1, 2, -5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
+ * @return org.apache.mxnet.NDArray + */ +def cbrt(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise cube-root value of the input.
+ *
+ * .. math::
+ * cbrt(x) = \sqrt[3]{x}
+ *
+ * Example::
+ *
+ * cbrt([1, 8, -125]) = [1, 2, -5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
+ * @return org.apache.mxnet.NDArray + */ +def cbrt(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise ceiling of the input.
+ *
+ * The ceil of the scalar x is the smallest integer i, such that i >= x.
+ *
+ * Example::
+ *
+ * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
+ *
+ * The storage type of ``ceil`` output depends upon the input storage type:
+ *
+ * - ceil(default) = default
+ * - ceil(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
+ * @return org.apache.mxnet.NDArray + */ +def ceil(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise ceiling of the input.
+ *
+ * The ceil of the scalar x is the smallest integer i, such that i >= x.
+ *
+ * Example::
+ *
+ * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
+ *
+ * The storage type of ``ceil`` output depends upon the input storage type:
+ *
+ * - ceil(default) = default
+ * - ceil(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
+ * @return org.apache.mxnet.NDArray + */ +def ceil(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
+ * @return org.apache.mxnet.NDArray + */ +def choose_element_0index(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
+ * @return org.apache.mxnet.NDArray + */ +def choose_element_0index(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Clips (limits) the values in an array.
+ *
+ * Given an interval, values outside the interval are clipped to the interval edges.
+ * Clipping ``x`` between `a_min` and `a_x` would be::
+ *
+ * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
+ *
+ * Example::
+ *
+ * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ *
+ * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
+ *
+ * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
+ * parameter values:
+ *
+ * - clip(default) = default
+ * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
+ * - clip(csr, a_min <= 0, a_max >= 0) = csr
+ * - clip(row_sparse, a_min < 0, a_max < 0) = default
+ * - clip(row_sparse, a_min > 0, a_max > 0) = default
+ * - clip(csr, a_min < 0, a_max < 0) = csr
+ * - clip(csr, a_min > 0, a_max > 0) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L617
+ * @return org.apache.mxnet.NDArray + */ +def clip(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Clips (limits) the values in an array.
+ *
+ * Given an interval, values outside the interval are clipped to the interval edges.
+ * Clipping ``x`` between `a_min` and `a_x` would be::
+ *
+ * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
+ *
+ * Example::
+ *
+ * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ *
+ * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
+ *
+ * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
+ * parameter values:
+ *
+ * - clip(default) = default
+ * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
+ * - clip(csr, a_min <= 0, a_max >= 0) = csr
+ * - clip(row_sparse, a_min < 0, a_max < 0) = default
+ * - clip(row_sparse, a_min > 0, a_max > 0) = default
+ * - clip(csr, a_min < 0, a_max < 0) = csr
+ * - clip(csr, a_min > 0, a_max > 0) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L617
+ * @return org.apache.mxnet.NDArray + */ +def clip(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @return org.apache.mxnet.NDArray + */ +def concat(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @return org.apache.mxnet.NDArray + */ +def concat(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the element-wise cosine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
+ *
+ * The storage type of ``cos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
+ * @return org.apache.mxnet.NDArray + */ +def cos(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the element-wise cosine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
+ *
+ * The storage type of ``cos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
+ * @return org.apache.mxnet.NDArray + */ +def cos(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hyperbolic cosine of the input array, computed element-wise.
+ *
+ * .. math::
+ * cosh(x) = 0.5\times(exp(x) + exp(-x))
+ *
+ * The storage type of ``cosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
+ * @return org.apache.mxnet.NDArray + */ +def cosh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hyperbolic cosine of the input array, computed element-wise.
+ *
+ * .. math::
+ * cosh(x) = 0.5\times(exp(x) + exp(-x))
+ *
+ * The storage type of ``cosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
+ * @return org.apache.mxnet.NDArray + */ +def cosh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @return org.apache.mxnet.NDArray + */ +def crop(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @return org.apache.mxnet.NDArray + */ +def crop(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts each element of the input array from radians to degrees.
+ *
+ * .. math::
+ * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
+ *
+ * The storage type of ``degrees`` output depends upon the input storage type:
+ *
+ * - degrees(default) = default
+ * - degrees(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
+ * @return org.apache.mxnet.NDArray + */ +def degrees(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts each element of the input array from radians to degrees.
+ *
+ * .. math::
+ * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
+ *
+ * The storage type of ``degrees`` output depends upon the input storage type:
+ *
+ * - degrees(default) = default
+ * - degrees(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
+ * @return org.apache.mxnet.NDArray + */ +def degrees(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Dot product of two arrays.
+ *
+ * ``dot``'s behavior depends on the input array dimensions:
+ *
+ * - 1-D arrays: inner product of vectors
+ * - 2-D arrays: matrix multiplication
+ * - N-D arrays: a sum product over the last axis of the first input and the first
+ * axis of the second input
+ *
+ * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
+ * result array will have shape `(n,m,r,s)`. It is computed by::
+ *
+ * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
+ *
+ * Example::
+ *
+ * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
+ * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
+ * dot(x,y)[0,0,1,1] = 0
+ * sum(x[0,0,:]*y[:,1,1]) = 0
+ *
+ * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
+ * forward_stype option for output storage type. Implemented sparse operations include:
+ *
+ * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
+ * - dot(csr, default, transpose_a=True) = default
+ * - dot(csr, default, transpose_a=True) = row_sparse
+ * - dot(csr, default) = default
+ * - dot(csr, row_sparse) = default
+ * - dot(default, csr) = csr (CPU only)
+ * - dot(default, csr, forward_stype='default') = default
+ * - dot(default, csr, transpose_b=True, forward_stype='default') = default
+ *
+ * If the combination of input storage types and forward_stype does not match any of the
+ * above patterns, ``dot`` will fallback and generate output with default storage.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L69
+ * @return org.apache.mxnet.NDArray + */ +def dot(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Dot product of two arrays.
+ *
+ * ``dot``'s behavior depends on the input array dimensions:
+ *
+ * - 1-D arrays: inner product of vectors
+ * - 2-D arrays: matrix multiplication
+ * - N-D arrays: a sum product over the last axis of the first input and the first
+ * axis of the second input
+ *
+ * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
+ * result array will have shape `(n,m,r,s)`. It is computed by::
+ *
+ * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
+ *
+ * Example::
+ *
+ * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
+ * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
+ * dot(x,y)[0,0,1,1] = 0
+ * sum(x[0,0,:]*y[:,1,1]) = 0
+ *
+ * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
+ * forward_stype option for output storage type. Implemented sparse operations include:
+ *
+ * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
+ * - dot(csr, default, transpose_a=True) = default
+ * - dot(csr, default, transpose_a=True) = row_sparse
+ * - dot(csr, default) = default
+ * - dot(csr, row_sparse) = default
+ * - dot(default, csr) = csr (CPU only)
+ * - dot(default, csr, forward_stype='default') = default
+ * - dot(default, csr, transpose_b=True, forward_stype='default') = default
+ *
+ * If the combination of input storage types and forward_stype does not match any of the
+ * above patterns, ``dot`` will fallback and generate output with default storage.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L69
+ * @return org.apache.mxnet.NDArray + */ +def dot(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Adds arguments element-wise.
+ *
+ * The storage type of ``elemwise_add`` output depends on storage types of inputs
+ *
+ * - elemwise_add(row_sparse, row_sparse) = row_sparse
+ * - elemwise_add(csr, csr) = csr
+ * - elemwise_add(default, csr) = default
+ * - elemwise_add(csr, default) = default
+ * - elemwise_add(default, rsp) = default
+ * - elemwise_add(rsp, default) = default
+ * - otherwise, ``elemwise_add`` generates output with default storage
+ * @return org.apache.mxnet.NDArray + */ +def elemwise_add(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Adds arguments element-wise.
+ *
+ * The storage type of ``elemwise_add`` output depends on storage types of inputs
+ *
+ * - elemwise_add(row_sparse, row_sparse) = row_sparse
+ * - elemwise_add(csr, csr) = csr
+ * - elemwise_add(default, csr) = default
+ * - elemwise_add(csr, default) = default
+ * - elemwise_add(default, rsp) = default
+ * - elemwise_add(rsp, default) = default
+ * - otherwise, ``elemwise_add`` generates output with default storage
+ * @return org.apache.mxnet.NDArray + */ +def elemwise_add(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Divides arguments element-wise.
+ *
+ * The storage type of ``elemwise_div`` output is always dense
+ * @return org.apache.mxnet.NDArray + */ +def elemwise_div(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Divides arguments element-wise.
+ *
+ * The storage type of ``elemwise_div`` output is always dense
+ * @return org.apache.mxnet.NDArray + */ +def elemwise_div(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Multiplies arguments element-wise.
+ *
+ * The storage type of ``elemwise_mul`` output depends on storage types of inputs
+ *
+ * - elemwise_mul(default, default) = default
+ * - elemwise_mul(row_sparse, row_sparse) = row_sparse
+ * - elemwise_mul(default, row_sparse) = row_sparse
+ * - elemwise_mul(row_sparse, default) = row_sparse
+ * - elemwise_mul(csr, csr) = csr
+ * - otherwise, ``elemwise_mul`` generates output with default storage
+ * @return org.apache.mxnet.NDArray + */ +def elemwise_mul(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Multiplies arguments element-wise.
+ *
+ * The storage type of ``elemwise_mul`` output depends on storage types of inputs
+ *
+ * - elemwise_mul(default, default) = default
+ * - elemwise_mul(row_sparse, row_sparse) = row_sparse
+ * - elemwise_mul(default, row_sparse) = row_sparse
+ * - elemwise_mul(row_sparse, default) = row_sparse
+ * - elemwise_mul(csr, csr) = csr
+ * - otherwise, ``elemwise_mul`` generates output with default storage
+ * @return org.apache.mxnet.NDArray + */ +def elemwise_mul(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Subtracts arguments element-wise.
+ *
+ * The storage type of ``elemwise_sub`` output depends on storage types of inputs
+ *
+ * - elemwise_sub(row_sparse, row_sparse) = row_sparse
+ * - elemwise_sub(csr, csr) = csr
+ * - elemwise_sub(default, csr) = default
+ * - elemwise_sub(csr, default) = default
+ * - elemwise_sub(default, rsp) = default
+ * - elemwise_sub(rsp, default) = default
+ * - otherwise, ``elemwise_sub`` generates output with default storage
+ * @return org.apache.mxnet.NDArray + */ +def elemwise_sub(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Subtracts arguments element-wise.
+ *
+ * The storage type of ``elemwise_sub`` output depends on storage types of inputs
+ *
+ * - elemwise_sub(row_sparse, row_sparse) = row_sparse
+ * - elemwise_sub(csr, csr) = csr
+ * - elemwise_sub(default, csr) = default
+ * - elemwise_sub(csr, default) = default
+ * - elemwise_sub(default, rsp) = default
+ * - elemwise_sub(rsp, default) = default
+ * - otherwise, ``elemwise_sub`` generates output with default storage
+ * @return org.apache.mxnet.NDArray + */ +def elemwise_sub(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise exponential value of the input.
+ *
+ * .. math::
+ * exp(x) = e^x \approx 2.718^x
+ *
+ * Example::
+ *
+ * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
+ *
+ * The storage type of ``exp`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
+ * @return org.apache.mxnet.NDArray + */ +def exp(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise exponential value of the input.
+ *
+ * .. math::
+ * exp(x) = e^x \approx 2.718^x
+ *
+ * Example::
+ *
+ * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
+ *
+ * The storage type of ``exp`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
+ * @return org.apache.mxnet.NDArray + */ +def exp(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Inserts a new axis of size 1 into the array shape
+ *
+ * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
+ * will return a new array with shape ``(2,1,3,4)``.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L346
+ * @return org.apache.mxnet.NDArray + */ +def expand_dims(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Inserts a new axis of size 1 into the array shape
+ *
+ * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
+ * will return a new array with shape ``(2,1,3,4)``.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L346
+ * @return org.apache.mxnet.NDArray + */ +def expand_dims(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns ``exp(x) - 1`` computed element-wise on the input.
+ *
+ * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
+ *
+ * The storage type of ``expm1`` output depends upon the input storage type:
+ *
+ * - expm1(default) = default
+ * - expm1(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
+ * @return org.apache.mxnet.NDArray + */ +def expm1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns ``exp(x) - 1`` computed element-wise on the input.
+ *
+ * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
+ *
+ * The storage type of ``expm1`` output depends upon the input storage type:
+ *
+ * - expm1(default) = default
+ * - expm1(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
+ * @return org.apache.mxnet.NDArray + */ +def expm1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
+ * @return org.apache.mxnet.NDArray + */ +def fill_element_0index(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
+ * @return org.apache.mxnet.NDArray + */ +def fill_element_0index(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise rounded value to the nearest \
+ * integer towards zero of the input.
+ *
+ * Example::
+ *
+ * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
+ *
+ * The storage type of ``fix`` output depends upon the input storage type:
+ *
+ * - fix(default) = default
+ * - fix(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
+ * @return org.apache.mxnet.NDArray + */ +def fix(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise rounded value to the nearest \
+ * integer towards zero of the input.
+ *
+ * Example::
+ *
+ * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
+ *
+ * The storage type of ``fix`` output depends upon the input storage type:
+ *
+ * - fix(default) = default
+ * - fix(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
+ * @return org.apache.mxnet.NDArray + */ +def fix(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @return org.apache.mxnet.NDArray + */ +def flatten(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @return org.apache.mxnet.NDArray + */ +def flatten(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @return org.apache.mxnet.NDArray + */ +def flip(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @return org.apache.mxnet.NDArray + */ +def flip(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise floor of the input.
+ *
+ * The floor of the scalar x is the largest integer i, such that i <= x.
+ *
+ * Example::
+ *
+ * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
+ *
+ * The storage type of ``floor`` output depends upon the input storage type:
+ *
+ * - floor(default) = default
+ * - floor(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
+ * @return org.apache.mxnet.NDArray + */ +def floor(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise floor of the input.
+ *
+ * The floor of the scalar x is the largest integer i, such that i <= x.
+ *
+ * Example::
+ *
+ * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
+ *
+ * The storage type of ``floor`` output depends upon the input storage type:
+ *
+ * - floor(default) = default
+ * - floor(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
+ * @return org.apache.mxnet.NDArray + */ +def floor(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * The FTML optimizer described in
+ * *FTML - Follow the Moving Leader in Deep Learning*,
+ * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
+ * \sigma_t = d_t - \beta_1 d_{t-1}
+ * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
+ * W_t = - \frac{ z_t }{ d_t }
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L447
+ * @return org.apache.mxnet.NDArray + */ +def ftml_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * The FTML optimizer described in
+ * *FTML - Follow the Moving Leader in Deep Learning*,
+ * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
+ * \sigma_t = d_t - \beta_1 d_{t-1}
+ * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
+ * W_t = - \frac{ z_t }{ d_t }
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L447
+ * @return org.apache.mxnet.NDArray + */ +def ftml_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for Ftrl optimizer.
+ * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
+ * http://dl.acm.org/citation.cfm?id=2488200.
+ *
+ * It updates the weights using::
+ *
+ * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
+ * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
+ * n += rescaled_grad**2
+ * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
+ *
+ * If w, z and n are all of ``row_sparse`` storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
+ *
+ * for row in grad.indices:
+ * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
+ * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
+ * n[row] += rescaled_grad[row]**2
+ * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L632
+ * @return org.apache.mxnet.NDArray + */ +def ftrl_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for Ftrl optimizer.
+ * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
+ * http://dl.acm.org/citation.cfm?id=2488200.
+ *
+ * It updates the weights using::
+ *
+ * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
+ * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
+ * n += rescaled_grad**2
+ * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
+ *
+ * If w, z and n are all of ``row_sparse`` storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
+ *
+ * for row in grad.indices:
+ * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
+ * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
+ * n[row] += rescaled_grad[row]**2
+ * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L632
+ * @return org.apache.mxnet.NDArray + */ +def ftrl_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the gamma function (extension of the factorial function \
+ * to the reals), computed element-wise on the input array.
+ *
+ * The storage type of ``gamma`` output is always dense
+ * @return org.apache.mxnet.NDArray + */ +def gamma(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the gamma function (extension of the factorial function \
+ * to the reals), computed element-wise on the input array.
+ *
+ * The storage type of ``gamma`` output is always dense
+ * @return org.apache.mxnet.NDArray + */ +def gamma(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise log of the absolute value of the gamma function \
+ * of the input.
+ *
+ * The storage type of ``gammaln`` output is always dense
+ * @return org.apache.mxnet.NDArray + */ +def gammaln(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise log of the absolute value of the gamma function \
+ * of the input.
+ *
+ * The storage type of ``gammaln`` output is always dense
+ * @return org.apache.mxnet.NDArray + */ +def gammaln(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Gather elements or slices from `data` and store to a tensor whose
+ * shape is defined by `indices`.
+ *
+ * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}]
+ *
+ * Examples::
+ *
+ * data = [[0, 1], [2, 3]]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * gather_nd(data, indices) = [2, 3, 0]
+ * @return org.apache.mxnet.NDArray + */ +def gather_nd(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Gather elements or slices from `data` and store to a tensor whose
+ * shape is defined by `indices`.
+ *
+ * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}]
+ *
+ * Examples::
+ *
+ * data = [[0, 1], [2, 3]]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * gather_nd(data, indices) = [2, 3, 0]
+ * @return org.apache.mxnet.NDArray + */ +def gather_nd(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes hard sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = max(0, min(1, alpha * x + beta))
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
+ * @return org.apache.mxnet.NDArray + */ +def hard_sigmoid(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes hard sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = max(0, min(1, alpha * x + beta))
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
+ * @return org.apache.mxnet.NDArray + */ +def hard_sigmoid(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns a copy of the input.
+ *
+ * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
+ * @return org.apache.mxnet.NDArray + */ +def identity(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns a copy of the input.
+ *
+ * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
+ * @return org.apache.mxnet.NDArray + */ +def identity(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the Khatri-Rao product of the input matrices.
+ *
+ * Given a collection of :math:`n` input matrices,
+ *
+ * .. math::
+ * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
+ *
+ * the (column-wise) Khatri-Rao product is defined as the matrix,
+ *
+ * .. math::
+ * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
+ *
+ * where the :math:`k` th column is equal to the column-wise outer product
+ * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
+ * column of the ith matrix.
+ *
+ * Example::
+ *
+ * >>> A = mx.nd.array([[1, -1],
+ * >>> [2, -3]])
+ * >>> B = mx.nd.array([[1, 4],
+ * >>> [2, 5],
+ * >>> [3, 6]])
+ * >>> C = mx.nd.khatri_rao(A, B)
+ * >>> print(C.asnumpy())
+ * [[ 1. -4.]
+ * [ 2. -5.]
+ * [ 3. -6.]
+ * [ 2. -12.]
+ * [ 4. -15.]
+ * [ 6. -18.]]
+ *
+ *
+ *
+ * Defined in src/operator/contrib/krprod.cc:L108
+ * @return org.apache.mxnet.NDArray + */ +def khatri_rao(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the Khatri-Rao product of the input matrices.
+ *
+ * Given a collection of :math:`n` input matrices,
+ *
+ * .. math::
+ * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
+ *
+ * the (column-wise) Khatri-Rao product is defined as the matrix,
+ *
+ * .. math::
+ * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
+ *
+ * where the :math:`k` th column is equal to the column-wise outer product
+ * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
+ * column of the ith matrix.
+ *
+ * Example::
+ *
+ * >>> A = mx.nd.array([[1, -1],
+ * >>> [2, -3]])
+ * >>> B = mx.nd.array([[1, 4],
+ * >>> [2, 5],
+ * >>> [3, 6]])
+ * >>> C = mx.nd.khatri_rao(A, B)
+ * >>> print(C.asnumpy())
+ * [[ 1. -4.]
+ * [ 2. -5.]
+ * [ 3. -6.]
+ * [ 2. -12.]
+ * [ 4. -15.]
+ * [ 6. -18.]]
+ *
+ *
+ *
+ * Defined in src/operator/contrib/krprod.cc:L108
+ * @return org.apache.mxnet.NDArray + */ +def khatri_rao(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * LQ factorization for general matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
+ * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
+ * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
+ * that:
+ *
+ * *A* = *L* \* *Q*
+ *
+ * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
+ * and *Q* is row-orthonormal, meaning that
+ *
+ * *Q* \* *Q*\ :sup:`T`
+ *
+ * is equal to the identity matrix of shape *(x, x)*.
+ *
+ * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single LQ factorization
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * Q, L = gelqf(A)
+ * Q = [[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]]
+ * L = [[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]]
+ *
+ * // Batch LQ factorization
+ * A = [[[1., 2., 3.], [4., 5., 6.]],
+ * [[7., 8., 9.], [10., 11., 12.]]]
+ * Q, L = gelqf(A)
+ * Q = [[[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]],
+ * [[-0.50257071, -0.57436653, -0.64616234],
+ * [0.7620735, 0.05862104, -0.64483142]]]
+ * L = [[[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]],
+ * [[-13.92838828, 0.],
+ * [-19.09768702, 0.52758934]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L552
+ * @return org.apache.mxnet.NDArray + */ +def linalg_gelqf(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * LQ factorization for general matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
+ * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
+ * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
+ * that:
+ *
+ * *A* = *L* \* *Q*
+ *
+ * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
+ * and *Q* is row-orthonormal, meaning that
+ *
+ * *Q* \* *Q*\ :sup:`T`
+ *
+ * is equal to the identity matrix of shape *(x, x)*.
+ *
+ * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single LQ factorization
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * Q, L = gelqf(A)
+ * Q = [[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]]
+ * L = [[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]]
+ *
+ * // Batch LQ factorization
+ * A = [[[1., 2., 3.], [4., 5., 6.]],
+ * [[7., 8., 9.], [10., 11., 12.]]]
+ * Q, L = gelqf(A)
+ * Q = [[[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]],
+ * [[-0.50257071, -0.57436653, -0.64616234],
+ * [0.7620735, 0.05862104, -0.64483142]]]
+ * L = [[[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]],
+ * [[-13.92838828, 0.],
+ * [-19.09768702, 0.52758934]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L552
+ * @return org.apache.mxnet.NDArray + */ +def linalg_gelqf(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs general matrix multiplication and accumulation.
+ * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
+ *
+ * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
+ * matrix transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = swapaxes(C, dim1=1, dim2=3)
+ * C = gemm(A1, B1, C)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply-add
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
+ * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
+ *
+ * // Batch matrix multiply-add
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * C = [[[10.0]], [[0.01]]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
+ * = [[[104.0]], [[0.14]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L81
+ * @return org.apache.mxnet.NDArray + */ +def linalg_gemm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs general matrix multiplication and accumulation.
+ * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
+ *
+ * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
+ * matrix transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = swapaxes(C, dim1=1, dim2=3)
+ * C = gemm(A1, B1, C)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply-add
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
+ * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
+ *
+ * // Batch matrix multiply-add
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * C = [[[10.0]], [[0.01]]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
+ * = [[[104.0]], [[0.14]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L81
+ * @return org.apache.mxnet.NDArray + */ +def linalg_gemm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs general matrix multiplication.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
+ *
+ * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
+ * transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = gemm2(A1, B1)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[[4.0]], [[0.04 ]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L151
+ * @return org.apache.mxnet.NDArray + */ +def linalg_gemm2(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs general matrix multiplication.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
+ *
+ * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
+ * transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = gemm2(A1, B1)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[[4.0]], [[0.04 ]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L151
+ * @return org.apache.mxnet.NDArray + */ +def linalg_gemm2(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs Cholesky factorization of a symmetric positive-definite matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
+ * computed. *L* is lower triangular (entries of upper triangle are all zero), has
+ * positive diagonal entries, and:
+ *
+ * *A* = *L* \* *L*\ :sup:`T`
+ *
+ * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix factorization
+ * A = [[4.0, 1.0], [1.0, 4.25]]
+ * potrf(A) = [[2.0, 0], [0.5, 2.0]]
+ *
+ * // Batch matrix factorization
+ * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
+ * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L201
+ * @return org.apache.mxnet.NDArray + */ +def linalg_potrf(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs Cholesky factorization of a symmetric positive-definite matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
+ * computed. *L* is lower triangular (entries of upper triangle are all zero), has
+ * positive diagonal entries, and:
+ *
+ * *A* = *L* \* *L*\ :sup:`T`
+ *
+ * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix factorization
+ * A = [[4.0, 1.0], [1.0, 4.25]]
+ * potrf(A) = [[2.0, 0], [0.5, 2.0]]
+ *
+ * // Batch matrix factorization
+ * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
+ * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L201
+ * @return org.apache.mxnet.NDArray + */ +def linalg_potrf(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs matrix inversion from a Cholesky factorization.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
+ * with positive diagonal. We compute:
+ *
+ * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
+ *
+ * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
+ * *B* (obtained by *potrf*), then
+ *
+ * *out* = *B*\ :sup:`-1`
+ *
+ * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
+ * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
+ * (*trsm*). The latter is numerically much safer, and also cheaper.
+ *
+ * Examples::
+ *
+ * // Single matrix inverse
+ * A = [[2.0, 0], [0.5, 2.0]]
+ * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
+ *
+ * // Batch matrix inverse
+ * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
+ * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L259
+ * @return org.apache.mxnet.NDArray + */ +def linalg_potri(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs matrix inversion from a Cholesky factorization.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
+ * with positive diagonal. We compute:
+ *
+ * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
+ *
+ * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
+ * *B* (obtained by *potrf*), then
+ *
+ * *out* = *B*\ :sup:`-1`
+ *
+ * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
+ * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
+ * (*trsm*). The latter is numerically much safer, and also cheaper.
+ *
+ * Examples::
+ *
+ * // Single matrix inverse
+ * A = [[2.0, 0], [0.5, 2.0]]
+ * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
+ *
+ * // Batch matrix inverse
+ * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
+ * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L259
+ * @return org.apache.mxnet.NDArray + */ +def linalg_potri(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of the logarithms of the diagonal elements of a square matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
+ * logarithms of the diagonal elements, the result has shape (1,).
+ *
+ * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix reduction
+ * A = [[1.0, 1.0], [1.0, 7.0]]
+ * sumlogdiag(A) = [1.9459]
+ *
+ * // Batch matrix reduction
+ * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
+ * sumlogdiag(A) = [1.9459, 3.9318]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L428
+ * @return org.apache.mxnet.NDArray + */ +def linalg_sumlogdiag(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of the logarithms of the diagonal elements of a square matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
+ * logarithms of the diagonal elements, the result has shape (1,).
+ *
+ * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix reduction
+ * A = [[1.0, 1.0], [1.0, 7.0]]
+ * sumlogdiag(A) = [1.9459]
+ *
+ * // Batch matrix reduction
+ * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
+ * sumlogdiag(A) = [1.9459, 3.9318]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L428
+ * @return org.apache.mxnet.NDArray + */ +def linalg_sumlogdiag(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Multiplication of matrix with its transpose.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the operator performs the BLAS3 function *syrk*:
+ *
+ * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
+ *
+ * if *transpose=False*, or
+ *
+ * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
+ *
+ * if *transpose=True*.
+ *
+ * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * syrk(A, alpha=1., transpose=False)
+ * = [[14., 32.],
+ * [32., 77.]]
+ * syrk(A, alpha=1., transpose=True)
+ * = [[17., 22., 27.],
+ * [22., 29., 36.],
+ * [27., 36., 45.]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1., 1.]], [[0.1, 0.1]]]
+ * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L484
+ * @return org.apache.mxnet.NDArray + */ +def linalg_syrk(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Multiplication of matrix with its transpose.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the operator performs the BLAS3 function *syrk*:
+ *
+ * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
+ *
+ * if *transpose=False*, or
+ *
+ * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
+ *
+ * if *transpose=True*.
+ *
+ * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * syrk(A, alpha=1., transpose=False)
+ * = [[14., 32.],
+ * [32., 77.]]
+ * syrk(A, alpha=1., transpose=True)
+ * = [[17., 22., 27.],
+ * [22., 29., 36.],
+ * [27., 36., 45.]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1., 1.]], [[0.1, 0.1]]]
+ * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L484
+ * @return org.apache.mxnet.NDArray + */ +def linalg_syrk(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs multiplication with a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trmm*:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* = *alpha* \* *B* \* *op*\ (*A*)
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ *
+ * Examples::
+ *
+ * // Single triangular matrix multiply
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch triangular matrix multiply
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
+ * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L316
+ * @return org.apache.mxnet.NDArray + */ +def linalg_trmm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Performs multiplication with a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trmm*:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* = *alpha* \* *B* \* *op*\ (*A*)
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ *
+ * Examples::
+ *
+ * // Single triangular matrix multiply
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch triangular matrix multiply
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
+ * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L316
+ * @return org.apache.mxnet.NDArray + */ +def linalg_trmm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Solves matrix equation involving a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trsm*, solving for *out* in:
+ *
+ * *op*\ (*A*) \* *out* = *alpha* \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* \* *op*\ (*A*) = *alpha* \* *B*
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix solve
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ *
+ * // Batch matrix solve
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
+ * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
+ * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L379
+ * @return org.apache.mxnet.NDArray + */ +def linalg_trsm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Solves matrix equation involving a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trsm*, solving for *out* in:
+ *
+ * *op*\ (*A*) \* *out* = *alpha* \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* \* *op*\ (*A*) = *alpha* \* *B*
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix solve
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ *
+ * // Batch matrix solve
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
+ * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
+ * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L379
+ * @return org.apache.mxnet.NDArray + */ +def linalg_trsm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise Natural logarithmic value of the input.
+ *
+ * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
+ *
+ * The storage type of ``log`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
+ * @return org.apache.mxnet.NDArray + */ +def log(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise Natural logarithmic value of the input.
+ *
+ * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
+ *
+ * The storage type of ``log`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
+ * @return org.apache.mxnet.NDArray + */ +def log(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise Base-10 logarithmic value of the input.
+ *
+ * ``10**log10(x) = x``
+ *
+ * The storage type of ``log10`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
+ * @return org.apache.mxnet.NDArray + */ +def log10(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise Base-10 logarithmic value of the input.
+ *
+ * ``10**log10(x) = x``
+ *
+ * The storage type of ``log10`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
+ * @return org.apache.mxnet.NDArray + */ +def log10(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise ``log(1 + x)`` value of the input.
+ *
+ * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
+ * :math:`1+x\approx 1`
+ *
+ * The storage type of ``log1p`` output depends upon the input storage type:
+ *
+ * - log1p(default) = default
+ * - log1p(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
+ * @return org.apache.mxnet.NDArray + */ +def log1p(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise ``log(1 + x)`` value of the input.
+ *
+ * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
+ * :math:`1+x\approx 1`
+ *
+ * The storage type of ``log1p`` output depends upon the input storage type:
+ *
+ * - log1p(default) = default
+ * - log1p(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
+ * @return org.apache.mxnet.NDArray + */ +def log1p(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise Base-2 logarithmic value of the input.
+ *
+ * ``2**log2(x) = x``
+ *
+ * The storage type of ``log2`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
+ * @return org.apache.mxnet.NDArray + */ +def log2(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise Base-2 logarithmic value of the input.
+ *
+ * ``2**log2(x) = x``
+ *
+ * The storage type of ``log2`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
+ * @return org.apache.mxnet.NDArray + */ +def log2(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the log softmax of the input.
+ * This is equivalent to computing softmax followed by log.
+ *
+ * Examples::
+ *
+ * >>> x = mx.nd.array([1, 2, .1])
+ * >>> mx.nd.log_softmax(x).asnumpy()
+ * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
+ *
+ * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
+ * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
+ * array([[-0.34115392, -0.69314718, -1.24115396],
+ * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
+ * @return org.apache.mxnet.NDArray + */ +def log_softmax(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the log softmax of the input.
+ * This is equivalent to computing softmax followed by log.
+ *
+ * Examples::
+ *
+ * >>> x = mx.nd.array([1, 2, .1])
+ * >>> mx.nd.log_softmax(x).asnumpy()
+ * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
+ *
+ * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
+ * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
+ * array([[-0.34115392, -0.69314718, -1.24115396],
+ * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
+ * @return org.apache.mxnet.NDArray + */ +def log_softmax(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of logical NOT (!) function
+ *
+ * Example:
+ * logical_not([-2., 0., 1.]) = [0., 1., 0.]
+ * @return org.apache.mxnet.NDArray + */ +def logical_not(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the result of logical NOT (!) function
+ *
+ * Example:
+ * logical_not([-2., 0., 1.]) = [0., 1., 0.]
+ * @return org.apache.mxnet.NDArray + */ +def logical_not(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = make_loss(cross_entropy)
+ *
+ * We will need to use ``make_loss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * The storage type of ``make_loss`` output depends upon the input storage type:
+ *
+ * - make_loss(default) = default
+ * - make_loss(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
+ * @return org.apache.mxnet.NDArray + */ +def make_loss(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = make_loss(cross_entropy)
+ *
+ * We will need to use ``make_loss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * The storage type of ``make_loss`` output depends upon the input storage type:
+ *
+ * - make_loss(default) = default
+ * - make_loss(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
+ * @return org.apache.mxnet.NDArray + */ +def make_loss(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @return org.apache.mxnet.NDArray + */ +def max(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @return org.apache.mxnet.NDArray + */ +def max(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @return org.apache.mxnet.NDArray + */ +def max_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @return org.apache.mxnet.NDArray + */ +def max_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the mean of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
+ * @return org.apache.mxnet.NDArray + */ +def mean(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the mean of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
+ * @return org.apache.mxnet.NDArray + */ +def mean(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @return org.apache.mxnet.NDArray + */ +def min(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @return org.apache.mxnet.NDArray + */ +def min(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @return org.apache.mxnet.NDArray + */ +def min_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @return org.apache.mxnet.NDArray + */ +def min_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Updater function for multi-precision sgd optimizer
+ * @return org.apache.mxnet.NDArray + */ +def mp_sgd_mom_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Updater function for multi-precision sgd optimizer
+ * @return org.apache.mxnet.NDArray + */ +def mp_sgd_mom_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Updater function for multi-precision sgd optimizer
+ * @return org.apache.mxnet.NDArray + */ +def mp_sgd_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Updater function for multi-precision sgd optimizer
+ * @return org.apache.mxnet.NDArray + */ +def mp_sgd_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
+ * @return org.apache.mxnet.NDArray + */ +def nanprod(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
+ * @return org.apache.mxnet.NDArray + */ +def nanprod(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
+ * @return org.apache.mxnet.NDArray + */ +def nansum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
+ * @return org.apache.mxnet.NDArray + */ +def nansum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Numerical negative of the argument, element-wise.
+ *
+ * The storage type of ``negative`` output depends upon the input storage type:
+ *
+ * - negative(default) = default
+ * - negative(row_sparse) = row_sparse
+ * - negative(csr) = csr
+ * @return org.apache.mxnet.NDArray + */ +def negative(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Numerical negative of the argument, element-wise.
+ *
+ * The storage type of ``negative`` output depends upon the input storage type:
+ *
+ * - negative(default) = default
+ * - negative(row_sparse) = row_sparse
+ * - negative(csr) = csr
+ * @return org.apache.mxnet.NDArray + */ +def negative(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the norm on an NDArray.
+ *
+ * This operator computes the norm on an NDArray with the specified axis, depending
+ * on the value of the ord parameter. By default, it computes the L2 norm on the entire
+ * array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * norm(x) = [5.47722578]
+ *
+ * rsp = x.cast_storage('row_sparse')
+ *
+ * norm(rsp) = [5.47722578]
+ *
+ * csr = x.cast_storage('csr')
+ *
+ * norm(csr) = [5.47722578]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
+ * @return org.apache.mxnet.NDArray + */ +def norm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the norm on an NDArray.
+ *
+ * This operator computes the norm on an NDArray with the specified axis, depending
+ * on the value of the ord parameter. By default, it computes the L2 norm on the entire
+ * array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * norm(x) = [5.47722578]
+ *
+ * rsp = x.cast_storage('row_sparse')
+ *
+ * norm(rsp) = [5.47722578]
+ *
+ * csr = x.cast_storage('csr')
+ *
+ * norm(csr) = [5.47722578]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
+ * @return org.apache.mxnet.NDArray + */ +def norm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @return org.apache.mxnet.NDArray + */ +def normal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @return org.apache.mxnet.NDArray + */ +def normal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns a one-hot array.
+ *
+ * The locations represented by `indices` take value `on_value`, while all
+ * other locations take value `off_value`.
+ *
+ * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
+ * in an output array of shape ``(i0, i1, d)`` with::
+ *
+ * output[i,j,:] = off_value
+ * output[i,j,indices[i,j]] = on_value
+ *
+ * Examples::
+ *
+ * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
+ * [ 1. 0. 0.]
+ * [ 0. 0. 1.]
+ * [ 1. 0. 0.]]
+ *
+ * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
+ * dtype='int32') = [[1 8 1]
+ * [8 1 1]
+ * [1 1 8]
+ * [8 1 1]]
+ *
+ * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 0. 1.]
+ * [ 1. 0. 0.]]]
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L490
+ * @return org.apache.mxnet.NDArray + */ +def one_hot(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns a one-hot array.
+ *
+ * The locations represented by `indices` take value `on_value`, while all
+ * other locations take value `off_value`.
+ *
+ * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
+ * in an output array of shape ``(i0, i1, d)`` with::
+ *
+ * output[i,j,:] = off_value
+ * output[i,j,indices[i,j]] = on_value
+ *
+ * Examples::
+ *
+ * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
+ * [ 1. 0. 0.]
+ * [ 0. 0. 1.]
+ * [ 1. 0. 0.]]
+ *
+ * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
+ * dtype='int32') = [[1 8 1]
+ * [8 1 1]
+ * [1 1 8]
+ * [8 1 1]]
+ *
+ * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 0. 1.]
+ * [ 1. 0. 0.]]]
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L490
+ * @return org.apache.mxnet.NDArray + */ +def one_hot(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return an array of ones with the same shape and type
+ * as the input array.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * ones_like(x) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ * @return org.apache.mxnet.NDArray + */ +def ones_like(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return an array of ones with the same shape and type
+ * as the input array.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * ones_like(x) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ * @return org.apache.mxnet.NDArray + */ +def ones_like(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @return org.apache.mxnet.NDArray + */ +def pad(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @return org.apache.mxnet.NDArray + */ +def pad(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Picks elements from an input array according to the input indices along the given axis.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last element along an axis (the `clip` mode).
+ *
+ * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // picks elements with specified indices along axis 0
+ * pick(x, y=[0,1], 0) = [ 1., 4.]
+ *
+ * // picks elements with specified indices along axis 1
+ * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
+ *
+ * y = [[ 1.],
+ * [ 0.],
+ * [ 2.]]
+ *
+ * // picks elements with specified indices along axis 1 and dims are maintained
+ * pick(x,y, 1, keepdims=True) = [[ 2.],
+ * [ 3.],
+ * [ 6.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
+ * @return org.apache.mxnet.NDArray + */ +def pick(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Picks elements from an input array according to the input indices along the given axis.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last element along an axis (the `clip` mode).
+ *
+ * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // picks elements with specified indices along axis 0
+ * pick(x, y=[0,1], 0) = [ 1., 4.]
+ *
+ * // picks elements with specified indices along axis 1
+ * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
+ *
+ * y = [[ 1.],
+ * [ 0.],
+ * [ 2.]]
+ *
+ * // picks elements with specified indices along axis 1 and dims are maintained
+ * pick(x,y, 1, keepdims=True) = [[ 2.],
+ * [ 3.],
+ * [ 6.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
+ * @return org.apache.mxnet.NDArray + */ +def pick(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the product of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
+ * @return org.apache.mxnet.NDArray + */ +def prod(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the product of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
+ * @return org.apache.mxnet.NDArray + */ +def prod(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts each element of the input array from degrees to radians.
+ *
+ * .. math::
+ * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
+ *
+ * The storage type of ``radians`` output depends upon the input storage type:
+ *
+ * - radians(default) = default
+ * - radians(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
+ * @return org.apache.mxnet.NDArray + */ +def radians(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts each element of the input array from degrees to radians.
+ *
+ * .. math::
+ * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
+ *
+ * The storage type of ``radians`` output depends upon the input storage type:
+ *
+ * - radians(default) = default
+ * - radians(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
+ * @return org.apache.mxnet.NDArray + */ +def radians(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from an exponential distribution.
+ *
+ * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
+ *
+ * Example::
+ *
+ * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
+ * [ 0.04146638, 0.31715935]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L115
+ * @return org.apache.mxnet.NDArray + */ +def random_exponential(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from an exponential distribution.
+ *
+ * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
+ *
+ * Example::
+ *
+ * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
+ * [ 0.04146638, 0.31715935]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L115
+ * @return org.apache.mxnet.NDArray + */ +def random_exponential(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a gamma distribution.
+ *
+ * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
+ *
+ * Example::
+ *
+ * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
+ * [ 3.91697288, 3.65933681]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L100
+ * @return org.apache.mxnet.NDArray + */ +def random_gamma(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a gamma distribution.
+ *
+ * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
+ *
+ * Example::
+ *
+ * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
+ * [ 3.91697288, 3.65933681]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L100
+ * @return org.apache.mxnet.NDArray + */ +def random_gamma(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a generalized negative binomial distribution.
+ *
+ * Samples are distributed according to a generalized negative binomial distribution parametrized by
+ * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
+ * number of unsuccessful experiments (generalized to real numbers).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
+ * [ 6., 4.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L168
+ * @return org.apache.mxnet.NDArray + */ +def random_generalized_negative_binomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a generalized negative binomial distribution.
+ *
+ * Samples are distributed according to a generalized negative binomial distribution parametrized by
+ * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
+ * number of unsuccessful experiments (generalized to real numbers).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
+ * [ 6., 4.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L168
+ * @return org.apache.mxnet.NDArray + */ +def random_generalized_negative_binomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a negative binomial distribution.
+ *
+ * Samples are distributed according to a negative binomial distribution parametrized by
+ * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
+ * [ 2., 5.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L149
+ * @return org.apache.mxnet.NDArray + */ +def random_negative_binomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a negative binomial distribution.
+ *
+ * Samples are distributed according to a negative binomial distribution parametrized by
+ * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
+ * [ 2., 5.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L149
+ * @return org.apache.mxnet.NDArray + */ +def random_negative_binomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @return org.apache.mxnet.NDArray + */ +def random_normal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @return org.apache.mxnet.NDArray + */ +def random_normal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a Poisson distribution.
+ *
+ * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
+ * [ 4., 6.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L132
+ * @return org.apache.mxnet.NDArray + */ +def random_poisson(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a Poisson distribution.
+ *
+ * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
+ * [ 4., 6.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L132
+ * @return org.apache.mxnet.NDArray + */ +def random_poisson(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @return org.apache.mxnet.NDArray + */ +def random_uniform(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @return org.apache.mxnet.NDArray + */ +def random_uniform(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
+ *
+ * Examples::
+ *
+ * A = [[3,6,6],[4,5,1]]
+ * ravel(A, shape=(7,6)) = [22,41,37]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L41
+ * @return org.apache.mxnet.NDArray + */ +def ravel_multi_index(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
+ *
+ * Examples::
+ *
+ * A = [[3,6,6],[4,5,1]]
+ * ravel(A, shape=(7,6)) = [22,41,37]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L41
+ * @return org.apache.mxnet.NDArray + */ +def ravel_multi_index(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse cube-root value of the input.
+ *
+ * .. math::
+ * rcbrt(x) = 1/\sqrt[3]{x}
+ *
+ * Example::
+ *
+ * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
+ * @return org.apache.mxnet.NDArray + */ +def rcbrt(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse cube-root value of the input.
+ *
+ * .. math::
+ * rcbrt(x) = 1/\sqrt[3]{x}
+ *
+ * Example::
+ *
+ * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
+ * @return org.apache.mxnet.NDArray + */ +def rcbrt(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the reciprocal of the argument, element-wise.
+ *
+ * Calculates 1/x.
+ *
+ * Example::
+ *
+ * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
+ * @return org.apache.mxnet.NDArray + */ +def reciprocal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the reciprocal of the argument, element-wise.
+ *
+ * Calculates 1/x.
+ *
+ * Example::
+ *
+ * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
+ * @return org.apache.mxnet.NDArray + */ +def reciprocal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes rectified linear.
+ *
+ * .. math::
+ * max(features, 0)
+ *
+ * The storage type of ``relu`` output depends upon the input storage type:
+ *
+ * - relu(default) = default
+ * - relu(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
+ * @return org.apache.mxnet.NDArray + */ +def relu(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes rectified linear.
+ *
+ * .. math::
+ * max(features, 0)
+ *
+ * The storage type of ``relu`` output depends upon the input storage type:
+ *
+ * - relu(default) = default
+ * - relu(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
+ * @return org.apache.mxnet.NDArray + */ +def relu(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Repeats elements of an array.
+ *
+ * By default, ``repeat`` flattens the input array into 1-D and then repeats the
+ * elements::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
+ *
+ * The parameter ``axis`` specifies the axis along which to perform repeat::
+ *
+ * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
+ * [ 1., 2.],
+ * [ 3., 4.],
+ * [ 3., 4.]]
+ *
+ * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L690
+ * @return org.apache.mxnet.NDArray + */ +def repeat(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Repeats elements of an array.
+ *
+ * By default, ``repeat`` flattens the input array into 1-D and then repeats the
+ * elements::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
+ *
+ * The parameter ``axis`` specifies the axis along which to perform repeat::
+ *
+ * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
+ * [ 1., 2.],
+ * [ 3., 4.],
+ * [ 3., 4.]]
+ *
+ * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L690
+ * @return org.apache.mxnet.NDArray + */ +def repeat(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @return org.apache.mxnet.NDArray + */ +def reshape(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @return org.apache.mxnet.NDArray + */ +def reshape(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reshape lhs to have the same shape as rhs.
+ * @return org.apache.mxnet.NDArray + */ +def reshape_like(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reshape lhs to have the same shape as rhs.
+ * @return org.apache.mxnet.NDArray + */ +def reshape_like(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @return org.apache.mxnet.NDArray + */ +def reverse(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @return org.apache.mxnet.NDArray + */ +def reverse(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * .. note::
+ * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
+ * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
+ *
+ * Example::
+ *
+ * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
+ *
+ * The storage type of ``rint`` output depends upon the input storage type:
+ *
+ * - rint(default) = default
+ * - rint(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
+ * @return org.apache.mxnet.NDArray + */ +def rint(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * .. note::
+ * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
+ * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
+ *
+ * Example::
+ *
+ * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
+ *
+ * The storage type of ``rint`` output depends upon the input storage type:
+ *
+ * - rint(default) = default
+ * - rint(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
+ * @return org.apache.mxnet.NDArray + */ +def rint(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for `RMSProp` optimizer.
+ *
+ * `RMSprop` is a variant of stochastic gradient descent where the gradients are
+ * divided by a cache which grows with the sum of squares of recent gradients?
+ *
+ * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
+ * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
+ * each parameter monotonically over the course of training.
+ * While this is analytically motivated for convex optimizations, it may not be ideal
+ * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
+ * learning rates to rebound as the denominator decays over time.
+ *
+ * Define the Root Mean Square (RMS) error criterion of the gradient as
+ * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
+ * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
+ *
+ * The :math:`E[g^2]_t` is given by:
+ *
+ * .. math::
+ * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
+ *
+ * The RMSProp code follows the version in
+ * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
+ * Tieleman & Hinton, 2012.
+ *
+ * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
+ * :math:`\eta` to be 0.001.
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L553
+ * @return org.apache.mxnet.NDArray + */ +def rmsprop_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for `RMSProp` optimizer.
+ *
+ * `RMSprop` is a variant of stochastic gradient descent where the gradients are
+ * divided by a cache which grows with the sum of squares of recent gradients?
+ *
+ * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
+ * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
+ * each parameter monotonically over the course of training.
+ * While this is analytically motivated for convex optimizations, it may not be ideal
+ * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
+ * learning rates to rebound as the denominator decays over time.
+ *
+ * Define the Root Mean Square (RMS) error criterion of the gradient as
+ * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
+ * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
+ *
+ * The :math:`E[g^2]_t` is given by:
+ *
+ * .. math::
+ * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
+ *
+ * The RMSProp code follows the version in
+ * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
+ * Tieleman & Hinton, 2012.
+ *
+ * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
+ * :math:`\eta` to be 0.001.
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L553
+ * @return org.apache.mxnet.NDArray + */ +def rmsprop_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for RMSPropAlex optimizer.
+ *
+ * `RMSPropAlex` is non-centered version of `RMSProp`.
+ *
+ * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
+ * :math:`E[g]_t` is the decaying average over past gradient.
+ *
+ * .. math::
+ * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
+ * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
+ * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t + \Delta_t
+ *
+ * The RMSPropAlex code follows the version in
+ * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
+ *
+ * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
+ * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L592
+ * @return org.apache.mxnet.NDArray + */ +def rmspropalex_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for RMSPropAlex optimizer.
+ *
+ * `RMSPropAlex` is non-centered version of `RMSProp`.
+ *
+ * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
+ * :math:`E[g]_t` is the decaying average over past gradient.
+ *
+ * .. math::
+ * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
+ * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
+ * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t + \Delta_t
+ *
+ * The RMSPropAlex code follows the version in
+ * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
+ *
+ * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
+ * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L592
+ * @return org.apache.mxnet.NDArray + */ +def rmspropalex_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * Example::
+ *
+ * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
+ *
+ * The storage type of ``round`` output depends upon the input storage type:
+ *
+ * - round(default) = default
+ * - round(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
+ * @return org.apache.mxnet.NDArray + */ +def round(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * Example::
+ *
+ * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
+ *
+ * The storage type of ``round`` output depends upon the input storage type:
+ *
+ * - round(default) = default
+ * - round(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
+ * @return org.apache.mxnet.NDArray + */ +def round(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse square-root value of the input.
+ *
+ * .. math::
+ * rsqrt(x) = 1/\sqrt{x}
+ *
+ * Example::
+ *
+ * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
+ *
+ * The storage type of ``rsqrt`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
+ * @return org.apache.mxnet.NDArray + */ +def rsqrt(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise inverse square-root value of the input.
+ *
+ * .. math::
+ * rsqrt(x) = 1/\sqrt{x}
+ *
+ * Example::
+ *
+ * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
+ *
+ * The storage type of ``rsqrt`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
+ * @return org.apache.mxnet.NDArray + */ +def rsqrt(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * exponential distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_exponential(lam) = [ 0.51837951, 0.09994757]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
+ * [ 0.09994757, 0.50447971]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L284
+ * @return org.apache.mxnet.NDArray + */ +def sample_exponential(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * exponential distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_exponential(lam) = [ 0.51837951, 0.09994757]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
+ * [ 0.09994757, 0.50447971]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L284
+ * @return org.apache.mxnet.NDArray + */ +def sample_exponential(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * alpha = [ 0.0, 2.5 ]
+ * beta = [ 1.0, 0.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
+ * [ 2.25797319, 1.70734084]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L282
+ * @return org.apache.mxnet.NDArray + */ +def sample_gamma(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * alpha = [ 0.0, 2.5 ]
+ * beta = [ 1.0, 0.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
+ * [ 2.25797319, 1.70734084]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L282
+ * @return org.apache.mxnet.NDArray + */ +def sample_gamma(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * mu = [ 2.0, 2.5 ]
+ * alpha = [ 1.0, 0.1 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
+ * [ 3., 1.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L293
+ * @return org.apache.mxnet.NDArray + */ +def sample_generalized_negative_binomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * mu = [ 2.0, 2.5 ]
+ * alpha = [ 1.0, 0.1 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
+ * [ 3., 1.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L293
+ * @return org.apache.mxnet.NDArray + */ +def sample_generalized_negative_binomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple multinomial distributions.
+ *
+ * *data* is an *n* dimensional array whose last dimension has length *k*, where
+ * *k* is the number of possible outcomes of each multinomial distribution. This
+ * operator will draw *shape* samples from each distribution. If shape is empty
+ * one sample will be drawn from each distribution.
+ *
+ * If *get_prob* is true, a second array containing log likelihood of the drawn
+ * samples will also be returned. This is usually used for reinforcement learning
+ * where you can provide reward as head gradient for this array to estimate
+ * gradient.
+ *
+ * Note that the input distribution must be normalized, i.e. *data* must sum to
+ * 1 along its last axis.
+ *
+ * Examples::
+ *
+ * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
+ *
+ * // Draw a single sample for each distribution
+ * sample_multinomial(probs) = [3, 0]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_multinomial(probs, shape=(2)) = [[4, 2],
+ * [0, 0]]
+ *
+ * // requests log likelihood
+ * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
+ * @return org.apache.mxnet.NDArray + */ +def sample_multinomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple multinomial distributions.
+ *
+ * *data* is an *n* dimensional array whose last dimension has length *k*, where
+ * *k* is the number of possible outcomes of each multinomial distribution. This
+ * operator will draw *shape* samples from each distribution. If shape is empty
+ * one sample will be drawn from each distribution.
+ *
+ * If *get_prob* is true, a second array containing log likelihood of the drawn
+ * samples will also be returned. This is usually used for reinforcement learning
+ * where you can provide reward as head gradient for this array to estimate
+ * gradient.
+ *
+ * Note that the input distribution must be normalized, i.e. *data* must sum to
+ * 1 along its last axis.
+ *
+ * Examples::
+ *
+ * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
+ *
+ * // Draw a single sample for each distribution
+ * sample_multinomial(probs) = [3, 0]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_multinomial(probs, shape=(2)) = [[4, 2],
+ * [0, 0]]
+ *
+ * // requests log likelihood
+ * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
+ * @return org.apache.mxnet.NDArray + */ +def sample_multinomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * k = [ 20, 49 ]
+ * p = [ 0.4 , 0.77 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_negative_binomial(k, p) = [ 15., 16.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
+ * [ 16., 12.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L289
+ * @return org.apache.mxnet.NDArray + */ +def sample_negative_binomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * k = [ 20, 49 ]
+ * p = [ 0.4 , 0.77 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_negative_binomial(k, p) = [ 15., 16.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
+ * [ 16., 12.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L289
+ * @return org.apache.mxnet.NDArray + */ +def sample_negative_binomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * mu = [ 0.0, 2.5 ]
+ * sigma = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
+ * [ 0.95934606, 4.48287058]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L279
+ * @return org.apache.mxnet.NDArray + */ +def sample_normal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * mu = [ 0.0, 2.5 ]
+ * sigma = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
+ * [ 0.95934606, 4.48287058]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L279
+ * @return org.apache.mxnet.NDArray + */ +def sample_normal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * Poisson distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_poisson(lam) = [ 0., 13.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
+ * [ 13., 8.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L286
+ * @return org.apache.mxnet.NDArray + */ +def sample_poisson(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * Poisson distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_poisson(lam) = [ 0., 13.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
+ * [ 13., 8.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L286
+ * @return org.apache.mxnet.NDArray + */ +def sample_poisson(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * uniform distributions on the intervals given by *[low,high)*.
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * low = [ 0.0, 2.5 ]
+ * high = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
+ * [ 3.18687344, 3.68352246]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L277
+ * @return org.apache.mxnet.NDArray + */ +def sample_uniform(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Concurrent sampling from multiple
+ * uniform distributions on the intervals given by *[low,high)*.
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * low = [ 0.0, 2.5 ]
+ * high = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
+ * [ 3.18687344, 3.68352246]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L277
+ * @return org.apache.mxnet.NDArray + */ +def sample_uniform(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Scatters data into a new tensor according to indices.
+ *
+ * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
+ *
+ * all other entries in output are 0.
+ *
+ * .. warning::
+ *
+ * If the indices have duplicates, the result will be non-deterministic and
+ * the gradient of `scatter_nd` will not be correct!!
+ *
+ *
+ * Examples::
+ *
+ * data = [2, 3, 0]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * shape = (2, 2)
+ * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
+ * @return org.apache.mxnet.NDArray + */ +def scatter_nd(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Scatters data into a new tensor according to indices.
+ *
+ * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
+ *
+ * all other entries in output are 0.
+ *
+ * .. warning::
+ *
+ * If the indices have duplicates, the result will be non-deterministic and
+ * the gradient of `scatter_nd` will not be correct!!
+ *
+ *
+ * Examples::
+ *
+ * data = [2, 3, 0]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * shape = (2, 2)
+ * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
+ * @return org.apache.mxnet.NDArray + */ +def scatter_nd(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
+ *
+ * Momentum update has better convergence rates on neural networks. Mathematically it looks
+ * like below:
+ *
+ * .. math::
+ *
+ * v_1 = \alpha * \nabla J(W_0)\\
+ * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} + v_t
+ *
+ * It updates the weights using::
+ *
+ * v = momentum * v - learning_rate * gradient
+ * weight += v
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
+ * type is the same as momentum's storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
+ *
+ * for row in gradient.indices:
+ * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
+ * weight[row] += v[row]
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L372
+ * @return org.apache.mxnet.NDArray + */ +def sgd_mom_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
+ *
+ * Momentum update has better convergence rates on neural networks. Mathematically it looks
+ * like below:
+ *
+ * .. math::
+ *
+ * v_1 = \alpha * \nabla J(W_0)\\
+ * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} + v_t
+ *
+ * It updates the weights using::
+ *
+ * v = momentum * v - learning_rate * gradient
+ * weight += v
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
+ * type is the same as momentum's storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
+ *
+ * for row in gradient.indices:
+ * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
+ * weight[row] += v[row]
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L372
+ * @return org.apache.mxnet.NDArray + */ +def sgd_mom_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for Stochastic Gradient Descent (SDG) optimizer.
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * (gradient + wd * weight)
+ *
+ * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
+ * only the row slices whose indices appear in grad.indices are updated::
+ *
+ * for row in gradient.indices:
+ * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L331
+ * @return org.apache.mxnet.NDArray + */ +def sgd_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for Stochastic Gradient Descent (SDG) optimizer.
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * (gradient + wd * weight)
+ *
+ * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
+ * only the row slices whose indices appear in grad.indices are updated::
+ *
+ * for row in gradient.indices:
+ * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L331
+ * @return org.apache.mxnet.NDArray + */ +def sgd_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Randomly shuffle the elements.
+ *
+ * This shuffles the array along the first axis.
+ * The order of the elements in each subarray does not change.
+ * For example, if a 2D array is given, the order of the rows randomly changes,
+ * but the order of the elements in each row does not change.
+ * @return org.apache.mxnet.NDArray + */ +def shuffle(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Randomly shuffle the elements.
+ *
+ * This shuffles the array along the first axis.
+ * The order of the elements in each subarray does not change.
+ * For example, if a 2D array is given, the order of the rows randomly changes,
+ * but the order of the elements in each row does not change.
+ * @return org.apache.mxnet.NDArray + */ +def shuffle(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = 1 / (1 + exp(-x))
+ *
+ * The storage type of ``sigmoid`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
+ * @return org.apache.mxnet.NDArray + */ +def sigmoid(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = 1 / (1 + exp(-x))
+ *
+ * The storage type of ``sigmoid`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
+ * @return org.apache.mxnet.NDArray + */ +def sigmoid(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise sign of the input.
+ *
+ * Example::
+ *
+ * sign([-2, 0, 3]) = [-1, 0, 1]
+ *
+ * The storage type of ``sign`` output depends upon the input storage type:
+ *
+ * - sign(default) = default
+ * - sign(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
+ * @return org.apache.mxnet.NDArray + */ +def sign(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise sign of the input.
+ *
+ * Example::
+ *
+ * sign([-2, 0, 3]) = [-1, 0, 1]
+ *
+ * The storage type of ``sign`` output depends upon the input storage type:
+ *
+ * - sign(default) = default
+ * - sign(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
+ * @return org.apache.mxnet.NDArray + */ +def sign(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for SignSGD optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * sign(gradient)
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L57
+ * @return org.apache.mxnet.NDArray + */ +def signsgd_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Update function for SignSGD optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * sign(gradient)
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L57
+ * @return org.apache.mxnet.NDArray + */ +def signsgd_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * SIGN momentUM (Signum) optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
+ *
+ * It updates the weights using::
+ * state = momentum * state + (1-momentum) * gradient
+ * weight = weight - learning_rate * sign(state)
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L86
+ * @return org.apache.mxnet.NDArray + */ +def signum_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * SIGN momentUM (Signum) optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
+ *
+ * It updates the weights using::
+ * state = momentum * state + (1-momentum) * gradient
+ * weight = weight - learning_rate * sign(state)
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L86
+ * @return org.apache.mxnet.NDArray + */ +def signum_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the element-wise sine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
+ *
+ * The storage type of ``sin`` output depends upon the input storage type:
+ *
+ * - sin(default) = default
+ * - sin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
+ * @return org.apache.mxnet.NDArray + */ +def sin(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the element-wise sine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
+ *
+ * The storage type of ``sin`` output depends upon the input storage type:
+ *
+ * - sin(default) = default
+ * - sin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
+ * @return org.apache.mxnet.NDArray + */ +def sin(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hyperbolic sine of the input array, computed element-wise.
+ *
+ * .. math::
+ * sinh(x) = 0.5\times(exp(x) - exp(-x))
+ *
+ * The storage type of ``sinh`` output depends upon the input storage type:
+ *
+ * - sinh(default) = default
+ * - sinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
+ * @return org.apache.mxnet.NDArray + */ +def sinh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hyperbolic sine of the input array, computed element-wise.
+ *
+ * .. math::
+ * sinh(x) = 0.5\times(exp(x) - exp(-x))
+ *
+ * The storage type of ``sinh`` output depends upon the input storage type:
+ *
+ * - sinh(default) = default
+ * - sinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
+ * @return org.apache.mxnet.NDArray + */ +def sinh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @return org.apache.mxnet.NDArray + */ +def slice(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @return org.apache.mxnet.NDArray + */ +def slice(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices along a given axis.
+ *
+ * Returns an array slice along a given `axis` starting from the `begin` index
+ * to the `end` index.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
+ * [ 5., 6.],
+ * [ 9., 10.]]
+ *
+ * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
+ * [ 6., 7.],
+ * [ 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L499
+ * @return org.apache.mxnet.NDArray + */ +def slice_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices along a given axis.
+ *
+ * Returns an array slice along a given `axis` starting from the `begin` index
+ * to the `end` index.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
+ * [ 5., 6.],
+ * [ 9., 10.]]
+ *
+ * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
+ * [ 6., 7.],
+ * [ 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L499
+ * @return org.apache.mxnet.NDArray + */ +def slice_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices a region of the array like the shape of another array.
+ *
+ * This function is similar to ``slice``, however, the `begin` are always `0`s
+ * and `end` of specific axes are inferred from the second input `shape_like`.
+ *
+ * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * a ``slice_like`` operator with default empty `axes`, it performs the
+ * following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
+ *
+ * When `axes` is not empty, it is used to speficy which axes are being sliced.
+ *
+ * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
+ * will perform the following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
+ *
+ * Note that it is allowed to have first and second input with different dimensions,
+ * however, you have to make sure the `axes` are specified and not exceeding the
+ * dimension limits.
+ *
+ * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
+ * ``shape=(1,2,3)``, it is not allowed to use:
+ *
+ * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
+ * is 3.
+ *
+ * The following is allowed in this situation:
+ *
+ * `` out = slice_like(a, b, axes=(0, 2))``
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * y = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * slice_like(x, y) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
+ * [ 5., 6., 7., 8.]]
+ * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]
+ * [ 9., 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L568
+ * @return org.apache.mxnet.NDArray + */ +def slice_like(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Slices a region of the array like the shape of another array.
+ *
+ * This function is similar to ``slice``, however, the `begin` are always `0`s
+ * and `end` of specific axes are inferred from the second input `shape_like`.
+ *
+ * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * a ``slice_like`` operator with default empty `axes`, it performs the
+ * following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
+ *
+ * When `axes` is not empty, it is used to speficy which axes are being sliced.
+ *
+ * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
+ * will perform the following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
+ *
+ * Note that it is allowed to have first and second input with different dimensions,
+ * however, you have to make sure the `axes` are specified and not exceeding the
+ * dimension limits.
+ *
+ * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
+ * ``shape=(1,2,3)``, it is not allowed to use:
+ *
+ * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
+ * is 3.
+ *
+ * The following is allowed in this situation:
+ *
+ * `` out = slice_like(a, b, axes=(0, 2))``
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * y = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * slice_like(x, y) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
+ * [ 5., 6., 7., 8.]]
+ * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]
+ * [ 9., 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L568
+ * @return org.apache.mxnet.NDArray + */ +def slice_like(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Calculate Smooth L1 Loss(lhs, scalar) by summing
+ *
+ * .. math::
+ *
+ * f(x) =
+ * \begin{cases}
+ * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
+ * |x|-0.5/\sigma^2,& \text{otherwise}
+ * \end{cases}
+ *
+ * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
+ *
+ * Example::
+ *
+ * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
+ * @return org.apache.mxnet.NDArray + */ +def smooth_l1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Calculate Smooth L1 Loss(lhs, scalar) by summing
+ *
+ * .. math::
+ *
+ * f(x) =
+ * \begin{cases}
+ * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
+ * |x|-0.5/\sigma^2,& \text{otherwise}
+ * \end{cases}
+ *
+ * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
+ *
+ * Example::
+ *
+ * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
+ * @return org.apache.mxnet.NDArray + */ +def smooth_l1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies the softmax function.
+ *
+ * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
+ *
+ * .. math::
+ * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
+ *
+ * for :math:`j = 1, ..., K`
+ *
+ * Example::
+ *
+ * x = [[ 1. 1. 1.]
+ * [ 1. 1. 1.]]
+ *
+ * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
+ * [ 0.5 0.5 0.5]]
+ *
+ * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
+ * [ 0.33333334, 0.33333334, 0.33333334]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax.cc:L95
+ * @return org.apache.mxnet.NDArray + */ +def softmax(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Applies the softmax function.
+ *
+ * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
+ *
+ * .. math::
+ * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
+ *
+ * for :math:`j = 1, ..., K`
+ *
+ * Example::
+ *
+ * x = [[ 1. 1. 1.]
+ * [ 1. 1. 1.]]
+ *
+ * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
+ * [ 0.5 0.5 0.5]]
+ *
+ * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
+ * [ 0.33333334, 0.33333334, 0.33333334]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax.cc:L95
+ * @return org.apache.mxnet.NDArray + */ +def softmax(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Calculate cross entropy of softmax output and one-hot label.
+ *
+ * - This operator computes the cross entropy in two steps:
+ * - Applies softmax function on the input array.
+ * - Computes and returns the cross entropy loss between the softmax output and the labels.
+ *
+ * - The softmax function and cross entropy loss is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * Example::
+ *
+ * x = [[1, 2, 3],
+ * [11, 7, 5]]
+ *
+ * label = [2, 0]
+ *
+ * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
+ * [0.97962922, 0.01794253, 0.00242826]]
+ *
+ * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
+ *
+ *
+ *
+ * Defined in src/operator/loss_binary_op.cc:L59
+ * @return org.apache.mxnet.NDArray + */ +def softmax_cross_entropy(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Calculate cross entropy of softmax output and one-hot label.
+ *
+ * - This operator computes the cross entropy in two steps:
+ * - Applies softmax function on the input array.
+ * - Computes and returns the cross entropy loss between the softmax output and the labels.
+ *
+ * - The softmax function and cross entropy loss is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * Example::
+ *
+ * x = [[1, 2, 3],
+ * [11, 7, 5]]
+ *
+ * label = [2, 0]
+ *
+ * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
+ * [0.97962922, 0.01794253, 0.00242826]]
+ *
+ * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
+ *
+ *
+ *
+ * Defined in src/operator/loss_binary_op.cc:L59
+ * @return org.apache.mxnet.NDArray + */ +def softmax_cross_entropy(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes softsign of x element-wise.
+ *
+ * .. math::
+ * y = x / (1 + abs(x))
+ *
+ * The storage type of ``softsign`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
+ * @return org.apache.mxnet.NDArray + */ +def softsign(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes softsign of x element-wise.
+ *
+ * .. math::
+ * y = x / (1 + abs(x))
+ *
+ * The storage type of ``softsign`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
+ * @return org.apache.mxnet.NDArray + */ +def softsign(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns a sorted copy of an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 4],
+ * [ 3, 1]]
+ *
+ * // sorts along the last axis
+ * sort(x) = [[ 1., 4.],
+ * [ 1., 3.]]
+ *
+ * // flattens and then sorts
+ * sort(x) = [ 1., 1., 3., 4.]
+ *
+ * // sorts along the first axis
+ * sort(x, axis=0) = [[ 1., 1.],
+ * [ 3., 4.]]
+ *
+ * // in a descend order
+ * sort(x, is_ascend=0) = [[ 4., 1.],
+ * [ 3., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L126
+ * @return org.apache.mxnet.NDArray + */ +def sort(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns a sorted copy of an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 4],
+ * [ 3, 1]]
+ *
+ * // sorts along the last axis
+ * sort(x) = [[ 1., 4.],
+ * [ 1., 3.]]
+ *
+ * // flattens and then sorts
+ * sort(x) = [ 1., 1., 3., 4.]
+ *
+ * // sorts along the first axis
+ * sort(x, axis=0) = [[ 1., 1.],
+ * [ 3., 4.]]
+ *
+ * // in a descend order
+ * sort(x, is_ascend=0) = [[ 4., 1.],
+ * [ 3., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L126
+ * @return org.apache.mxnet.NDArray + */ +def sort(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @return org.apache.mxnet.NDArray + */ +def split(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @return org.apache.mxnet.NDArray + */ +def split(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise square-root value of the input.
+ *
+ * .. math::
+ * \textrm{sqrt}(x) = \sqrt{x}
+ *
+ * Example::
+ *
+ * sqrt([4, 9, 16]) = [2, 3, 4]
+ *
+ * The storage type of ``sqrt`` output depends upon the input storage type:
+ *
+ * - sqrt(default) = default
+ * - sqrt(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
+ * @return org.apache.mxnet.NDArray + */ +def sqrt(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise square-root value of the input.
+ *
+ * .. math::
+ * \textrm{sqrt}(x) = \sqrt{x}
+ *
+ * Example::
+ *
+ * sqrt([4, 9, 16]) = [2, 3, 4]
+ *
+ * The storage type of ``sqrt`` output depends upon the input storage type:
+ *
+ * - sqrt(default) = default
+ * - sqrt(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
+ * @return org.apache.mxnet.NDArray + */ +def sqrt(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise squared value of the input.
+ *
+ * .. math::
+ * square(x) = x^2
+ *
+ * Example::
+ *
+ * square([2, 3, 4]) = [4, 9, 16]
+ *
+ * The storage type of ``square`` output depends upon the input storage type:
+ *
+ * - square(default) = default
+ * - square(row_sparse) = row_sparse
+ * - square(csr) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
+ * @return org.apache.mxnet.NDArray + */ +def square(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns element-wise squared value of the input.
+ *
+ * .. math::
+ * square(x) = x^2
+ *
+ * Example::
+ *
+ * square([2, 3, 4]) = [4, 9, 16]
+ *
+ * The storage type of ``square`` output depends upon the input storage type:
+ *
+ * - square(default) = default
+ * - square(row_sparse) = row_sparse
+ * - square(csr) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
+ * @return org.apache.mxnet.NDArray + */ +def square(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Remove single-dimensional entries from the shape of an array.
+ * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
+ * See the following note for exception.
+ *
+ * Examples::
+ *
+ * data = [[[0], [1], [2]]]
+ * squeeze(data) = [0, 1, 2]
+ * squeeze(data, axis=0) = [[0], [1], [2]]
+ * squeeze(data, axis=2) = [[0, 1, 2]]
+ * squeeze(data, axis=(0, 2)) = [0, 1, 2]
+ *
+ * .. Note::
+ * The output of this operator will keep at least one dimension not removed. For example,
+ * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
+ * @return org.apache.mxnet.NDArray + */ +def squeeze(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Remove single-dimensional entries from the shape of an array.
+ * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
+ * See the following note for exception.
+ *
+ * Examples::
+ *
+ * data = [[[0], [1], [2]]]
+ * squeeze(data) = [0, 1, 2]
+ * squeeze(data, axis=0) = [[0], [1], [2]]
+ * squeeze(data, axis=2) = [[0, 1, 2]]
+ * squeeze(data, axis=(0, 2)) = [0, 1, 2]
+ *
+ * .. Note::
+ * The output of this operator will keep at least one dimension not removed. For example,
+ * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
+ * @return org.apache.mxnet.NDArray + */ +def squeeze(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Join a sequence of arrays along a new axis.
+ *
+ * The axis parameter specifies the index of the new axis in the dimensions of the
+ * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
+ * will be the last dimension.
+ *
+ * Examples::
+ *
+ * x = [1, 2]
+ * y = [3, 4]
+ *
+ * stack(x, y) = [[1, 2],
+ * [3, 4]]
+ * stack(x, y, axis=1) = [[1, 3],
+ * [2, 4]]
+ * @return org.apache.mxnet.NDArray + */ +def stack(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Join a sequence of arrays along a new axis.
+ *
+ * The axis parameter specifies the index of the new axis in the dimensions of the
+ * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
+ * will be the last dimension.
+ *
+ * Examples::
+ *
+ * x = [1, 2]
+ * y = [3, 4]
+ *
+ * stack(x, y) = [[1, 2],
+ * [3, 4]]
+ * stack(x, y, axis=1) = [[1, 3],
+ * [2, 4]]
+ * @return org.apache.mxnet.NDArray + */ +def stack(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @return org.apache.mxnet.NDArray + */ +def stop_gradient(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @return org.apache.mxnet.NDArray + */ +def stop_gradient(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @return org.apache.mxnet.NDArray + */ +def sum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @return org.apache.mxnet.NDArray + */ +def sum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @return org.apache.mxnet.NDArray + */ +def sum_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @return org.apache.mxnet.NDArray + */ +def sum_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @return org.apache.mxnet.NDArray + */ +def swapaxes(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @return org.apache.mxnet.NDArray + */ +def swapaxes(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Takes elements from an input array along the given axis.
+ *
+ * This function slices the input array along a particular axis with the provided indices.
+ *
+ * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
+ * will have shape ``(i0, i1, d1, d2)``, computed by::
+ *
+ * output[i,j,:,:] = input[indices[i,j],:,:]
+ *
+ * .. note::
+ * - `axis`- Only slicing along axis 0 is supported for now.
+ * - `mode`- Only `clip` mode is supported for now.
+ *
+ * Examples::
+ * x = [4. 5. 6.]
+ *
+ * // Trivial case, take the second element along the first axis.
+ * take(x, [1]) = [ 5. ]
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
+ * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 3., 4.],
+ * [ 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L389
+ * @return org.apache.mxnet.NDArray + */ +def take(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Takes elements from an input array along the given axis.
+ *
+ * This function slices the input array along a particular axis with the provided indices.
+ *
+ * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
+ * will have shape ``(i0, i1, d1, d2)``, computed by::
+ *
+ * output[i,j,:,:] = input[indices[i,j],:,:]
+ *
+ * .. note::
+ * - `axis`- Only slicing along axis 0 is supported for now.
+ * - `mode`- Only `clip` mode is supported for now.
+ *
+ * Examples::
+ * x = [4. 5. 6.]
+ *
+ * // Trivial case, take the second element along the first axis.
+ * take(x, [1]) = [ 5. ]
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
+ * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 3., 4.],
+ * [ 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L389
+ * @return org.apache.mxnet.NDArray + */ +def take(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the element-wise tangent of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
+ *
+ * The storage type of ``tan`` output depends upon the input storage type:
+ *
+ * - tan(default) = default
+ * - tan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
+ * @return org.apache.mxnet.NDArray + */ +def tan(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Computes the element-wise tangent of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
+ *
+ * The storage type of ``tan`` output depends upon the input storage type:
+ *
+ * - tan(default) = default
+ * - tan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
+ * @return org.apache.mxnet.NDArray + */ +def tan(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hyperbolic tangent of the input array, computed element-wise.
+ *
+ * .. math::
+ * tanh(x) = sinh(x) / cosh(x)
+ *
+ * The storage type of ``tanh`` output depends upon the input storage type:
+ *
+ * - tanh(default) = default
+ * - tanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
+ * @return org.apache.mxnet.NDArray + */ +def tanh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the hyperbolic tangent of the input array, computed element-wise.
+ *
+ * .. math::
+ * tanh(x) = sinh(x) / cosh(x)
+ *
+ * The storage type of ``tanh`` output depends upon the input storage type:
+ *
+ * - tanh(default) = default
+ * - tanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
+ * @return org.apache.mxnet.NDArray + */ +def tanh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Repeats the whole array multiple times.
+ *
+ * If ``reps`` has length *d*, and input array has dimension of *n*. There are
+ * three cases:
+ *
+ * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]
+ *
+ * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
+ * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
+ *
+ *
+ * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4.]]
+ *
+ * - **n + * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
+ *
+ * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]],
+ *
+ * [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L751
+ * @return org.apache.mxnet.NDArray + */ +def tile(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Repeats the whole array multiple times.
+ *
+ * If ``reps`` has length *d*, and input array has dimension of *n*. There are
+ * three cases:
+ *
+ * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]
+ *
+ * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
+ * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
+ *
+ *
+ * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4.]]
+ *
+ * - **n + * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
+ *
+ * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]],
+ *
+ * [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L751
+ * @return org.apache.mxnet.NDArray + */ +def tile(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the top *k* elements in an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // returns an index of the largest element on last axis
+ * topk(x) = [[ 2.],
+ * [ 1.]]
+ *
+ * // returns the value of top-2 largest elements on last axis
+ * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
+ * [ 0.3, 0.2]]
+ *
+ * // returns the value of top-2 smallest elements on last axis
+ * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
+ * [ 0.1 , 0.2]]
+ *
+ * // returns the value of top-2 largest elements on axis 0
+ * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
+ * [ 0.1, 0.2, 0.2]]
+ *
+ * // flattens and then returns list of both values and indices
+ * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L63
+ * @return org.apache.mxnet.NDArray + */ +def topk(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Returns the top *k* elements in an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // returns an index of the largest element on last axis
+ * topk(x) = [[ 2.],
+ * [ 1.]]
+ *
+ * // returns the value of top-2 largest elements on last axis
+ * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
+ * [ 0.3, 0.2]]
+ *
+ * // returns the value of top-2 smallest elements on last axis
+ * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
+ * [ 0.1 , 0.2]]
+ *
+ * // returns the value of top-2 largest elements on axis 0
+ * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
+ * [ 0.1, 0.2, 0.2]]
+ *
+ * // flattens and then returns list of both values and indices
+ * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L63
+ * @return org.apache.mxnet.NDArray + */ +def topk(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Permutes the dimensions of an array.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * transpose(x) = [[ 1., 3.],
+ * [ 2., 4.]]
+ *
+ * x = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 5., 6.],
+ * [ 7., 8.]]]
+ *
+ * transpose(x) = [[[ 1., 5.],
+ * [ 3., 7.]],
+ *
+ * [[ 2., 6.],
+ * [ 4., 8.]]]
+ *
+ * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
+ * [ 5., 6.]],
+ *
+ * [[ 3., 4.],
+ * [ 7., 8.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L310
+ * @return org.apache.mxnet.NDArray + */ +def transpose(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Permutes the dimensions of an array.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * transpose(x) = [[ 1., 3.],
+ * [ 2., 4.]]
+ *
+ * x = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 5., 6.],
+ * [ 7., 8.]]]
+ *
+ * transpose(x) = [[[ 1., 5.],
+ * [ 3., 7.]],
+ *
+ * [[ 2., 6.],
+ * [ 4., 8.]]]
+ *
+ * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
+ * [ 5., 6.]],
+ *
+ * [[ 3., 4.],
+ * [ 7., 8.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L310
+ * @return org.apache.mxnet.NDArray + */ +def transpose(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return the element-wise truncated value of the input.
+ *
+ * The truncated value of the scalar x is the nearest integer i which is closer to
+ * zero than x is. In short, the fractional part of the signed number x is discarded.
+ *
+ * Example::
+ *
+ * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
+ *
+ * The storage type of ``trunc`` output depends upon the input storage type:
+ *
+ * - trunc(default) = default
+ * - trunc(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
+ * @return org.apache.mxnet.NDArray + */ +def trunc(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return the element-wise truncated value of the input.
+ *
+ * The truncated value of the scalar x is the nearest integer i which is closer to
+ * zero than x is. In short, the fractional part of the signed number x is discarded.
+ *
+ * Example::
+ *
+ * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
+ *
+ * The storage type of ``trunc`` output depends upon the input storage type:
+ *
+ * - trunc(default) = default
+ * - trunc(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
+ * @return org.apache.mxnet.NDArray + */ +def trunc(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @return org.apache.mxnet.NDArray + */ +def uniform(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @return org.apache.mxnet.NDArray + */ +def uniform(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
+ *
+ * Examples::
+ *
+ * A = [22,41,37]
+ * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L65
+ * @return org.apache.mxnet.NDArray + */ +def unravel_index(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
+ *
+ * Examples::
+ *
+ * A = [22,41,37]
+ * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L65
+ * @return org.apache.mxnet.NDArray + */ +def unravel_index(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return the elements, either from x or y, depending on the condition.
+ *
+ * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
+ * depending on the elements from condition are true or false. x and y must have the same shape.
+ * If condition has the same shape as x, each element in the output array is from x if the
+ * corresponding element in the condition is true, and from y if false.
+ *
+ * If condition does not have the same shape as x, it must be a 1D array whose size is
+ * the same as x's first dimension size. Each row of the output array is from x's row
+ * if the corresponding element from condition is true, and from y's row if false.
+ *
+ * Note that all non-zero values are interpreted as ``True`` in condition.
+ *
+ * Examples::
+ *
+ * x = [[1, 2], [3, 4]]
+ * y = [[5, 6], [7, 8]]
+ * cond = [[0, 1], [-1, 0]]
+ *
+ * where(cond, x, y) = [[5, 2], [3, 8]]
+ *
+ * csr_cond = cast_storage(cond, 'csr')
+ *
+ * where(csr_cond, x, y) = [[5, 2], [3, 8]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/control_flow_op.cc:L57
+ * @return org.apache.mxnet.NDArray + */ +def where(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return the elements, either from x or y, depending on the condition.
+ *
+ * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
+ * depending on the elements from condition are true or false. x and y must have the same shape.
+ * If condition has the same shape as x, each element in the output array is from x if the
+ * corresponding element in the condition is true, and from y if false.
+ *
+ * If condition does not have the same shape as x, it must be a 1D array whose size is
+ * the same as x's first dimension size. Each row of the output array is from x's row
+ * if the corresponding element from condition is true, and from y's row if false.
+ *
+ * Note that all non-zero values are interpreted as ``True`` in condition.
+ *
+ * Examples::
+ *
+ * x = [[1, 2], [3, 4]]
+ * y = [[5, 6], [7, 8]]
+ * cond = [[0, 1], [-1, 0]]
+ *
+ * where(cond, x, y) = [[5, 2], [3, 8]]
+ *
+ * csr_cond = cast_storage(cond, 'csr')
+ *
+ * where(csr_cond, x, y) = [[5, 2], [3, 8]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/control_flow_op.cc:L57
+ * @return org.apache.mxnet.NDArray + */ +def where(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return an array of zeros with the same shape, type and storage type
+ * as the input array.
+ *
+ * The storage type of ``zeros_like`` output depends on the storage type of the input
+ *
+ * - zeros_like(row_sparse) = row_sparse
+ * - zeros_like(csr) = csr
+ * - zeros_like(default) = default
+ *
+ * Examples::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * zeros_like(x) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ * @return org.apache.mxnet.NDArray + */ +def zeros_like(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn + /** + * Return an array of zeros with the same shape, type and storage type
+ * as the input array.
+ *
+ * The storage type of ``zeros_like`` output depends on the storage type of the input
+ *
+ * - zeros_like(row_sparse) = row_sparse
+ * - zeros_like(csr) = csr
+ * - zeros_like(default) = default
+ *
+ * Examples::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * zeros_like(x) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ * @return org.apache.mxnet.NDArray + */ +def zeros_like(args: Any*) : org.apache.mxnet.NDArrayFuncReturn +} \ No newline at end of file diff --git a/scala-package/core/src/main/scala/org/apache/mxnet/SymbolAPIBase.scala b/scala-package/core/src/main/scala/org/apache/mxnet/SymbolAPIBase.scala new file mode 100644 index 000000000000..8791b444790a --- /dev/null +++ b/scala-package/core/src/main/scala/org/apache/mxnet/SymbolAPIBase.scala @@ -0,0 +1,6859 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// scalastyle:off +package org.apache.mxnet +import org.apache.mxnet.annotation.Experimental +abstract class SymbolAPIBase { + /** + * Applies an activation function element-wise to the input.
+ *
+ * The following activation functions are supported:
+ *
+ * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
+ * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
+ * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
+ * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
+ * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
+ *
+ *
+ *
+ * Defined in src/operator/nn/activation.cc:L161
+ * @param data The input array. + * @param act_type Activation function to be applied. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Activation (data : Option[org.apache.mxnet.Symbol] = None, act_type : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Batch normalization.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
+ * two outputs are blocked.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
+ * axis to be the last item in the input shape.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/nn/batch_norm.cc:L575
+ * @param data Input data to batch normalization + * @param gamma gamma array + * @param beta beta array + * @param moving_mean running mean of input + * @param moving_var running variance of input + * @param eps Epsilon to prevent div 0. Must be no less than CUDNN_BN_MIN_EPSILON defined in cudnn.h when using cudnn (usually 1e-5) + * @param momentum Momentum for moving average + * @param fix_gamma Fix gamma while training + * @param use_global_stats Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator. + * @param output_mean_var Output the mean and inverse std + * @param axis Specify which shape axis the channel is specified + * @param cudnn_off Do not select CUDNN operator, if available + * @return org.apache.mxnet.Symbol + */ +@Experimental +def BatchNorm (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, beta : Option[org.apache.mxnet.Symbol] = None, moving_mean : Option[org.apache.mxnet.Symbol] = None, moving_var : Option[org.apache.mxnet.Symbol] = None, eps : Option[Double] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, fix_gamma : Option[Boolean] = None, use_global_stats : Option[Boolean] = None, output_mean_var : Option[Boolean] = None, axis : Option[Int] = None, cudnn_off : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Batch normalization.
+ *
+ * This operator is DEPRECATED. Perform BatchNorm on the input.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_var`` as well, which are needed for the backward pass.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/batch_norm_v1.cc:L92
+ * @param data Input data to batch normalization + * @param gamma gamma array + * @param beta beta array + * @param eps Epsilon to prevent div 0 + * @param momentum Momentum for moving average + * @param fix_gamma Fix gamma while training + * @param use_global_stats Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator. + * @param output_mean_var Output All,normal mean and var + * @return org.apache.mxnet.Symbol + */ +@Experimental +def BatchNorm_v1 (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, beta : Option[org.apache.mxnet.Symbol] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, fix_gamma : Option[Boolean] = None, use_global_stats : Option[Boolean] = None, output_mean_var : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies bilinear sampling to input feature map.
+ *
+ * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
+ * except that the operator has the backward pass.
+ *
+ * Given :math:`data` and :math:`grid`, then the output is computed by
+ *
+ * .. math::
+ * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
+ * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
+ * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
+ *
+ * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
+ * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
+ *
+ * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
+ *
+ * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
+ * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
+ * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
+ *
+ * Example 1::
+ *
+ * ## Zoom out data two times
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * affine_matrix = array([[2, 0, 0],
+ * [0, 2, 0]])
+ *
+ * affine_matrix = reshape(affine_matrix, shape=(1, 6))
+ *
+ * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
+ *
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 0, 0, 0, 0],
+ * [ 0, 3.5, 6.5, 0],
+ * [ 0, 1.25, 2.5, 0],
+ * [ 0, 0, 0, 0]]]
+ *
+ *
+ * Example 2::
+ *
+ * ## shift data horizontally by -1 pixel
+ *
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * warp_maxtrix = array([[[[1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1]],
+ * [[0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0]]]])
+ *
+ * grid = GridGenerator(data=warp_matrix, transform_type='warp')
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 4, 3, 6, 0],
+ * [ 8, 8, 9, 0],
+ * [ 4, 1, 5, 0],
+ * [ 0, 1, 3, 0]]]
+ *
+ *
+ * Defined in src/operator/bilinear_sampler.cc:L245
+ * @param data Input data to the BilinearsamplerOp. + * @param grid Input grid to the BilinearsamplerOp.grid has two channels: x_src, y_src + * @return org.apache.mxnet.Symbol + */ +@Experimental +def BilinearSampler (data : Option[org.apache.mxnet.Symbol] = None, grid : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def BlockGrad (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @param data The input. + * @param dtype Output data type. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Cast (data : Option[org.apache.mxnet.Symbol] = None, dtype : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @param data List of arrays to concatenate + * @param num_args Number of inputs to be concated. + * @param dim the dimension to be concated. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Concat (data : Array[org.apache.mxnet.Symbol], num_args : Int, dim : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Compute *N*-D convolution on *(N+2)*-D input.
+ *
+ * In the 2-D convolution, given input data with shape *(batch_size,
+ * channel, height, width)*, the output is computed by
+ *
+ * .. math::
+ *
+ * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
+ * weight[i,j,:,:]
+ *
+ * where :math:`\star` is the 2-D cross-correlation operator.
+ *
+ * For general 2-D convolution, the shapes are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*.
+ *
+ * Define::
+ *
+ * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
+ *
+ * then we have::
+ *
+ * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
+ * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
+ * width)*. We can choose other layouts such as *NHWC*.
+ *
+ * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
+ * evenly into *g* parts along the channel axis, and also evenly split ``weight``
+ * along the first dimension. Next compute the convolution on the *i*-th part of
+ * the data with the *i*-th weight part. The output is obtained by concatenating all
+ * the *g* results.
+ *
+ * 1-D convolution does not have *height* dimension but only *width* in space.
+ *
+ * - **data**: *(batch_size, channel, width)*
+ * - **weight**: *(num_filter, channel, kernel[0])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * 3-D convolution adds an additional *depth* dimension besides *height* and
+ * *width*. The shapes are
+ *
+ * - **data**: *(batch_size, channel, depth, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
+ *
+ * Both ``weight`` and ``bias`` are learnable parameters.
+ *
+ * There are other options to tune the performance.
+ *
+ * - **cudnn_tune**: enable this option leads to higher startup time but may give
+ * faster speed. Options are
+ *
+ * - **off**: no tuning
+ * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
+ * exceed workspace limit.
+ * - **fastest**: pick the fastest algorithm and ignore workspace limit.
+ * - **None** (default): the behavior is determined by environment variable
+ * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
+ * (default), 2 for fastest.
+ *
+ * - **workspace**: A large number leads to more (GPU) memory usage but may improve
+ * the performance.
+ *
+ *
+ *
+ * Defined in src/operator/nn/convolution.cc:L470
+ * @param data Input data to the ConvolutionOp. + * @param weight Weight matrix. + * @param bias Bias parameter. + * @param kernel Convolution kernel size: (w,), (h, w) or (d, h, w) + * @param stride Convolution stride: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. + * @param dilate Convolution dilate: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. + * @param pad Zero pad for convolution: (w,), (h, w) or (d, h, w). Defaults to no padding. + * @param num_filter Convolution filter(channel) number + * @param num_group Number of group partitions. + * @param workspace Maximum temporary workspace allowed (MB) in convolution.This parameter has two usages. When CUDNN is not used, it determines the effective batch size of the convolution kernel. When CUDNN is used, it controls the maximum temporary storage used for tuning the best CUDNN kernel when `limited_workspace` strategy is used. + * @param no_bias Whether to disable bias parameter. + * @param cudnn_tune Whether to pick convolution algo by running performance test. + * @param cudnn_off Turn off cudnn for this layer. + * @param layout Set layout for input, output and weight. Empty for + default layout: NCW for 1d, NCHW for 2d and NCDHW for 3d. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Convolution (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, bias : Option[org.apache.mxnet.Symbol] = None, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * This operator is DEPRECATED. Apply convolution to input then add a bias.
+ * @param data Input data to the ConvolutionV1Op. + * @param weight Weight matrix. + * @param bias Bias parameter. + * @param kernel convolution kernel size: (h, w) or (d, h, w) + * @param stride convolution stride: (h, w) or (d, h, w) + * @param dilate convolution dilate: (h, w) or (d, h, w) + * @param pad pad for convolution: (h, w) or (d, h, w) + * @param num_filter convolution filter(channel) number + * @param num_group Number of group partitions. Equivalent to slicing input into num_group + partitions, apply convolution on each, then concatenate the results + * @param workspace Maximum temporary workspace allowed for convolution (MB).This parameter determines the effective batch size of the convolution kernel, which may be smaller than the given batch size. Also, the workspace will be automatically enlarged to make sure that we can run the kernel with batch_size=1 + * @param no_bias Whether to disable bias parameter. + * @param cudnn_tune Whether to pick convolution algo by running performance test. + Leads to higher startup time but may give faster speed. Options are: + 'off': no tuning + 'limited_workspace': run test and pick the fastest algorithm that doesn't exceed workspace limit. + 'fastest': pick the fastest algorithm and ignore workspace limit. + If set to None (default), behavior is determined by environment + variable MXNET_CUDNN_AUTOTUNE_DEFAULT: 0 for off, + 1 for limited workspace (default), 2 for fastest. + * @param cudnn_off Turn off cudnn for this layer. + * @param layout Set layout for input, output and weight. Empty for + default layout: NCHW for 2d and NCDHW for 3d. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Convolution_v1 (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, bias : Option[org.apache.mxnet.Symbol] = None, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies correlation to inputs.
+ *
+ * The correlation layer performs multiplicative patch comparisons between two feature maps.
+ *
+ * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
+ * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
+ *
+ * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
+ * :math:`x_{2}` in the second map is then defined as:
+ *
+ * .. math::
+ *
+ * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
+ *
+ * for a square patch of size :math:`K:=2k+1`.
+ *
+ * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
+ * data. For this reason, it has no training weights.
+ *
+ * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
+ *
+ * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
+ * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
+ * centered around :math:`x_{1}`.
+ *
+ * The final output is defined by the following expression:
+ *
+ * .. math::
+ * out[n, q, i, j] = c(x_{i, j}, x_{q})
+ *
+ * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
+ *
+ *
+ * Defined in src/operator/correlation.cc:L198
+ * @param data1 Input data1 to the correlation. + * @param data2 Input data2 to the correlation. + * @param kernel_size kernel size for Correlation must be an odd number + * @param max_displacement Max displacement of Correlation + * @param stride1 stride1 quantize data1 globally + * @param stride2 stride2 quantize data2 within the neighborhood centered around data1 + * @param pad_size pad for Correlation + * @param is_multiply operation type is either multiplication or subduction + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Correlation (data1 : Option[org.apache.mxnet.Symbol] = None, data2 : Option[org.apache.mxnet.Symbol] = None, kernel_size : Option[Int] = None, max_displacement : Option[Int] = None, stride1 : Option[Int] = None, stride2 : Option[Int] = None, pad_size : Option[Int] = None, is_multiply : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + *
+ *
+ * .. note:: `Crop` is deprecated. Use `slice` instead.
+ *
+ * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
+ * with width and height of the second input symbol, i.e., with one input, we need h_w to
+ * specify the crop height and width, otherwise the second input symbol's size will be used
+ *
+ *
+ * Defined in src/operator/crop.cc:L50
+ * @param data Tensor or List of Tensors, the second input will be used as crop_like shape reference + * @param num_args Number of inputs for crop, if equals one, then we will use the h_wfor crop height and width, else if equals two, then we will use the heightand width of the second input symbol, we name crop_like here + * @param offset crop offset coordinate: (y, x) + * @param h_w crop height and width: (h, w) + * @param center_crop If set to true, then it will use be the center_crop,or it will crop using the shape of crop_like + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Crop (data : Array[org.apache.mxnet.Symbol], num_args : Int, offset : Option[org.apache.mxnet.Shape] = None, h_w : Option[org.apache.mxnet.Shape] = None, center_crop : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Apply a custom operator implemented in a frontend language (like Python).
+ *
+ * Custom operators should override required methods like `forward` and `backward`.
+ * The custom operator must be registered before it can be used.
+ * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
+ *
+ *
+ *
+ * Defined in src/operator/custom/custom.cc:L547
+ * @param data Input data for the custom operator. + * @param op_type Name of the custom operator. This is the name that is passed to `mx.operator.register` to register the operator. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Custom (data : Array[org.apache.mxnet.Symbol], op_type : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
+ * @param data Input tensor to the deconvolution operation. + * @param weight Weights representing the kernel. + * @param bias Bias added to the result after the deconvolution operation. + * @param kernel Deconvolution kernel size: (w,), (h, w) or (d, h, w). This is same as the kernel size used for the corresponding convolution + * @param stride The stride used for the corresponding convolution: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. + * @param dilate Dilation factor for each dimension of the input: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. + * @param pad The amount of implicit zero padding added during convolution for each dimension of the input: (w,), (h, w) or (d, h, w). ``(kernel-1)/2`` is usually a good choice. If `target_shape` is set, `pad` will be ignored and a padding that will generate the target shape will be used. Defaults to no padding. + * @param adj Adjustment for output shape: (w,), (h, w) or (d, h, w). If `target_shape` is set, `adj` will be ignored and computed accordingly. + * @param target_shape Shape of the output tensor: (w,), (h, w) or (d, h, w). + * @param num_filter Number of output filters. + * @param num_group Number of groups partition. + * @param workspace Maximum temporary workspace allowed (MB) in deconvolution.This parameter has two usages. When CUDNN is not used, it determines the effective batch size of the deconvolution kernel. When CUDNN is used, it controls the maximum temporary storage used for tuning the best CUDNN kernel when `limited_workspace` strategy is used. + * @param no_bias Whether to disable bias parameter. + * @param cudnn_tune Whether to pick convolution algorithm by running performance test. + * @param cudnn_off Turn off cudnn for this layer. + * @param layout Set layout for input, output and weight. Empty for default layout, NCW for 1d, NCHW for 2d and NCDHW for 3d. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Deconvolution (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, bias : Option[org.apache.mxnet.Symbol] = None, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, adj : Option[org.apache.mxnet.Shape] = None, target_shape : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies dropout operation to input array.
+ *
+ * - During training, each element of the input is set to zero with probability p.
+ * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
+ * sum of the input unchanged.
+ *
+ * - During testing, this operator does not change the input if mode is 'training'.
+ * If mode is 'always', the same computaion as during training will be applied.
+ *
+ * Example::
+ *
+ * random.seed(998)
+ * input_array = array([[3., 0.5, -0.5, 2., 7.],
+ * [2., -0.4, 7., 3., 0.2]])
+ * a = symbol.Variable('a')
+ * dropout = symbol.Dropout(a, p = 0.2)
+ * executor = dropout.simple_bind(a = input_array.shape)
+ *
+ * ## If training
+ * executor.forward(is_train = True, a = input_array)
+ * executor.outputs
+ * [[ 3.75 0.625 -0. 2.5 8.75 ]
+ * [ 2.5 -0.5 8.75 3.75 0. ]]
+ *
+ * ## If testing
+ * executor.forward(is_train = False, a = input_array)
+ * executor.outputs
+ * [[ 3. 0.5 -0.5 2. 7. ]
+ * [ 2. -0.4 7. 3. 0.2 ]]
+ *
+ *
+ * Defined in src/operator/nn/dropout.cc:L76
+ * @param data Input array to which dropout will be applied. + * @param p Fraction of the input that gets dropped out during training time. + * @param mode Whether to only turn on dropout during training or to also turn on for inference. + * @param axes Axes for variational dropout kernel. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Dropout (data : Option[org.apache.mxnet.Symbol] = None, p : Option[org.apache.mxnet.Base.MXFloat] = None, mode : Option[String] = None, axes : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @param args Positional input arguments + * @return org.apache.mxnet.Symbol + */ +@Experimental +def ElementWiseSum (args : Array[org.apache.mxnet.Symbol], name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Maps integer indices to vector representations (embeddings).
+ *
+ * This operator maps words to real-valued vectors in a high-dimensional space,
+ * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
+ * For example, it has been noted that in the learned embedding spaces, similar words tend
+ * to be close to each other and dissimilar words far apart.
+ *
+ * For an input array of shape (d1, ..., dK),
+ * the shape of an output array is (d1, ..., dK, output_dim).
+ * All the input values should be integers in the range [0, input_dim).
+ *
+ * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
+ * (ip0, op0).
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last vector in an embedding matrix.
+ *
+ * Examples::
+ *
+ * input_dim = 4
+ * output_dim = 5
+ *
+ * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
+ * y = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.],
+ * [ 10., 11., 12., 13., 14.],
+ * [ 15., 16., 17., 18., 19.]]
+ *
+ * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
+ * x = [[ 1., 3.],
+ * [ 0., 2.]]
+ *
+ * // Mapped input x to its vector representation y.
+ * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
+ * [ 15., 16., 17., 18., 19.]],
+ *
+ * [[ 0., 1., 2., 3., 4.],
+ * [ 10., 11., 12., 13., 14.]]]
+ *
+ *
+ * The storage type of weight can be either row_sparse or default, while
+ * the storage type of weight's grad depends on the value of "sparse_grad".
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L232
+ * @param data The input array to the embedding operator. + * @param weight The embedding weight matrix. + * @param input_dim Vocabulary size of the input indices. + * @param output_dim Dimension of the embedding vectors. + * @param dtype Data type of weight. + * @param sparse_grad Compute row sparse gradient in the backward calculation. If set to True, the grad's storage type is row_sparse. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Embedding (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, input_dim : Int, output_dim : Int, dtype : Option[String] = None, sparse_grad : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @param data Input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Flatten (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies a linear transformation: :math:`Y = XW^T + b`.
+ *
+ * If ``flatten`` is set to be true, then the shapes are:
+ *
+ * - **data**: `(batch_size, x1, x2, ..., xn)`
+ * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(batch_size, num_hidden)`
+ *
+ * If ``flatten`` is set to be false, then the shapes are:
+ *
+ * - **data**: `(x1, x2, ..., xn, input_dim)`
+ * - **weight**: `(num_hidden, input_dim)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(x1, x2, ..., xn, num_hidden)`
+ *
+ * The learnable parameters include both ``weight`` and ``bias``.
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * Note that the operator also supports forward computation with `row_sparse` weight and bias,
+ * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
+ * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
+ *
+ *
+ *
+ * Defined in src/operator/nn/fully_connected.cc:L254
+ * @param data Input data. + * @param weight Weight matrix. + * @param bias Bias parameter. + * @param num_hidden Number of hidden nodes of the output. + * @param no_bias Whether to disable bias parameter. + * @param flatten Whether to collapse all but the first axis of the input data tensor. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def FullyConnected (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, bias : Option[org.apache.mxnet.Symbol] = None, num_hidden : Int, no_bias : Option[Boolean] = None, flatten : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Generates 2D sampling grid for bilinear sampling.
+ * @param data Input data to the function. + * @param transform_type The type of transformation. For `affine`, input data should be an affine matrix of size (batch, 6). For `warp`, input data should be an optical flow of size (batch, 2, h, w). + * @param target_shape Specifies the output shape (H, W). This is required if transformation type is `affine`. If transformation type is `warp`, this parameter is ignored. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def GridGenerator (data : Option[org.apache.mxnet.Symbol] = None, transform_type : String, target_shape : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Apply a sparse regularization to the output a sigmoid activation function.
+ * @param data Input data. + * @param sparseness_target The sparseness target + * @param penalty The tradeoff parameter for the sparseness penalty + * @param momentum The momentum for running average + * @return org.apache.mxnet.Symbol + */ +@Experimental +def IdentityAttachKLSparseReg (data : Option[org.apache.mxnet.Symbol] = None, sparseness_target : Option[org.apache.mxnet.Base.MXFloat] = None, penalty : Option[org.apache.mxnet.Base.MXFloat] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies instance normalization to the n-dimensional input array.
+ *
+ * This operator takes an n-dimensional input array where (n>2) and normalizes
+ * the input using the following formula:
+ *
+ * .. math::
+ *
+ * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
+ *
+ * This layer is similar to batch normalization layer (`BatchNorm`)
+ * with two differences: first, the normalization is
+ * carried out per example (instance), not over a batch. Second, the
+ * same normalization is applied both at test and train time. This
+ * operation is also known as `contrast normalization`.
+ *
+ * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
+ * `gamma` and `beta` parameters must be vectors of shape [channel].
+ *
+ * This implementation is based on paper:
+ *
+ * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
+ * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
+ *
+ * Examples::
+ *
+ * // Input of shape (2,1,2)
+ * x = [[[ 1.1, 2.2]],
+ * [[ 3.3, 4.4]]]
+ *
+ * // gamma parameter of length 1
+ * gamma = [1.5]
+ *
+ * // beta parameter of length 1
+ * beta = [0.5]
+ *
+ * // Instance normalization is calculated with the above formula
+ * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
+ * [[-0.99752653, 1.99752724]]]
+ *
+ *
+ *
+ * Defined in src/operator/instance_norm.cc:L95
+ * @param data An n-dimensional input array (n > 2) of the form [batch, channel, spatial_dim1, spatial_dim2, ...]. + * @param gamma A vector of length 'channel', which multiplies the normalized input. + * @param beta A vector of length 'channel', which is added to the product of the normalized input and the weight. + * @param eps An `epsilon` parameter to prevent division by 0. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def InstanceNorm (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, beta : Option[org.apache.mxnet.Symbol] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Normalize the input array using the L2 norm.
+ *
+ * For 1-D NDArray, it computes::
+ *
+ * out = data / sqrt(sum(data ** 2) + eps)
+ *
+ * For N-D NDArray, if the input array has shape (N, N, ..., N),
+ *
+ * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
+ * array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
+ * in the array by its L2 norm.::
+ *
+ * for dim in 2...N
+ * for i in 0...N
+ * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
+ * -dim-
+ *
+ * Example::
+ *
+ * x = [[[1,2],
+ * [3,4]],
+ * [[2,2],
+ * [5,6]]]
+ *
+ * L2Normalization(x, mode='instance')
+ * =[[[ 0.18257418 0.36514837]
+ * [ 0.54772252 0.73029673]]
+ * [[ 0.24077171 0.24077171]
+ * [ 0.60192931 0.72231513]]]
+ *
+ * L2Normalization(x, mode='channel')
+ * =[[[ 0.31622776 0.44721359]
+ * [ 0.94868326 0.89442718]]
+ * [[ 0.37139067 0.31622776]
+ * [ 0.92847669 0.94868326]]]
+ *
+ * L2Normalization(x, mode='spatial')
+ * =[[[ 0.44721359 0.89442718]
+ * [ 0.60000002 0.80000001]]
+ * [[ 0.70710677 0.70710677]
+ * [ 0.6401844 0.76822126]]]
+ *
+ *
+ *
+ * Defined in src/operator/l2_normalization.cc:L98
+ * @param data Input array to normalize. + * @param eps A small constant for numerical stability. + * @param mode Specify the dimension along which to compute L2 norm. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def L2Normalization (data : Option[org.apache.mxnet.Symbol] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, mode : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies local response normalization to the input.
+ *
+ * The local response normalization layer performs "lateral inhibition" by normalizing
+ * over local input regions.
+ *
+ * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
+ * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
+ * activity :math:`b_{x,y}^{i}` is given by the expression:
+ *
+ * .. math::
+ * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
+ *
+ * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
+ * number of kernels in the layer.
+ *
+ *
+ *
+ * Defined in src/operator/nn/lrn.cc:L175
+ * @param data Input data to LRN + * @param alpha The variance scaling parameter :math:`lpha` in the LRN expression. + * @param beta The power parameter :math:`eta` in the LRN expression. + * @param knorm The parameter :math:`k` in the LRN expression. + * @param nsize normalization window width in elements. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def LRN (data : Option[org.apache.mxnet.Symbol] = None, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, knorm : Option[org.apache.mxnet.Base.MXFloat] = None, nsize : Int, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Layer normalization.
+ *
+ * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis and then
+ * compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters.
+ *
+ * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_std``. Note that no gradient will be passed through these two outputs.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is -1, which sets the channel
+ * axis to be the last item in the input shape.
+ *
+ *
+ *
+ * Defined in src/operator/nn/layer_norm.cc:L94
+ * @param data Input data to layer normalization + * @param gamma gamma array + * @param beta beta array + * @param axis The axis to perform layer normalization. Usually, this should be be axis of the channel dimension. Negative values means indexing from right to left. + * @param eps An `epsilon` parameter to prevent division by 0. + * @param output_mean_var Output the mean and std calculated along the given axis. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def LayerNorm (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, beta : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, output_mean_var : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies Leaky rectified linear unit activation element-wise to the input.
+ *
+ * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
+ * when the input is negative and has a slope of one when input is positive.
+ *
+ * The following modified ReLU Activation functions are supported:
+ *
+ * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
+ * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
+ * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
+ * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
+ * *[lower_bound, upper_bound)* for training, while fixed to be
+ * *(lower_bound+upper_bound)/2* for inference.
+ *
+ *
+ *
+ * Defined in src/operator/leaky_relu.cc:L63
+ * @param data Input data to activation function. + * @param gamma Slope parameter for PReLU. Only required when act_type is 'prelu'. It should be either a vector of size 1, or the same size as the second dimension of data. + * @param act_type Activation function to be applied. + * @param slope Init slope for the activation. (For leaky and elu only) + * @param lower_bound Lower bound of random slope. (For rrelu only) + * @param upper_bound Upper bound of random slope. (For rrelu only) + * @return org.apache.mxnet.Symbol + */ +@Experimental +def LeakyReLU (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, act_type : Option[String] = None, slope : Option[org.apache.mxnet.Base.MXFloat] = None, lower_bound : Option[org.apache.mxnet.Base.MXFloat] = None, upper_bound : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes and optimizes for squared loss during backward propagation.
+ * Just outputs ``data`` during forward propagation.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the squared loss estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
+ *
+ * .. note::
+ * Use the LinearRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LinearRegressionOutput(default, default) = default
+ * - LinearRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L92
+ * @param data Input data to the function. + * @param label Input label to the function. + * @param grad_scale Scale the gradient by a float factor + * @return org.apache.mxnet.Symbol + */ +@Experimental +def LinearRegressionOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies a logistic function to the input.
+ *
+ * The logistic function, also known as the sigmoid function, is computed as
+ * :math:`\frac{1}{1+exp(-\textbf{x})}`.
+ *
+ * Commonly, the sigmoid is used to squash the real-valued output of a linear model
+ * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
+ * It is suitable for binary classification or probability prediction tasks.
+ *
+ * .. note::
+ * Use the LogisticRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LogisticRegressionOutput(default, default) = default
+ * - LogisticRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L148
+ * @param data Input data to the function. + * @param label Input label to the function. + * @param grad_scale Scale the gradient by a float factor + * @return org.apache.mxnet.Symbol + */ +@Experimental +def LogisticRegressionOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes mean absolute error of the input.
+ *
+ * MAE is a risk metric corresponding to the expected value of the absolute error.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
+ *
+ * .. note::
+ * Use the MAERegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - MAERegressionOutput(default, default) = default
+ * - MAERegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L120
+ * @param data Input data to the function. + * @param label Input label to the function. + * @param grad_scale Scale the gradient by a float factor + * @return org.apache.mxnet.Symbol + */ +@Experimental +def MAERegressionOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = MakeLoss(cross_entropy)
+ *
+ * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * In addition, we can give a scale to the loss by setting ``grad_scale``,
+ * so that the gradient of the loss will be rescaled in the backpropagation.
+ *
+ * .. note:: This operator should be used as a Symbol instead of NDArray.
+ *
+ *
+ *
+ * Defined in src/operator/make_loss.cc:L71
+ * @param data Input array. + * @param grad_scale Gradient scale as a supplement to unary and binary operators + * @param valid_thresh clip each element in the array to 0 when it is less than ``valid_thresh``. This is used when ``normalization`` is set to ``'valid'``. + * @param normalization If this is set to null, the output gradient will not be normalized. If this is set to batch, the output gradient will be divided by the batch size. If this is set to valid, the output gradient will be divided by the number of valid input elements. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def MakeLoss (data : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, valid_thresh : Option[org.apache.mxnet.Base.MXFloat] = None, normalization : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @param data An n-dimensional input array. + * @param mode Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges. + * @param pad_width Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ... , before_N, after_N)``. It should be of length ``2*N`` where ``N`` is the number of dimensions of the array.This is equivalent to pad_width in numpy.pad, but flattened. + * @param constant_value The value used for padding when `mode` is "constant". + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Pad (data : Option[org.apache.mxnet.Symbol] = None, mode : String, pad_width : org.apache.mxnet.Shape, constant_value : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Performs pooling on the input.
+ *
+ * The shapes for 1-D pooling are
+ *
+ * - **data**: *(batch_size, channel, width)*,
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * The shapes for 2-D pooling are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ * - **lp**: Lp pooling
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ * Notes on Lp pooling:
+ *
+ * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
+ * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
+ * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
+ *
+ * For each window ``X``, the mathematical expression for Lp pooling is:
+ *
+ * ..math::
+ * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
+ *
+ *
+ *
+ * Defined in src/operator/nn/pooling.cc:L367
+ * @param data Input data to the pooling operator. + * @param kernel Pooling kernel size: (y, x) or (d, y, x) + * @param pool_type Pooling type to be applied. + * @param global_pool Ignore kernel size, do global pooling based on current input feature map. + * @param cudnn_off Turn off cudnn pooling and use MXNet pooling operator. + * @param pooling_convention Pooling convention to be applied. + * @param stride Stride: for pooling (y, x) or (d, y, x). Defaults to 1 for each dimension. + * @param pad Pad for pooling: (y, x) or (d, y, x). Defaults to no padding. + * @param p_value Value of p for Lp pooling, can be 1 or 2, required for Lp Pooling. + * @param count_include_pad Only used for AvgPool, specify whether to count padding elements for averagecalculation. For example, with a 5*5 kernel on a 3*3 corner of a image,the sum of the 9 valid elements will be divided by 25 if this is set to true,or it will be divided by 9 if this is set to false. Defaults to true. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Pooling (data : Option[org.apache.mxnet.Symbol] = None, kernel : Option[org.apache.mxnet.Shape] = None, pool_type : Option[String] = None, global_pool : Option[Boolean] = None, cudnn_off : Option[Boolean] = None, pooling_convention : Option[String] = None, stride : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, p_value : Option[Int] = None, count_include_pad : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * This operator is DEPRECATED.
+ * Perform pooling on the input.
+ *
+ * The shapes for 2-D pooling is
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ *
+ * 1-D pooling is special case of 2-D pooling with *weight=1* and
+ * *kernel[1]=1*.
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ *
+ *
+ * Defined in src/operator/pooling_v1.cc:L104
+ * @param data Input data to the pooling operator. + * @param kernel pooling kernel size: (y, x) or (d, y, x) + * @param pool_type Pooling type to be applied. + * @param global_pool Ignore kernel size, do global pooling based on current input feature map. + * @param pooling_convention Pooling convention to be applied. + * @param stride stride: for pooling (y, x) or (d, y, x) + * @param pad pad for pooling: (y, x) or (d, y, x) + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Pooling_v1 (data : Option[org.apache.mxnet.Symbol] = None, kernel : Option[org.apache.mxnet.Shape] = None, pool_type : Option[String] = None, global_pool : Option[Boolean] = None, pooling_convention : Option[String] = None, stride : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
+ * implemented, with both multi-layer and bidirectional support.
+ *
+ * **Vanilla RNN**
+ *
+ * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
+ * ReLU and Tanh.
+ *
+ * With ReLU activation function:
+ *
+ * .. math::
+ * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * With Tanh activtion function:
+ *
+ * .. math::
+ * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * Reference paper: Finding structure in time - Elman, 1988.
+ * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
+ *
+ * **LSTM**
+ *
+ * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
+ * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
+ * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
+ * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
+ * c_t = f_t * c_{(t-1)} + i_t * g_t \\
+ * h_t = o_t * \tanh(c_t)
+ * \end{array}
+ *
+ * **GRU**
+ *
+ * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
+ *
+ * The definition of GRU here is slightly different from paper but compatible with CUDNN.
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
+ * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
+ * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
+ * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
+ * \end{array}
+ * @param data Input data to RNN + * @param parameters Vector of all RNN trainable parameters concatenated + * @param state initial hidden state of the RNN + * @param state_cell initial cell state for LSTM networks (only for LSTM) + * @param state_size size of the state for each layer + * @param num_layers number of stacked layers + * @param bidirectional whether to use bidirectional recurrent layers + * @param mode the type of RNN to compute + * @param p Dropout probability, fraction of the input that gets dropped out at training time + * @param state_outputs Whether to have the states as symbol outputs. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def RNN (data : Option[org.apache.mxnet.Symbol] = None, parameters : Option[org.apache.mxnet.Symbol] = None, state : Option[org.apache.mxnet.Symbol] = None, state_cell : Option[org.apache.mxnet.Symbol] = None, state_size : Int, num_layers : Int, bidirectional : Option[Boolean] = None, mode : String, p : Option[org.apache.mxnet.Base.MXFloat] = None, state_outputs : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Performs region of interest(ROI) pooling on the input array.
+ *
+ * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
+ * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
+ * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
+ * layer mostly used in training a `Fast R-CNN` network for object detection.
+ *
+ * This operator takes a 4D feature map as an input array and region proposals as `rois`,
+ * then it pools over sub-regions of input and produces a fixed-sized output array
+ * regardless of the ROI size.
+ *
+ * To crop the feature map accordingly, you can resize the bounding box coordinates
+ * by changing the parameters `rois` and `spatial_scale`.
+ *
+ * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
+ * indicated by a `pooled_size` parameter. batch_size will change to the number of region
+ * bounding boxes after `ROIPooling`.
+ *
+ * The size of each region of interest doesn't have to be perfectly divisible by
+ * the number of pooling sections(`pooled_size`).
+ *
+ * Example::
+ *
+ * x = [[[[ 0., 1., 2., 3., 4., 5.],
+ * [ 6., 7., 8., 9., 10., 11.],
+ * [ 12., 13., 14., 15., 16., 17.],
+ * [ 18., 19., 20., 21., 22., 23.],
+ * [ 24., 25., 26., 27., 28., 29.],
+ * [ 30., 31., 32., 33., 34., 35.],
+ * [ 36., 37., 38., 39., 40., 41.],
+ * [ 42., 43., 44., 45., 46., 47.]]]]
+ *
+ * // region of interest i.e. bounding box coordinates.
+ * y = [[0,0,0,4,4]]
+ *
+ * // returns array of shape (2,2) according to the given roi with max pooling.
+ * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
+ * [ 26., 28.]]]]
+ *
+ * // region of interest is changed due to the change in `spacial_scale` parameter.
+ * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
+ * [ 19., 21.]]]]
+ *
+ *
+ *
+ * Defined in src/operator/roi_pooling.cc:L295
+ * @param data The input array to the pooling operator, a 4D Feature maps + * @param rois Bounding box coordinates, a 2D array of [[batch_index, x1, y1, x2, y2]], where (x1, y1) and (x2, y2) are top left and bottom right corners of designated region of interest. `batch_index` indicates the index of corresponding image in the input array + * @param pooled_size ROI pooling output shape (h,w) + * @param spatial_scale Ratio of input feature map height (or w) to raw image height (or w). Equals the reciprocal of total stride in convolutional layers + * @return org.apache.mxnet.Symbol + */ +@Experimental +def ROIPooling (data : Option[org.apache.mxnet.Symbol] = None, rois : Option[org.apache.mxnet.Symbol] = None, pooled_size : org.apache.mxnet.Shape, spatial_scale : org.apache.mxnet.Base.MXFloat, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @param data Input data to reshape. + * @param shape The target shape + * @param reverse If true then the special values are inferred from right to left + * @param target_shape (Deprecated! Use ``shape`` instead.) Target new shape. One and only one dim can be 0, in which case it will be inferred from the rest of dims + * @param keep_highest (Deprecated! Use ``shape`` instead.) Whether keep the highest dim unchanged.If set to true, then the first dim in target_shape is ignored,and always fixed as input + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Reshape (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, reverse : Option[Boolean] = None, target_shape : Option[org.apache.mxnet.Shape] = None, keep_highest : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes support vector machine based transformation of the input.
+ *
+ * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
+ * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
+ * @param data Input data for SVM transformation. + * @param label Class label for the input data. + * @param margin The loss function penalizes outputs that lie outside this margin. Default margin is 1. + * @param regularization_coefficient Regularization parameter for the SVM. This balances the tradeoff between coefficient size and error. + * @param use_linear Whether to use L1-SVM objective. L2-SVM objective is used by default. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def SVMOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, margin : Option[org.apache.mxnet.Base.MXFloat] = None, regularization_coefficient : Option[org.apache.mxnet.Base.MXFloat] = None, use_linear : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Takes the last element of a sequence.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
+ * of the form [batch_size, other_feature_dims].
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
+ * an input array of positive ints of dimension [batch_size]. To use this parameter,
+ * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
+ * to have the max sequence length.
+ *
+ * .. note:: Alternatively, you can also use `take` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]],
+ *
+ * [[ 10., 11., 12.],
+ * [ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]]
+ *
+ * // returns last sequence when sequence_length parameter is not used
+ * SequenceLast(x) = [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 13., 14., 15.],
+ * [ 25., 26., 27.]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_last.cc:L92
+ * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2 + * @param sequence_length vector of sequence lengths of the form [batch_size] + * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence + * @param axis The sequence axis. Only values of 0 and 1 are currently supported. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def SequenceLast (data : Option[org.apache.mxnet.Symbol] = None, sequence_length : Option[org.apache.mxnet.Symbol] = None, use_sequence_length : Option[Boolean] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Sets all elements outside the sequence to a constant value.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
+ * should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length and
+ * this operator works as the `identity` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // works as identity operator when sequence_length parameter is not used
+ * SequenceMask(x) = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [1,1] means 1 of each batch will be kept
+ * // and other rows are masked with default mask value = 0
+ * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
+ * // and other rows are masked with value = 1
+ * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 1., 1.],
+ * [ 16., 17., 18.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_mask.cc:L114
+ * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2 + * @param sequence_length vector of sequence lengths of the form [batch_size] + * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence + * @param value The value to be used as a mask. + * @param axis The sequence axis. Only values of 0 and 1 are currently supported. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def SequenceMask (data : Option[org.apache.mxnet.Symbol] = None, sequence_length : Option[org.apache.mxnet.Symbol] = None, use_sequence_length : Option[Boolean] = None, value : Option[org.apache.mxnet.Base.MXFloat] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Reverses the elements of each sequence.
+ *
+ * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
+ * and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences.
+ * `sequence_length` should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // returns reverse sequence when sequence_length parameter is not used
+ * SequenceReverse(x) = [[[ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]]]
+ *
+ * // sequence_length [2,2] means 2 rows of
+ * // both batch B1 and B2 will be reversed.
+ * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
+ * // will be reversed.
+ * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14, 15.],
+ * [ 4., 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_reverse.cc:L113
+ * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other dims] where n>2 + * @param sequence_length vector of sequence lengths of the form [batch_size] + * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence + * @param axis The sequence axis. Only 0 is currently supported. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def SequenceReverse (data : Option[org.apache.mxnet.Symbol] = None, sequence_length : Option[org.apache.mxnet.Symbol] = None, use_sequence_length : Option[Boolean] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @param data The input + * @param num_outputs Number of splits. Note that this should evenly divide the length of the `axis`. + * @param axis Axis along which to split. + * @param squeeze_axis If true, Removes the axis with length 1 from the shapes of the output arrays. **Note** that setting `squeeze_axis` to ``true`` removes axis with length 1 only along the `axis` which it is split. Also `squeeze_axis` can be set to ``true`` only if ``input.shape[axis] == num_outputs``. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def SliceChannel (data : Option[org.apache.mxnet.Symbol] = None, num_outputs : Int, axis : Option[Int] = None, squeeze_axis : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Please use `SoftmaxOutput`.
+ *
+ * .. note::
+ *
+ * This operator has been renamed to `SoftmaxOutput`, which
+ * computes the gradient of cross-entropy loss w.r.t softmax output.
+ * To just compute softmax output, use the `softmax` operator.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L138
+ * @param data Input array. + * @param grad_scale Scales the gradient by a float factor. + * @param ignore_label The instances whose `labels` == `ignore_label` will be ignored during backward, if `use_ignore` is set to ``true``). + * @param multi_output If set to ``true``, the softmax function will be computed along axis ``1``. This is applied when the shape of input array differs from the shape of label array. + * @param use_ignore If set to ``true``, the `ignore_label` value will not contribute to the backward gradient. + * @param preserve_shape If set to ``true``, the softmax function will be computed along the last axis (``-1``). + * @param normalization Normalizes the gradient. + * @param out_grad Multiplies gradient with output gradient element-wise. + * @param smooth_alpha Constant for computing a label smoothed version of cross-entropyfor the backwards pass. This constant gets subtracted from theone-hot encoding of the gold label and distributed uniformly toall other labels. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def Softmax (data : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, ignore_label : Option[org.apache.mxnet.Base.MXFloat] = None, multi_output : Option[Boolean] = None, use_ignore : Option[Boolean] = None, preserve_shape : Option[Boolean] = None, normalization : Option[String] = None, out_grad : Option[Boolean] = None, smooth_alpha : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies softmax activation to input. This is intended for internal layers.
+ *
+ * .. note::
+ *
+ * This operator has been deprecated, please use `softmax`.
+ *
+ * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
+ * This is the default mode.
+ *
+ * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
+ * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
+ * has at least 3 dimensions.
+ * This can be used for `fully convolutional network`, `image segmentation`, etc.
+ *
+ * Example::
+ *
+ * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
+ * >>> [2., -.4, 7., 3., 0.2]])
+ * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
+ * >>> print softmax_act.asnumpy()
+ * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
+ * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax_activation.cc:L59
+ * @param data The input array. + * @param mode Specifies how to compute the softmax. If set to ``instance``, it computes softmax for each instance. If set to ``channel``, It computes cross channel softmax for each position of each instance. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def SoftmaxActivation (data : Option[org.apache.mxnet.Symbol] = None, mode : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the gradient of cross entropy loss with respect to softmax output.
+ *
+ * - This operator computes the gradient in two steps.
+ * The cross entropy loss does not actually need to be computed.
+ *
+ * - Applies softmax function on the input array.
+ * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
+ *
+ * - The softmax function, cross entropy loss and gradient is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * - The gradient of cross entropy loss w.r.t softmax output:
+ *
+ * .. math:: \text{gradient} = \text{output} - \text{label}
+ *
+ * - During forward propagation, the softmax function is computed for each instance in the input array.
+ *
+ * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
+ * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
+ * and `multi_output` to specify the way to compute softmax:
+ *
+ * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
+ * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
+ * each row in the reshaped array, and afterwards reshape it back to the original shape
+ * :math:`(d_1, d_2, ..., d_n)`.
+ * - If `preserve_shape` is ``true``, the softmax function will be computed along
+ * the last axis (`axis` = ``-1``).
+ * - If `multi_output` is ``true``, the softmax function will be computed along
+ * the second axis (`axis` = ``1``).
+ *
+ * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
+ * The provided label can be a one-hot label array or a probability label array.
+ *
+ * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
+ * with a particular label to be ignored during backward propagation. **This has no effect when
+ * softmax `output` has same shape as `label`**.
+ *
+ * Example::
+ *
+ * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
+ * label = [1,0,2,3]
+ * ignore_label = 1
+ * SoftmaxOutput(data=data, label = label,\
+ * multi_output=true, use_ignore=true,\
+ * ignore_label=ignore_label)
+ * ## forward softmax output
+ * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]]
+ * ## backward gradient output
+ * [[ 0. 0. 0. 0. ]
+ * [-0.75 0.25 0.25 0.25]
+ * [ 0.25 0.25 -0.75 0.25]
+ * [ 0.25 0.25 0.25 -0.75]]
+ * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
+ *
+ * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
+ * give each loss function different weights.
+ *
+ * - This operator also supports various ways to normalize the gradient by `normalization`,
+ * The `normalization` is applied if softmax output has different shape than the labels.
+ * The `normalization` mode can be set to the followings:
+ *
+ * - ``'null'``: do nothing.
+ * - ``'batch'``: divide the gradient by the batch size.
+ * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L123
+ * @param data Input array. + * @param label Ground truth label. + * @param grad_scale Scales the gradient by a float factor. + * @param ignore_label The instances whose `labels` == `ignore_label` will be ignored during backward, if `use_ignore` is set to ``true``). + * @param multi_output If set to ``true``, the softmax function will be computed along axis ``1``. This is applied when the shape of input array differs from the shape of label array. + * @param use_ignore If set to ``true``, the `ignore_label` value will not contribute to the backward gradient. + * @param preserve_shape If set to ``true``, the softmax function will be computed along the last axis (``-1``). + * @param normalization Normalizes the gradient. + * @param out_grad Multiplies gradient with output gradient element-wise. + * @param smooth_alpha Constant for computing a label smoothed version of cross-entropyfor the backwards pass. This constant gets subtracted from theone-hot encoding of the gold label and distributed uniformly toall other labels. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def SoftmaxOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, ignore_label : Option[org.apache.mxnet.Base.MXFloat] = None, multi_output : Option[Boolean] = None, use_ignore : Option[Boolean] = None, preserve_shape : Option[Boolean] = None, normalization : Option[String] = None, out_grad : Option[Boolean] = None, smooth_alpha : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies a spatial transformer to input feature map.
+ * @param data Input data to the SpatialTransformerOp. + * @param loc localisation net, the output dim should be 6 when transform_type is affine. You shold initialize the weight and bias with identity tranform. + * @param target_shape output shape(h, w) of spatial transformer: (y, x) + * @param transform_type transformation type + * @param sampler_type sampling type + * @return org.apache.mxnet.Symbol + */ +@Experimental +def SpatialTransformer (data : Option[org.apache.mxnet.Symbol] = None, loc : Option[org.apache.mxnet.Symbol] = None, target_shape : Option[org.apache.mxnet.Shape] = None, transform_type : String, sampler_type : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @param data Input array. + * @param dim1 the first axis to be swapped. + * @param dim2 the second axis to be swapped. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def SwapAxis (data : Option[org.apache.mxnet.Symbol] = None, dim1 : Option[Int] = None, dim2 : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Performs nearest neighbor/bilinear up sampling to inputs.
+ * @param data Array of tensors to upsample + * @param scale Up sampling scale + * @param num_filter Input filter. Only used by bilinear sample_type. + * @param sample_type upsampling method + * @param multi_input_mode How to handle multiple input. concat means concatenate upsampled images along the channel dimension. sum means add all images together, only available for nearest neighbor upsampling. + * @param num_args Number of inputs to be upsampled. For nearest neighbor upsampling, this can be 1-N; the size of output will be(scale*h_0,scale*w_0) and all other inputs will be upsampled to thesame size. For bilinear upsampling this must be 2; 1 input and 1 weight. + * @param workspace Tmp workspace for deconvolution (MB) + * @return org.apache.mxnet.Symbol + */ +@Experimental +def UpSampling (data : Array[org.apache.mxnet.Symbol], scale : Int, num_filter : Option[Int] = None, sample_type : String, multi_input_mode : Option[String] = None, num_args : Int, workspace : Option[Long] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise absolute value of the input.
+ *
+ * Example::
+ *
+ * abs([-2, 0, 3]) = [2, 0, 3]
+ *
+ * The storage type of ``abs`` output depends upon the input storage type:
+ *
+ * - abs(default) = default
+ * - abs(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def abs (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Update function for Adam optimizer. Adam is seen as a generalization
+ * of AdaGrad.
+ *
+ * Adam update consists of the following steps, where g represents gradient and m, v
+ * are 1st and 2nd order moment estimates (mean and variance).
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
+ *
+ * It updates the weights using::
+ *
+ * m = beta1*m + (1-beta1)*grad
+ * v = beta2*v + (1-beta2)*(grad**2)
+ * w += - learning_rate * m / (sqrt(v) + epsilon)
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
+ * type of weight is the same as those of m and v,
+ * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
+ *
+ * for row in grad.indices:
+ * m[row] = beta1*m[row] + (1-beta1)*grad[row]
+ * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
+ * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L495
+ * @param weight Weight + * @param grad Gradient + * @param mean Moving mean + * @param vari Moving variance + * @param lr Learning rate + * @param beta1 The decay rate for the 1st moment estimates. + * @param beta2 The decay rate for the 2nd moment estimates. + * @param epsilon A small constant for numerical stability. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and all of w, m and v have the same stype + * @return org.apache.mxnet.Symbol + */ +@Experimental +def adam_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, mean : Option[org.apache.mxnet.Symbol] = None, vari : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, beta1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @param args Positional input arguments + * @return org.apache.mxnet.Symbol + */ +@Experimental +def add_n (args : Array[org.apache.mxnet.Symbol], name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise inverse cosine of the input array.
+ *
+ * The input should be in range `[-1, 1]`.
+ * The output is in the closed interval :math:`[0, \pi]`
+ *
+ * .. math::
+ * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
+ *
+ * The storage type of ``arccos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def arccos (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the element-wise inverse hyperbolic cosine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arccosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def arccosh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise inverse sine of the input array.
+ *
+ * The input should be in the range `[-1, 1]`.
+ * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
+ *
+ * .. math::
+ * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
+ *
+ * The storage type of ``arcsin`` output depends upon the input storage type:
+ *
+ * - arcsin(default) = default
+ * - arcsin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def arcsin (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the element-wise inverse hyperbolic sine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arcsinh`` output depends upon the input storage type:
+ *
+ * - arcsinh(default) = default
+ * - arcsinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def arcsinh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise inverse tangent of the input array.
+ *
+ * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
+ *
+ * .. math::
+ * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
+ *
+ * The storage type of ``arctan`` output depends upon the input storage type:
+ *
+ * - arctan(default) = default
+ * - arctan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def arctan (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the element-wise inverse hyperbolic tangent of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arctanh`` output depends upon the input storage type:
+ *
+ * - arctanh(default) = default
+ * - arctanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def arctanh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns indices of the maximum values along an axis.
+ *
+ * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmax along axis 0
+ * argmax(x, axis=0) = [ 1., 1., 1.]
+ *
+ * // argmax along axis 1
+ * argmax(x, axis=1) = [ 2., 2.]
+ *
+ * // argmax along axis 1 keeping same dims as an input array
+ * argmax(x, axis=1, keepdims=True) = [[ 2.],
+ * [ 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
+ * @param data The input + * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` + * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def argmax (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, keepdims : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns argmax indices of each channel from the input array.
+ *
+ * The result will be an NDArray of shape (num_channel,).
+ *
+ * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * argmax_channel(x) = [ 2., 2.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
+ * @param data The input array + * @return org.apache.mxnet.Symbol + */ +@Experimental +def argmax_channel (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns indices of the minimum values along an axis.
+ *
+ * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmin along axis 0
+ * argmin(x, axis=0) = [ 0., 0., 0.]
+ *
+ * // argmin along axis 1
+ * argmin(x, axis=1) = [ 0., 0.]
+ *
+ * // argmin along axis 1 keeping same dims as an input array
+ * argmin(x, axis=1, keepdims=True) = [[ 0.],
+ * [ 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
+ * @param data The input + * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` + * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def argmin (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, keepdims : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the indices that would sort an input array along the given axis.
+ *
+ * This function performs sorting along the given axis and returns an array of indices having same shape
+ * as an input array that index data in sorted order.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // sort along axis -1
+ * argsort(x) = [[ 1., 0., 2.],
+ * [ 0., 2., 1.]]
+ *
+ * // sort along axis 0
+ * argsort(x, axis=0) = [[ 1., 0., 1.]
+ * [ 0., 1., 0.]]
+ *
+ * // flatten and then sort
+ * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L176
+ * @param data The input array + * @param axis Axis along which to sort the input tensor. If not given, the flattened array is used. Default is -1. + * @param is_ascend Whether to sort in ascending or descending order. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def argsort (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, is_ascend : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Batchwise dot product.
+ *
+ * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
+ * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
+ *
+ * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
+ * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
+ * which is computed by::
+ *
+ * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L117
+ * @param lhs The first input + * @param rhs The second input + * @param transpose_a If true then transpose the first input before dot. + * @param transpose_b If true then transpose the second input before dot. + * @param forward_stype The desired storage type of the forward output given by user, if thecombination of input storage types and this hint does not matchany implemented ones, the dot operator will perform fallback operationand still produce an output of the desired storage type. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def batch_dot (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, forward_stype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Takes elements from a data batch.
+ *
+ * .. note::
+ * `batch_take` is deprecated. Use `pick` instead.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // takes elements with specified indices
+ * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L444
+ * @param a The input array + * @param indices The index array + * @return org.apache.mxnet.Symbol + */ +@Experimental +def batch_take (a : Option[org.apache.mxnet.Symbol] = None, indices : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_add (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @param data The input + * @param axis The axes to perform the broadcasting. + * @param size Target sizes of the broadcasting axes. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_axes (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, size : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @param data The input + * @param axis The axes to perform the broadcasting. + * @param size Target sizes of the broadcasting axes. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, size : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise division of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 6., 6., 6.],
+ * [ 6., 6., 6.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_div(x, y) = [[ 3., 3., 3.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_div(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_div (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_equal (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_greater (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_greater_equal (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the hypotenuse of a right angled triangle, given its "legs"
+ * with broadcasting.
+ *
+ * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
+ *
+ * Example::
+ *
+ * x = [[ 3., 3., 3.]]
+ *
+ * y = [[ 4.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, y) = [[ 5., 5., 5.],
+ * [ 5., 5., 5.]]
+ *
+ * z = [[ 0.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, z) = [[ 3., 3., 3.],
+ * [ 5., 5., 5.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_hypot (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser(x, y) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_lesser (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_lesser_equal (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **logical and** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_logical_and (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **logical or** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_logical_or (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **logical xor** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_logical_xor (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise maximum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise maxima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_maximum (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise minimum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise minima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_minimum (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_minus (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise modulo of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 8., 8., 8.],
+ * [ 8., 8., 8.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_mod(x, y) = [[ 0., 0., 0.],
+ * [ 2., 2., 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_mod (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise product of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_mul(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_mul(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_mul (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_not_equal (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_plus (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_power(x, y) = [[ 2., 2., 2.],
+ * [ 4., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_power (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @param lhs First input to the function + * @param rhs Second input to the function + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_sub (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Broadcasts the input array to a new shape.
+ *
+ * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
+ * with arrays of different shapes efficiently without creating multiple copies of arrays.
+ * Also see, `Broadcasting `_ for more explanation.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * For example::
+ *
+ * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
+ * [ 1., 2., 3.]])
+ *
+ * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
+ * So with `shape=(2,0)`, we will obtain the same result as in the above example.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
+ * @param data The input + * @param shape The shape of the desired array. We can set the dim to zero if it's same as the original. E.g `A = broadcast_to(B, shape=(10, 0, 0))` has the same meaning as `A = broadcast_axis(B, axis=0, size=10)`. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def broadcast_to (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @param data The input. + * @param dtype Output data type. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def cast (data : Option[org.apache.mxnet.Symbol] = None, dtype : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Casts tensor storage type to the new type.
+ *
+ * When an NDArray with default storage type is cast to csr or row_sparse storage,
+ * the result is compact, which means:
+ *
+ * - for csr, zero values will not be retained
+ * - for row_sparse, row slices of all zeros will not be retained
+ *
+ * The storage type of ``cast_storage`` output depends on stype parameter:
+ *
+ * - cast_storage(csr, 'default') = default
+ * - cast_storage(row_sparse, 'default') = default
+ * - cast_storage(default, 'csr') = csr
+ * - cast_storage(default, 'row_sparse') = row_sparse
+ * - cast_storage(csr, 'csr') = csr
+ * - cast_storage(row_sparse, 'row_sparse') = row_sparse
+ *
+ * Example::
+ *
+ * dense = [[ 0., 1., 0.],
+ * [ 2., 0., 3.],
+ * [ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * # cast to row_sparse storage type
+ * rsp = cast_storage(dense, 'row_sparse')
+ * rsp.indices = [0, 1]
+ * rsp.values = [[ 0., 1., 0.],
+ * [ 2., 0., 3.]]
+ *
+ * # cast to csr storage type
+ * csr = cast_storage(dense, 'csr')
+ * csr.indices = [1, 0, 2]
+ * csr.values = [ 1., 2., 3.]
+ * csr.indptr = [0, 1, 3, 3, 3]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/cast_storage.cc:L71
+ * @param data The input. + * @param stype Output storage type. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def cast_storage (data : Option[org.apache.mxnet.Symbol] = None, stype : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise cube-root value of the input.
+ *
+ * .. math::
+ * cbrt(x) = \sqrt[3]{x}
+ *
+ * Example::
+ *
+ * cbrt([1, 8, -125]) = [1, 2, -5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def cbrt (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise ceiling of the input.
+ *
+ * The ceil of the scalar x is the smallest integer i, such that i >= x.
+ *
+ * Example::
+ *
+ * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
+ *
+ * The storage type of ``ceil`` output depends upon the input storage type:
+ *
+ * - ceil(default) = default
+ * - ceil(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def ceil (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
+ * @param lhs Left operand to the function. + * @param rhs Right operand to the function. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def choose_element_0index (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Clips (limits) the values in an array.
+ *
+ * Given an interval, values outside the interval are clipped to the interval edges.
+ * Clipping ``x`` between `a_min` and `a_x` would be::
+ *
+ * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
+ *
+ * Example::
+ *
+ * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ *
+ * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
+ *
+ * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
+ * parameter values:
+ *
+ * - clip(default) = default
+ * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
+ * - clip(csr, a_min <= 0, a_max >= 0) = csr
+ * - clip(row_sparse, a_min < 0, a_max < 0) = default
+ * - clip(row_sparse, a_min > 0, a_max > 0) = default
+ * - clip(csr, a_min < 0, a_max < 0) = csr
+ * - clip(csr, a_min > 0, a_max > 0) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L617
+ * @param data Input array. + * @param a_min Minimum value + * @param a_max Maximum value + * @return org.apache.mxnet.Symbol + */ +@Experimental +def clip (data : Option[org.apache.mxnet.Symbol] = None, a_min : org.apache.mxnet.Base.MXFloat, a_max : org.apache.mxnet.Base.MXFloat, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @param data List of arrays to concatenate + * @param num_args Number of inputs to be concated. + * @param dim the dimension to be concated. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def concat (data : Array[org.apache.mxnet.Symbol], num_args : Int, dim : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the element-wise cosine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
+ *
+ * The storage type of ``cos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def cos (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the hyperbolic cosine of the input array, computed element-wise.
+ *
+ * .. math::
+ * cosh(x) = 0.5\times(exp(x) + exp(-x))
+ *
+ * The storage type of ``cosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def cosh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @param data Source input + * @param begin starting indices for the slice operation, supports negative indices. + * @param end ending indices for the slice operation, supports negative indices. + * @param step step for the slice operation, supports negative values. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def crop (data : Option[org.apache.mxnet.Symbol] = None, begin : org.apache.mxnet.Shape, end : org.apache.mxnet.Shape, step : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Converts each element of the input array from radians to degrees.
+ *
+ * .. math::
+ * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
+ *
+ * The storage type of ``degrees`` output depends upon the input storage type:
+ *
+ * - degrees(default) = default
+ * - degrees(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def degrees (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Dot product of two arrays.
+ *
+ * ``dot``'s behavior depends on the input array dimensions:
+ *
+ * - 1-D arrays: inner product of vectors
+ * - 2-D arrays: matrix multiplication
+ * - N-D arrays: a sum product over the last axis of the first input and the first
+ * axis of the second input
+ *
+ * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
+ * result array will have shape `(n,m,r,s)`. It is computed by::
+ *
+ * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
+ *
+ * Example::
+ *
+ * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
+ * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
+ * dot(x,y)[0,0,1,1] = 0
+ * sum(x[0,0,:]*y[:,1,1]) = 0
+ *
+ * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
+ * forward_stype option for output storage type. Implemented sparse operations include:
+ *
+ * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
+ * - dot(csr, default, transpose_a=True) = default
+ * - dot(csr, default, transpose_a=True) = row_sparse
+ * - dot(csr, default) = default
+ * - dot(csr, row_sparse) = default
+ * - dot(default, csr) = csr (CPU only)
+ * - dot(default, csr, forward_stype='default') = default
+ * - dot(default, csr, transpose_b=True, forward_stype='default') = default
+ *
+ * If the combination of input storage types and forward_stype does not match any of the
+ * above patterns, ``dot`` will fallback and generate output with default storage.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L69
+ * @param lhs The first input + * @param rhs The second input + * @param transpose_a If true then transpose the first input before dot. + * @param transpose_b If true then transpose the second input before dot. + * @param forward_stype The desired storage type of the forward output given by user, if thecombination of input storage types and this hint does not matchany implemented ones, the dot operator will perform fallback operationand still produce an output of the desired storage type. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def dot (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, forward_stype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Adds arguments element-wise.
+ *
+ * The storage type of ``elemwise_add`` output depends on storage types of inputs
+ *
+ * - elemwise_add(row_sparse, row_sparse) = row_sparse
+ * - elemwise_add(csr, csr) = csr
+ * - elemwise_add(default, csr) = default
+ * - elemwise_add(csr, default) = default
+ * - elemwise_add(default, rsp) = default
+ * - elemwise_add(rsp, default) = default
+ * - otherwise, ``elemwise_add`` generates output with default storage
+ * @param lhs first input + * @param rhs second input + * @return org.apache.mxnet.Symbol + */ +@Experimental +def elemwise_add (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Divides arguments element-wise.
+ *
+ * The storage type of ``elemwise_div`` output is always dense
+ * @param lhs first input + * @param rhs second input + * @return org.apache.mxnet.Symbol + */ +@Experimental +def elemwise_div (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Multiplies arguments element-wise.
+ *
+ * The storage type of ``elemwise_mul`` output depends on storage types of inputs
+ *
+ * - elemwise_mul(default, default) = default
+ * - elemwise_mul(row_sparse, row_sparse) = row_sparse
+ * - elemwise_mul(default, row_sparse) = row_sparse
+ * - elemwise_mul(row_sparse, default) = row_sparse
+ * - elemwise_mul(csr, csr) = csr
+ * - otherwise, ``elemwise_mul`` generates output with default storage
+ * @param lhs first input + * @param rhs second input + * @return org.apache.mxnet.Symbol + */ +@Experimental +def elemwise_mul (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Subtracts arguments element-wise.
+ *
+ * The storage type of ``elemwise_sub`` output depends on storage types of inputs
+ *
+ * - elemwise_sub(row_sparse, row_sparse) = row_sparse
+ * - elemwise_sub(csr, csr) = csr
+ * - elemwise_sub(default, csr) = default
+ * - elemwise_sub(csr, default) = default
+ * - elemwise_sub(default, rsp) = default
+ * - elemwise_sub(rsp, default) = default
+ * - otherwise, ``elemwise_sub`` generates output with default storage
+ * @param lhs first input + * @param rhs second input + * @return org.apache.mxnet.Symbol + */ +@Experimental +def elemwise_sub (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise exponential value of the input.
+ *
+ * .. math::
+ * exp(x) = e^x \approx 2.718^x
+ *
+ * Example::
+ *
+ * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
+ *
+ * The storage type of ``exp`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def exp (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Inserts a new axis of size 1 into the array shape
+ *
+ * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
+ * will return a new array with shape ``(2,1,3,4)``.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L346
+ * @param data Source input + * @param axis Position where new axis is to be inserted. Suppose that the input `NDArray`'s dimension is `ndim`, the range of the inserted axis is `[-ndim, ndim]` + * @return org.apache.mxnet.Symbol + */ +@Experimental +def expand_dims (data : Option[org.apache.mxnet.Symbol] = None, axis : Int, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns ``exp(x) - 1`` computed element-wise on the input.
+ *
+ * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
+ *
+ * The storage type of ``expm1`` output depends upon the input storage type:
+ *
+ * - expm1(default) = default
+ * - expm1(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def expm1 (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
+ * @param lhs Left operand to the function. + * @param mhs Middle operand to the function. + * @param rhs Right operand to the function. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def fill_element_0index (lhs : Option[org.apache.mxnet.Symbol] = None, mhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise rounded value to the nearest \
+ * integer towards zero of the input.
+ *
+ * Example::
+ *
+ * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
+ *
+ * The storage type of ``fix`` output depends upon the input storage type:
+ *
+ * - fix(default) = default
+ * - fix(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def fix (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @param data Input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def flatten (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @param data Input data array + * @param axis The axis which to reverse elements. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def flip (data : Option[org.apache.mxnet.Symbol] = None, axis : org.apache.mxnet.Shape, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise floor of the input.
+ *
+ * The floor of the scalar x is the largest integer i, such that i <= x.
+ *
+ * Example::
+ *
+ * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
+ *
+ * The storage type of ``floor`` output depends upon the input storage type:
+ *
+ * - floor(default) = default
+ * - floor(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def floor (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * The FTML optimizer described in
+ * *FTML - Follow the Moving Leader in Deep Learning*,
+ * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
+ * \sigma_t = d_t - \beta_1 d_{t-1}
+ * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
+ * W_t = - \frac{ z_t }{ d_t }
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L447
+ * @param weight Weight + * @param grad Gradient + * @param d Internal state ``d_t`` + * @param v Internal state ``v_t`` + * @param z Internal state ``z_t`` + * @param lr Learning rate. + * @param beta1 Generally close to 0.5. + * @param beta2 Generally close to 1. + * @param epsilon Epsilon to prevent div 0. + * @param t Number of update. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_grad Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def ftml_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, d : Option[org.apache.mxnet.Symbol] = None, v : Option[org.apache.mxnet.Symbol] = None, z : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, beta1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[Double] = None, t : Int, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_grad : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Update function for Ftrl optimizer.
+ * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
+ * http://dl.acm.org/citation.cfm?id=2488200.
+ *
+ * It updates the weights using::
+ *
+ * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
+ * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
+ * n += rescaled_grad**2
+ * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
+ *
+ * If w, z and n are all of ``row_sparse`` storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
+ *
+ * for row in grad.indices:
+ * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
+ * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
+ * n[row] += rescaled_grad[row]**2
+ * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L632
+ * @param weight Weight + * @param grad Gradient + * @param z z + * @param n Square of grad + * @param lr Learning rate + * @param lamda1 The L1 regularization coefficient. + * @param beta Per-Coordinate Learning Rate beta. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def ftrl_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, z : Option[org.apache.mxnet.Symbol] = None, n : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, lamda1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the gamma function (extension of the factorial function \
+ * to the reals), computed element-wise on the input array.
+ *
+ * The storage type of ``gamma`` output is always dense
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def gamma (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise log of the absolute value of the gamma function \
+ * of the input.
+ *
+ * The storage type of ``gammaln`` output is always dense
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def gammaln (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Gather elements or slices from `data` and store to a tensor whose
+ * shape is defined by `indices`.
+ *
+ * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}]
+ *
+ * Examples::
+ *
+ * data = [[0, 1], [2, 3]]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * gather_nd(data, indices) = [2, 3, 0]
+ * @param data data + * @param indices indices + * @return org.apache.mxnet.Symbol + */ +@Experimental +def gather_nd (data : Option[org.apache.mxnet.Symbol] = None, indices : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes hard sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = max(0, min(1, alpha * x + beta))
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
+ * @param data The input array. + * @param alpha Slope of hard sigmoid + * @param beta Bias of hard sigmoid. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def hard_sigmoid (data : Option[org.apache.mxnet.Symbol] = None, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns a copy of the input.
+ *
+ * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def identity (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the Khatri-Rao product of the input matrices.
+ *
+ * Given a collection of :math:`n` input matrices,
+ *
+ * .. math::
+ * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
+ *
+ * the (column-wise) Khatri-Rao product is defined as the matrix,
+ *
+ * .. math::
+ * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
+ *
+ * where the :math:`k` th column is equal to the column-wise outer product
+ * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
+ * column of the ith matrix.
+ *
+ * Example::
+ *
+ * >>> A = mx.nd.array([[1, -1],
+ * >>> [2, -3]])
+ * >>> B = mx.nd.array([[1, 4],
+ * >>> [2, 5],
+ * >>> [3, 6]])
+ * >>> C = mx.nd.khatri_rao(A, B)
+ * >>> print(C.asnumpy())
+ * [[ 1. -4.]
+ * [ 2. -5.]
+ * [ 3. -6.]
+ * [ 2. -12.]
+ * [ 4. -15.]
+ * [ 6. -18.]]
+ *
+ *
+ *
+ * Defined in src/operator/contrib/krprod.cc:L108
+ * @param args Positional input matrices + * @return org.apache.mxnet.Symbol + */ +@Experimental +def khatri_rao (args : Array[org.apache.mxnet.Symbol], name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * LQ factorization for general matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
+ * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
+ * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
+ * that:
+ *
+ * *A* = *L* \* *Q*
+ *
+ * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
+ * and *Q* is row-orthonormal, meaning that
+ *
+ * *Q* \* *Q*\ :sup:`T`
+ *
+ * is equal to the identity matrix of shape *(x, x)*.
+ *
+ * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single LQ factorization
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * Q, L = gelqf(A)
+ * Q = [[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]]
+ * L = [[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]]
+ *
+ * // Batch LQ factorization
+ * A = [[[1., 2., 3.], [4., 5., 6.]],
+ * [[7., 8., 9.], [10., 11., 12.]]]
+ * Q, L = gelqf(A)
+ * Q = [[[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]],
+ * [[-0.50257071, -0.57436653, -0.64616234],
+ * [0.7620735, 0.05862104, -0.64483142]]]
+ * L = [[[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]],
+ * [[-13.92838828, 0.],
+ * [-19.09768702, 0.52758934]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L552
+ * @param A Tensor of input matrices to be factorized + * @return org.apache.mxnet.Symbol + */ +@Experimental +def linalg_gelqf (A : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Performs general matrix multiplication and accumulation.
+ * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
+ *
+ * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
+ * matrix transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = swapaxes(C, dim1=1, dim2=3)
+ * C = gemm(A1, B1, C)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply-add
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
+ * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
+ *
+ * // Batch matrix multiply-add
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * C = [[[10.0]], [[0.01]]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
+ * = [[[104.0]], [[0.14]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L81
+ * @param A Tensor of input matrices + * @param B Tensor of input matrices + * @param C Tensor of input matrices + * @param transpose_a Multiply with transposed of first input (A). + * @param transpose_b Multiply with transposed of second input (B). + * @param alpha Scalar factor multiplied with A*B. + * @param beta Scalar factor multiplied with C. + * @param axis Axis corresponding to the matrix rows. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def linalg_gemm (A : Option[org.apache.mxnet.Symbol] = None, B : Option[org.apache.mxnet.Symbol] = None, C : Option[org.apache.mxnet.Symbol] = None, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, alpha : Option[Double] = None, beta : Option[Double] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Performs general matrix multiplication.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
+ *
+ * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
+ * transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = gemm2(A1, B1)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[[4.0]], [[0.04 ]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L151
+ * @param A Tensor of input matrices + * @param B Tensor of input matrices + * @param transpose_a Multiply with transposed of first input (A). + * @param transpose_b Multiply with transposed of second input (B). + * @param alpha Scalar factor multiplied with A*B. + * @param axis Axis corresponding to the matrix row indices. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def linalg_gemm2 (A : Option[org.apache.mxnet.Symbol] = None, B : Option[org.apache.mxnet.Symbol] = None, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, alpha : Option[Double] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Performs Cholesky factorization of a symmetric positive-definite matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
+ * computed. *L* is lower triangular (entries of upper triangle are all zero), has
+ * positive diagonal entries, and:
+ *
+ * *A* = *L* \* *L*\ :sup:`T`
+ *
+ * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix factorization
+ * A = [[4.0, 1.0], [1.0, 4.25]]
+ * potrf(A) = [[2.0, 0], [0.5, 2.0]]
+ *
+ * // Batch matrix factorization
+ * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
+ * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L201
+ * @param A Tensor of input matrices to be decomposed + * @return org.apache.mxnet.Symbol + */ +@Experimental +def linalg_potrf (A : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Performs matrix inversion from a Cholesky factorization.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
+ * with positive diagonal. We compute:
+ *
+ * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
+ *
+ * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
+ * *B* (obtained by *potrf*), then
+ *
+ * *out* = *B*\ :sup:`-1`
+ *
+ * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
+ * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
+ * (*trsm*). The latter is numerically much safer, and also cheaper.
+ *
+ * Examples::
+ *
+ * // Single matrix inverse
+ * A = [[2.0, 0], [0.5, 2.0]]
+ * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
+ *
+ * // Batch matrix inverse
+ * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
+ * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L259
+ * @param A Tensor of lower triangular matrices + * @return org.apache.mxnet.Symbol + */ +@Experimental +def linalg_potri (A : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the sum of the logarithms of the diagonal elements of a square matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
+ * logarithms of the diagonal elements, the result has shape (1,).
+ *
+ * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix reduction
+ * A = [[1.0, 1.0], [1.0, 7.0]]
+ * sumlogdiag(A) = [1.9459]
+ *
+ * // Batch matrix reduction
+ * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
+ * sumlogdiag(A) = [1.9459, 3.9318]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L428
+ * @param A Tensor of square matrices + * @return org.apache.mxnet.Symbol + */ +@Experimental +def linalg_sumlogdiag (A : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Multiplication of matrix with its transpose.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the operator performs the BLAS3 function *syrk*:
+ *
+ * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
+ *
+ * if *transpose=False*, or
+ *
+ * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
+ *
+ * if *transpose=True*.
+ *
+ * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * syrk(A, alpha=1., transpose=False)
+ * = [[14., 32.],
+ * [32., 77.]]
+ * syrk(A, alpha=1., transpose=True)
+ * = [[17., 22., 27.],
+ * [22., 29., 36.],
+ * [27., 36., 45.]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1., 1.]], [[0.1, 0.1]]]
+ * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L484
+ * @param A Tensor of input matrices + * @param transpose Use transpose of input matrix. + * @param alpha Scalar factor to be applied to the result. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def linalg_syrk (A : Option[org.apache.mxnet.Symbol] = None, transpose : Option[Boolean] = None, alpha : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Performs multiplication with a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trmm*:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* = *alpha* \* *B* \* *op*\ (*A*)
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ *
+ * Examples::
+ *
+ * // Single triangular matrix multiply
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch triangular matrix multiply
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
+ * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L316
+ * @param A Tensor of lower triangular matrices + * @param B Tensor of matrices + * @param transpose Use transposed of the triangular matrix + * @param rightside Multiply triangular matrix from the right to non-triangular one. + * @param alpha Scalar factor to be applied to the result. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def linalg_trmm (A : Option[org.apache.mxnet.Symbol] = None, B : Option[org.apache.mxnet.Symbol] = None, transpose : Option[Boolean] = None, rightside : Option[Boolean] = None, alpha : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Solves matrix equation involving a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trsm*, solving for *out* in:
+ *
+ * *op*\ (*A*) \* *out* = *alpha* \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* \* *op*\ (*A*) = *alpha* \* *B*
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix solve
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ *
+ * // Batch matrix solve
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
+ * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
+ * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L379
+ * @param A Tensor of lower triangular matrices + * @param B Tensor of matrices + * @param transpose Use transposed of the triangular matrix + * @param rightside Multiply triangular matrix from the right to non-triangular one. + * @param alpha Scalar factor to be applied to the result. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def linalg_trsm (A : Option[org.apache.mxnet.Symbol] = None, B : Option[org.apache.mxnet.Symbol] = None, transpose : Option[Boolean] = None, rightside : Option[Boolean] = None, alpha : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise Natural logarithmic value of the input.
+ *
+ * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
+ *
+ * The storage type of ``log`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def log (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise Base-10 logarithmic value of the input.
+ *
+ * ``10**log10(x) = x``
+ *
+ * The storage type of ``log10`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def log10 (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise ``log(1 + x)`` value of the input.
+ *
+ * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
+ * :math:`1+x\approx 1`
+ *
+ * The storage type of ``log1p`` output depends upon the input storage type:
+ *
+ * - log1p(default) = default
+ * - log1p(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def log1p (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise Base-2 logarithmic value of the input.
+ *
+ * ``2**log2(x) = x``
+ *
+ * The storage type of ``log2`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def log2 (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the log softmax of the input.
+ * This is equivalent to computing softmax followed by log.
+ *
+ * Examples::
+ *
+ * >>> x = mx.nd.array([1, 2, .1])
+ * >>> mx.nd.log_softmax(x).asnumpy()
+ * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
+ *
+ * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
+ * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
+ * array([[-0.34115392, -0.69314718, -1.24115396],
+ * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
+ * @param data The input array. + * @param axis The axis along which to compute softmax. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def log_softmax (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the result of logical NOT (!) function
+ *
+ * Example:
+ * logical_not([-2., 0., 1.]) = [0., 1., 0.]
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def logical_not (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = make_loss(cross_entropy)
+ *
+ * We will need to use ``make_loss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * The storage type of ``make_loss`` output depends upon the input storage type:
+ *
+ * - make_loss(default) = default
+ * - make_loss(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def make_loss (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def max (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def max_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the mean of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def mean (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def min (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def min_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Updater function for multi-precision sgd optimizer
+ * @param weight Weight + * @param grad Gradient + * @param mom Momentum + * @param weight32 Weight32 + * @param lr Learning rate + * @param momentum The decay rate of momentum estimates at each epoch. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and both weight and momentum have the same stype + * @return org.apache.mxnet.Symbol + */ +@Experimental +def mp_sgd_mom_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, mom : Option[org.apache.mxnet.Symbol] = None, weight32 : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Updater function for multi-precision sgd optimizer
+ * @param weight Weight + * @param grad gradient + * @param weight32 Weight32 + * @param lr Learning rate + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def mp_sgd_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, weight32 : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def nanprod (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def nansum (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Numerical negative of the argument, element-wise.
+ *
+ * The storage type of ``negative`` output depends upon the input storage type:
+ *
+ * - negative(default) = default
+ * - negative(row_sparse) = row_sparse
+ * - negative(csr) = csr
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def negative (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the norm on an NDArray.
+ *
+ * This operator computes the norm on an NDArray with the specified axis, depending
+ * on the value of the ord parameter. By default, it computes the L2 norm on the entire
+ * array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * norm(x) = [5.47722578]
+ *
+ * rsp = x.cast_storage('row_sparse')
+ *
+ * norm(rsp) = [5.47722578]
+ *
+ * csr = x.cast_storage('csr')
+ *
+ * norm(csr) = [5.47722578]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
+ * @param data The input + * @param ord Order of the norm. Currently ord=2 is supported. + * @param axis The axis or axes along which to perform the reduction. + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + If `axis` is int, a reduction is performed on a particular axis. + If `axis` is a 2-tuple, it specifies the axes that hold 2-D matrices, + and the matrix norms of these matrices are computed. + * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def norm (data : Option[org.apache.mxnet.Symbol] = None, ord : Option[Int] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @param loc Mean of the distribution. + * @param scale Standard deviation of the distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def normal (loc : Option[org.apache.mxnet.Base.MXFloat] = None, scale : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns a one-hot array.
+ *
+ * The locations represented by `indices` take value `on_value`, while all
+ * other locations take value `off_value`.
+ *
+ * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
+ * in an output array of shape ``(i0, i1, d)`` with::
+ *
+ * output[i,j,:] = off_value
+ * output[i,j,indices[i,j]] = on_value
+ *
+ * Examples::
+ *
+ * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
+ * [ 1. 0. 0.]
+ * [ 0. 0. 1.]
+ * [ 1. 0. 0.]]
+ *
+ * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
+ * dtype='int32') = [[1 8 1]
+ * [8 1 1]
+ * [1 1 8]
+ * [8 1 1]]
+ *
+ * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 0. 1.]
+ * [ 1. 0. 0.]]]
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L490
+ * @param indices array of locations where to set on_value + * @param depth Depth of the one hot dimension. + * @param on_value The value assigned to the locations represented by indices. + * @param off_value The value assigned to the locations not represented by indices. + * @param dtype DType of the output + * @return org.apache.mxnet.Symbol + */ +@Experimental +def one_hot (indices : Option[org.apache.mxnet.Symbol] = None, depth : Int, on_value : Option[Double] = None, off_value : Option[Double] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Return an array of ones with the same shape and type
+ * as the input array.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * ones_like(x) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ * @param data The input + * @return org.apache.mxnet.Symbol + */ +@Experimental +def ones_like (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @param data An n-dimensional input array. + * @param mode Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges. + * @param pad_width Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ... , before_N, after_N)``. It should be of length ``2*N`` where ``N`` is the number of dimensions of the array.This is equivalent to pad_width in numpy.pad, but flattened. + * @param constant_value The value used for padding when `mode` is "constant". + * @return org.apache.mxnet.Symbol + */ +@Experimental +def pad (data : Option[org.apache.mxnet.Symbol] = None, mode : String, pad_width : org.apache.mxnet.Shape, constant_value : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Picks elements from an input array according to the input indices along the given axis.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last element along an axis (the `clip` mode).
+ *
+ * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // picks elements with specified indices along axis 0
+ * pick(x, y=[0,1], 0) = [ 1., 4.]
+ *
+ * // picks elements with specified indices along axis 1
+ * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
+ *
+ * y = [[ 1.],
+ * [ 0.],
+ * [ 2.]]
+ *
+ * // picks elements with specified indices along axis 1 and dims are maintained
+ * pick(x,y, 1, keepdims=True) = [[ 2.],
+ * [ 3.],
+ * [ 6.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
+ * @param data The input array + * @param index The index array + * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` + * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def pick (data : Option[org.apache.mxnet.Symbol] = None, index : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, keepdims : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the product of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def prod (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Converts each element of the input array from degrees to radians.
+ *
+ * .. math::
+ * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
+ *
+ * The storage type of ``radians`` output depends upon the input storage type:
+ *
+ * - radians(default) = default
+ * - radians(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def radians (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Draw random samples from an exponential distribution.
+ *
+ * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
+ *
+ * Example::
+ *
+ * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
+ * [ 0.04146638, 0.31715935]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L115
+ * @param lam Lambda parameter (rate) of the exponential distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def random_exponential (lam : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Draw random samples from a gamma distribution.
+ *
+ * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
+ *
+ * Example::
+ *
+ * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
+ * [ 3.91697288, 3.65933681]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L100
+ * @param alpha Alpha parameter (shape) of the gamma distribution. + * @param beta Beta parameter (scale) of the gamma distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def random_gamma (alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Draw random samples from a generalized negative binomial distribution.
+ *
+ * Samples are distributed according to a generalized negative binomial distribution parametrized by
+ * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
+ * number of unsuccessful experiments (generalized to real numbers).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
+ * [ 6., 4.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L168
+ * @param mu Mean of the negative binomial distribution. + * @param alpha Alpha (dispersion) parameter of the negative binomial distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def random_generalized_negative_binomial (mu : Option[org.apache.mxnet.Base.MXFloat] = None, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Draw random samples from a negative binomial distribution.
+ *
+ * Samples are distributed according to a negative binomial distribution parametrized by
+ * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
+ * [ 2., 5.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L149
+ * @param k Limit of unsuccessful experiments. + * @param p Failure probability in each experiment. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def random_negative_binomial (k : Option[Int] = None, p : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @param loc Mean of the distribution. + * @param scale Standard deviation of the distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def random_normal (loc : Option[org.apache.mxnet.Base.MXFloat] = None, scale : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Draw random samples from a Poisson distribution.
+ *
+ * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
+ * [ 4., 6.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L132
+ * @param lam Lambda parameter (rate) of the Poisson distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def random_poisson (lam : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @param low Lower bound of the distribution. + * @param high Upper bound of the distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def random_uniform (low : Option[org.apache.mxnet.Base.MXFloat] = None, high : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
+ *
+ * Examples::
+ *
+ * A = [[3,6,6],[4,5,1]]
+ * ravel(A, shape=(7,6)) = [22,41,37]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L41
+ * @param data Batch of multi-indices + * @param shape Shape of the array into which the multi-indices apply. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def ravel_multi_index (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise inverse cube-root value of the input.
+ *
+ * .. math::
+ * rcbrt(x) = 1/\sqrt[3]{x}
+ *
+ * Example::
+ *
+ * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def rcbrt (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the reciprocal of the argument, element-wise.
+ *
+ * Calculates 1/x.
+ *
+ * Example::
+ *
+ * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def reciprocal (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes rectified linear.
+ *
+ * .. math::
+ * max(features, 0)
+ *
+ * The storage type of ``relu`` output depends upon the input storage type:
+ *
+ * - relu(default) = default
+ * - relu(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def relu (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Repeats elements of an array.
+ *
+ * By default, ``repeat`` flattens the input array into 1-D and then repeats the
+ * elements::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
+ *
+ * The parameter ``axis`` specifies the axis along which to perform repeat::
+ *
+ * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
+ * [ 1., 2.],
+ * [ 3., 4.],
+ * [ 3., 4.]]
+ *
+ * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L690
+ * @param data Input data array + * @param repeats The number of repetitions for each element. + * @param axis The axis along which to repeat values. The negative numbers are interpreted counting from the backward. By default, use the flattened input array, and return a flat output array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def repeat (data : Option[org.apache.mxnet.Symbol] = None, repeats : Int, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @param data Input data to reshape. + * @param shape The target shape + * @param reverse If true then the special values are inferred from right to left + * @param target_shape (Deprecated! Use ``shape`` instead.) Target new shape. One and only one dim can be 0, in which case it will be inferred from the rest of dims + * @param keep_highest (Deprecated! Use ``shape`` instead.) Whether keep the highest dim unchanged.If set to true, then the first dim in target_shape is ignored,and always fixed as input + * @return org.apache.mxnet.Symbol + */ +@Experimental +def reshape (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, reverse : Option[Boolean] = None, target_shape : Option[org.apache.mxnet.Shape] = None, keep_highest : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Reshape lhs to have the same shape as rhs.
+ * @param lhs First input. + * @param rhs Second input. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def reshape_like (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @param data Input data array + * @param axis The axis which to reverse elements. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def reverse (data : Option[org.apache.mxnet.Symbol] = None, axis : org.apache.mxnet.Shape, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * .. note::
+ * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
+ * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
+ *
+ * Example::
+ *
+ * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
+ *
+ * The storage type of ``rint`` output depends upon the input storage type:
+ *
+ * - rint(default) = default
+ * - rint(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def rint (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Update function for `RMSProp` optimizer.
+ *
+ * `RMSprop` is a variant of stochastic gradient descent where the gradients are
+ * divided by a cache which grows with the sum of squares of recent gradients?
+ *
+ * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
+ * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
+ * each parameter monotonically over the course of training.
+ * While this is analytically motivated for convex optimizations, it may not be ideal
+ * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
+ * learning rates to rebound as the denominator decays over time.
+ *
+ * Define the Root Mean Square (RMS) error criterion of the gradient as
+ * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
+ * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
+ *
+ * The :math:`E[g^2]_t` is given by:
+ *
+ * .. math::
+ * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
+ *
+ * The RMSProp code follows the version in
+ * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
+ * Tieleman & Hinton, 2012.
+ *
+ * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
+ * :math:`\eta` to be 0.001.
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L553
+ * @param weight Weight + * @param grad Gradient + * @param n n + * @param lr Learning rate + * @param gamma1 The decay rate of momentum estimates. + * @param epsilon A small constant for numerical stability. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param clip_weights Clip weights to the range of [-clip_weights, clip_weights] If clip_weights <= 0, weight clipping is turned off. weights = max(min(weights, clip_weights), -clip_weights). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def rmsprop_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, n : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, gamma1 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, clip_weights : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Update function for RMSPropAlex optimizer.
+ *
+ * `RMSPropAlex` is non-centered version of `RMSProp`.
+ *
+ * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
+ * :math:`E[g]_t` is the decaying average over past gradient.
+ *
+ * .. math::
+ * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
+ * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
+ * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t + \Delta_t
+ *
+ * The RMSPropAlex code follows the version in
+ * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
+ *
+ * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
+ * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L592
+ * @param weight Weight + * @param grad Gradient + * @param n n + * @param g g + * @param delta delta + * @param lr Learning rate + * @param gamma1 Decay rate. + * @param gamma2 Decay rate. + * @param epsilon A small constant for numerical stability. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param clip_weights Clip weights to the range of [-clip_weights, clip_weights] If clip_weights <= 0, weight clipping is turned off. weights = max(min(weights, clip_weights), -clip_weights). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def rmspropalex_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, n : Option[org.apache.mxnet.Symbol] = None, g : Option[org.apache.mxnet.Symbol] = None, delta : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, gamma1 : Option[org.apache.mxnet.Base.MXFloat] = None, gamma2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, clip_weights : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * Example::
+ *
+ * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
+ *
+ * The storage type of ``round`` output depends upon the input storage type:
+ *
+ * - round(default) = default
+ * - round(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def round (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise inverse square-root value of the input.
+ *
+ * .. math::
+ * rsqrt(x) = 1/\sqrt{x}
+ *
+ * Example::
+ *
+ * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
+ *
+ * The storage type of ``rsqrt`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def rsqrt (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * exponential distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_exponential(lam) = [ 0.51837951, 0.09994757]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
+ * [ 0.09994757, 0.50447971]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L284
+ * @param lam Lambda (rate) parameters of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sample_exponential (lam : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * alpha = [ 0.0, 2.5 ]
+ * beta = [ 1.0, 0.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
+ * [ 2.25797319, 1.70734084]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L282
+ * @param alpha Alpha (shape) parameters of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param beta Beta (scale) parameters of the distributions. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sample_gamma (alpha : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, beta : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * mu = [ 2.0, 2.5 ]
+ * alpha = [ 1.0, 0.1 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
+ * [ 3., 1.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L293
+ * @param mu Means of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param alpha Alpha (dispersion) parameters of the distributions. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sample_generalized_negative_binomial (mu : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, alpha : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple multinomial distributions.
+ *
+ * *data* is an *n* dimensional array whose last dimension has length *k*, where
+ * *k* is the number of possible outcomes of each multinomial distribution. This
+ * operator will draw *shape* samples from each distribution. If shape is empty
+ * one sample will be drawn from each distribution.
+ *
+ * If *get_prob* is true, a second array containing log likelihood of the drawn
+ * samples will also be returned. This is usually used for reinforcement learning
+ * where you can provide reward as head gradient for this array to estimate
+ * gradient.
+ *
+ * Note that the input distribution must be normalized, i.e. *data* must sum to
+ * 1 along its last axis.
+ *
+ * Examples::
+ *
+ * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
+ *
+ * // Draw a single sample for each distribution
+ * sample_multinomial(probs) = [3, 0]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_multinomial(probs, shape=(2)) = [[4, 2],
+ * [0, 0]]
+ *
+ * // requests log likelihood
+ * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
+ * @param data Distribution probabilities. Must sum to one on the last axis. + * @param shape Shape to be sampled from each random distribution. + * @param get_prob Whether to also return the log probability of sampled result. This is usually used for differentiating through stochastic variables, e.g. in reinforcement learning. + * @param dtype DType of the output in case this can't be inferred. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sample_multinomial (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, get_prob : Option[Boolean] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * k = [ 20, 49 ]
+ * p = [ 0.4 , 0.77 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_negative_binomial(k, p) = [ 15., 16.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
+ * [ 16., 12.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L289
+ * @param k Limits of unsuccessful experiments. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param p Failure probabilities in each experiment. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sample_negative_binomial (k : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, p : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * mu = [ 0.0, 2.5 ]
+ * sigma = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
+ * [ 0.95934606, 4.48287058]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L279
+ * @param mu Means of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param sigma Standard deviations of the distributions. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sample_normal (mu : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, sigma : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * Poisson distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_poisson(lam) = [ 0., 13.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
+ * [ 13., 8.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L286
+ * @param lam Lambda (rate) parameters of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sample_poisson (lam : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * uniform distributions on the intervals given by *[low,high)*.
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * low = [ 0.0, 2.5 ]
+ * high = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
+ * [ 3.18687344, 3.68352246]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L277
+ * @param low Lower bounds of the distributions. + * @param shape Shape to be sampled from each random distribution. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @param high Upper bounds of the distributions. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sample_uniform (low : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, high : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Scatters data into a new tensor according to indices.
+ *
+ * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
+ *
+ * all other entries in output are 0.
+ *
+ * .. warning::
+ *
+ * If the indices have duplicates, the result will be non-deterministic and
+ * the gradient of `scatter_nd` will not be correct!!
+ *
+ *
+ * Examples::
+ *
+ * data = [2, 3, 0]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * shape = (2, 2)
+ * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
+ * @param data data + * @param indices indices + * @param shape Shape of output. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def scatter_nd (data : Option[org.apache.mxnet.Symbol] = None, indices : Option[org.apache.mxnet.Symbol] = None, shape : org.apache.mxnet.Shape, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
+ *
+ * Momentum update has better convergence rates on neural networks. Mathematically it looks
+ * like below:
+ *
+ * .. math::
+ *
+ * v_1 = \alpha * \nabla J(W_0)\\
+ * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} + v_t
+ *
+ * It updates the weights using::
+ *
+ * v = momentum * v - learning_rate * gradient
+ * weight += v
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
+ * type is the same as momentum's storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
+ *
+ * for row in gradient.indices:
+ * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
+ * weight[row] += v[row]
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L372
+ * @param weight Weight + * @param grad Gradient + * @param mom Momentum + * @param lr Learning rate + * @param momentum The decay rate of momentum estimates at each epoch. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and both weight and momentum have the same stype + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sgd_mom_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, mom : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Update function for Stochastic Gradient Descent (SDG) optimizer.
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * (gradient + wd * weight)
+ *
+ * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
+ * only the row slices whose indices appear in grad.indices are updated::
+ *
+ * for row in gradient.indices:
+ * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L331
+ * @param weight Weight + * @param grad Gradient + * @param lr Learning rate + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sgd_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Randomly shuffle the elements.
+ *
+ * This shuffles the array along the first axis.
+ * The order of the elements in each subarray does not change.
+ * For example, if a 2D array is given, the order of the rows randomly changes,
+ * but the order of the elements in each row does not change.
+ * @param data Data to be shuffled. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def shuffle (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = 1 / (1 + exp(-x))
+ *
+ * The storage type of ``sigmoid`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sigmoid (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise sign of the input.
+ *
+ * Example::
+ *
+ * sign([-2, 0, 3]) = [-1, 0, 1]
+ *
+ * The storage type of ``sign`` output depends upon the input storage type:
+ *
+ * - sign(default) = default
+ * - sign(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sign (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Update function for SignSGD optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * sign(gradient)
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L57
+ * @param weight Weight + * @param grad Gradient + * @param lr Learning rate + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def signsgd_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * SIGN momentUM (Signum) optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
+ *
+ * It updates the weights using::
+ * state = momentum * state + (1-momentum) * gradient
+ * weight = weight - learning_rate * sign(state)
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L86
+ * @param weight Weight + * @param grad Gradient + * @param mom Momentum + * @param lr Learning rate + * @param momentum The decay rate of momentum estimates at each epoch. + * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. + * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. + * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). + * @param wd_lh The amount of weight decay that does not go into gradient/momentum calculationsotherwise do weight decay algorithmically only. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def signum_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, mom : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, wd_lh : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the element-wise sine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
+ *
+ * The storage type of ``sin`` output depends upon the input storage type:
+ *
+ * - sin(default) = default
+ * - sin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sin (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the hyperbolic sine of the input array, computed element-wise.
+ *
+ * .. math::
+ * sinh(x) = 0.5\times(exp(x) - exp(-x))
+ *
+ * The storage type of ``sinh`` output depends upon the input storage type:
+ *
+ * - sinh(default) = default
+ * - sinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sinh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @param data Source input + * @param begin starting indices for the slice operation, supports negative indices. + * @param end ending indices for the slice operation, supports negative indices. + * @param step step for the slice operation, supports negative values. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def slice (data : Option[org.apache.mxnet.Symbol] = None, begin : org.apache.mxnet.Shape, end : org.apache.mxnet.Shape, step : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Slices along a given axis.
+ *
+ * Returns an array slice along a given `axis` starting from the `begin` index
+ * to the `end` index.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
+ * [ 5., 6.],
+ * [ 9., 10.]]
+ *
+ * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
+ * [ 6., 7.],
+ * [ 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L499
+ * @param data Source input + * @param axis Axis along which to be sliced, supports negative indexes. + * @param begin The beginning index along the axis to be sliced, supports negative indexes. + * @param end The ending index along the axis to be sliced, supports negative indexes. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def slice_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Int, begin : Int, end : Int, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Slices a region of the array like the shape of another array.
+ *
+ * This function is similar to ``slice``, however, the `begin` are always `0`s
+ * and `end` of specific axes are inferred from the second input `shape_like`.
+ *
+ * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * a ``slice_like`` operator with default empty `axes`, it performs the
+ * following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
+ *
+ * When `axes` is not empty, it is used to speficy which axes are being sliced.
+ *
+ * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
+ * will perform the following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
+ *
+ * Note that it is allowed to have first and second input with different dimensions,
+ * however, you have to make sure the `axes` are specified and not exceeding the
+ * dimension limits.
+ *
+ * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
+ * ``shape=(1,2,3)``, it is not allowed to use:
+ *
+ * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
+ * is 3.
+ *
+ * The following is allowed in this situation:
+ *
+ * `` out = slice_like(a, b, axes=(0, 2))``
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * y = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * slice_like(x, y) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
+ * [ 5., 6., 7., 8.]]
+ * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]
+ * [ 9., 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L568
+ * @param data Source input + * @param shape_like Shape like input + * @param axes List of axes on which input data will be sliced according to the corresponding size of the second input. By default will slice on all axes. Negative axes are supported. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def slice_like (data : Option[org.apache.mxnet.Symbol] = None, shape_like : Option[org.apache.mxnet.Symbol] = None, axes : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Calculate Smooth L1 Loss(lhs, scalar) by summing
+ *
+ * .. math::
+ *
+ * f(x) =
+ * \begin{cases}
+ * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
+ * |x|-0.5/\sigma^2,& \text{otherwise}
+ * \end{cases}
+ *
+ * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
+ *
+ * Example::
+ *
+ * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
+ * @param data source input + * @param scalar scalar input + * @return org.apache.mxnet.Symbol + */ +@Experimental +def smooth_l1 (data : Option[org.apache.mxnet.Symbol] = None, scalar : org.apache.mxnet.Base.MXFloat, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Applies the softmax function.
+ *
+ * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
+ *
+ * .. math::
+ * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
+ *
+ * for :math:`j = 1, ..., K`
+ *
+ * Example::
+ *
+ * x = [[ 1. 1. 1.]
+ * [ 1. 1. 1.]]
+ *
+ * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
+ * [ 0.5 0.5 0.5]]
+ *
+ * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
+ * [ 0.33333334, 0.33333334, 0.33333334]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax.cc:L95
+ * @param data The input array. + * @param axis The axis along which to compute softmax. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def softmax (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Calculate cross entropy of softmax output and one-hot label.
+ *
+ * - This operator computes the cross entropy in two steps:
+ * - Applies softmax function on the input array.
+ * - Computes and returns the cross entropy loss between the softmax output and the labels.
+ *
+ * - The softmax function and cross entropy loss is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * Example::
+ *
+ * x = [[1, 2, 3],
+ * [11, 7, 5]]
+ *
+ * label = [2, 0]
+ *
+ * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
+ * [0.97962922, 0.01794253, 0.00242826]]
+ *
+ * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
+ *
+ *
+ *
+ * Defined in src/operator/loss_binary_op.cc:L59
+ * @param data Input data + * @param label Input label + * @return org.apache.mxnet.Symbol + */ +@Experimental +def softmax_cross_entropy (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes softsign of x element-wise.
+ *
+ * .. math::
+ * y = x / (1 + abs(x))
+ *
+ * The storage type of ``softsign`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def softsign (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns a sorted copy of an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 4],
+ * [ 3, 1]]
+ *
+ * // sorts along the last axis
+ * sort(x) = [[ 1., 4.],
+ * [ 1., 3.]]
+ *
+ * // flattens and then sorts
+ * sort(x) = [ 1., 1., 3., 4.]
+ *
+ * // sorts along the first axis
+ * sort(x, axis=0) = [[ 1., 1.],
+ * [ 3., 4.]]
+ *
+ * // in a descend order
+ * sort(x, is_ascend=0) = [[ 4., 1.],
+ * [ 3., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L126
+ * @param data The input array + * @param axis Axis along which to choose sort the input tensor. If not given, the flattened array is used. Default is -1. + * @param is_ascend Whether to sort in ascending or descending order. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sort (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, is_ascend : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @param data The input + * @param num_outputs Number of splits. Note that this should evenly divide the length of the `axis`. + * @param axis Axis along which to split. + * @param squeeze_axis If true, Removes the axis with length 1 from the shapes of the output arrays. **Note** that setting `squeeze_axis` to ``true`` removes axis with length 1 only along the `axis` which it is split. Also `squeeze_axis` can be set to ``true`` only if ``input.shape[axis] == num_outputs``. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def split (data : Option[org.apache.mxnet.Symbol] = None, num_outputs : Int, axis : Option[Int] = None, squeeze_axis : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise square-root value of the input.
+ *
+ * .. math::
+ * \textrm{sqrt}(x) = \sqrt{x}
+ *
+ * Example::
+ *
+ * sqrt([4, 9, 16]) = [2, 3, 4]
+ *
+ * The storage type of ``sqrt`` output depends upon the input storage type:
+ *
+ * - sqrt(default) = default
+ * - sqrt(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sqrt (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns element-wise squared value of the input.
+ *
+ * .. math::
+ * square(x) = x^2
+ *
+ * Example::
+ *
+ * square([2, 3, 4]) = [4, 9, 16]
+ *
+ * The storage type of ``square`` output depends upon the input storage type:
+ *
+ * - square(default) = default
+ * - square(row_sparse) = row_sparse
+ * - square(csr) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def square (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Remove single-dimensional entries from the shape of an array.
+ * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
+ * See the following note for exception.
+ *
+ * Examples::
+ *
+ * data = [[[0], [1], [2]]]
+ * squeeze(data) = [0, 1, 2]
+ * squeeze(data, axis=0) = [[0], [1], [2]]
+ * squeeze(data, axis=2) = [[0, 1, 2]]
+ * squeeze(data, axis=(0, 2)) = [0, 1, 2]
+ *
+ * .. Note::
+ * The output of this operator will keep at least one dimension not removed. For example,
+ * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
+ * @param data data to squeeze + * @param axis Selects a subset of the single-dimensional entries in the shape. If an axis is selected with shape entry greater than one, an error is raised. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def squeeze (data : Array[org.apache.mxnet.Symbol], axis : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Join a sequence of arrays along a new axis.
+ *
+ * The axis parameter specifies the index of the new axis in the dimensions of the
+ * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
+ * will be the last dimension.
+ *
+ * Examples::
+ *
+ * x = [1, 2]
+ * y = [3, 4]
+ *
+ * stack(x, y) = [[1, 2],
+ * [3, 4]]
+ * stack(x, y, axis=1) = [[1, 3],
+ * [2, 4]]
+ * @param data List of arrays to stack + * @param axis The axis in the result array along which the input arrays are stacked. + * @param num_args Number of inputs to be stacked. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def stack (data : Array[org.apache.mxnet.Symbol], axis : Option[Int] = None, num_args : Int, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def stop_gradient (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sum (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @param data The input + * @param axis The axis or axes along which to perform the reduction. + + The default, `axis=()`, will compute over all elements into a + scalar array with shape `(1,)`. + + If `axis` is int, a reduction is performed on a particular axis. + + If `axis` is a tuple of ints, a reduction is performed on all the axes + specified in the tuple. + + If `exclude` is true, reduction will be performed on the axes that are + NOT in axis instead. + + Negative values means indexing from right to left. + * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. + * @param exclude Whether to perform reduction on axis that are NOT in axis instead. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def sum_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @param data Input array. + * @param dim1 the first axis to be swapped. + * @param dim2 the second axis to be swapped. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def swapaxes (data : Option[org.apache.mxnet.Symbol] = None, dim1 : Option[Int] = None, dim2 : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Takes elements from an input array along the given axis.
+ *
+ * This function slices the input array along a particular axis with the provided indices.
+ *
+ * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
+ * will have shape ``(i0, i1, d1, d2)``, computed by::
+ *
+ * output[i,j,:,:] = input[indices[i,j],:,:]
+ *
+ * .. note::
+ * - `axis`- Only slicing along axis 0 is supported for now.
+ * - `mode`- Only `clip` mode is supported for now.
+ *
+ * Examples::
+ * x = [4. 5. 6.]
+ *
+ * // Trivial case, take the second element along the first axis.
+ * take(x, [1]) = [ 5. ]
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
+ * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 3., 4.],
+ * [ 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L389
+ * @param a The input array. + * @param indices The indices of the values to be extracted. + * @param axis The axis of input array to be taken. + * @param mode Specify how out-of-bound indices bahave. "clip" means clip to the range. So, if all indices mentioned are too large, they are replaced by the index that addresses the last element along an axis. "wrap" means to wrap around. "raise" means to raise an error. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def take (a : Option[org.apache.mxnet.Symbol] = None, indices : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, mode : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Computes the element-wise tangent of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
+ *
+ * The storage type of ``tan`` output depends upon the input storage type:
+ *
+ * - tan(default) = default
+ * - tan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def tan (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the hyperbolic tangent of the input array, computed element-wise.
+ *
+ * .. math::
+ * tanh(x) = sinh(x) / cosh(x)
+ *
+ * The storage type of ``tanh`` output depends upon the input storage type:
+ *
+ * - tanh(default) = default
+ * - tanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def tanh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Repeats the whole array multiple times.
+ *
+ * If ``reps`` has length *d*, and input array has dimension of *n*. There are
+ * three cases:
+ *
+ * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]
+ *
+ * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
+ * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
+ *
+ *
+ * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4.]]
+ *
+ * - **n + * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
+ *
+ * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]],
+ *
+ * [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L751
+ * @param data Input data array + * @param reps The number of times for repeating the tensor a. Each dim size of reps must be a positive integer. If reps has length d, the result will have dimension of max(d, a.ndim); If a.ndim < d, a is promoted to be d-dimensional by prepending new axes. If a.ndim > d, reps is promoted to a.ndim by pre-pending 1's to it. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def tile (data : Option[org.apache.mxnet.Symbol] = None, reps : org.apache.mxnet.Shape, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Returns the top *k* elements in an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // returns an index of the largest element on last axis
+ * topk(x) = [[ 2.],
+ * [ 1.]]
+ *
+ * // returns the value of top-2 largest elements on last axis
+ * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
+ * [ 0.3, 0.2]]
+ *
+ * // returns the value of top-2 smallest elements on last axis
+ * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
+ * [ 0.1 , 0.2]]
+ *
+ * // returns the value of top-2 largest elements on axis 0
+ * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
+ * [ 0.1, 0.2, 0.2]]
+ *
+ * // flattens and then returns list of both values and indices
+ * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L63
+ * @param data The input array + * @param axis Axis along which to choose the top k indices. If not given, the flattened array is used. Default is -1. + * @param k Number of top elements to select, should be always smaller than or equal to the element number in the given axis. A global sort is performed if set k < 1. + * @param ret_typ The return type. + "value" means to return the top k values, "indices" means to return the indices of the top k values, "mask" means to return a mask array containing 0 and 1. 1 means the top k values. "both" means to return a list of both values and indices of top k elements. + * @param is_ascend Whether to choose k largest or k smallest elements. Top K largest elements will be chosen if set to false. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def topk (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, k : Option[Int] = None, ret_typ : Option[String] = None, is_ascend : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Permutes the dimensions of an array.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * transpose(x) = [[ 1., 3.],
+ * [ 2., 4.]]
+ *
+ * x = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 5., 6.],
+ * [ 7., 8.]]]
+ *
+ * transpose(x) = [[[ 1., 5.],
+ * [ 3., 7.]],
+ *
+ * [[ 2., 6.],
+ * [ 4., 8.]]]
+ *
+ * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
+ * [ 5., 6.]],
+ *
+ * [[ 3., 4.],
+ * [ 7., 8.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L310
+ * @param data Source input + * @param axes Target axis order. By default the axes will be inverted. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def transpose (data : Option[org.apache.mxnet.Symbol] = None, axes : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Return the element-wise truncated value of the input.
+ *
+ * The truncated value of the scalar x is the nearest integer i which is closer to
+ * zero than x is. In short, the fractional part of the signed number x is discarded.
+ *
+ * Example::
+ *
+ * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
+ *
+ * The storage type of ``trunc`` output depends upon the input storage type:
+ *
+ * - trunc(default) = default
+ * - trunc(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
+ * @param data The input array. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def trunc (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @param low Lower bound of the distribution. + * @param high Upper bound of the distribution. + * @param shape Shape of the output. + * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. + * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). + * @return org.apache.mxnet.Symbol + */ +@Experimental +def uniform (low : Option[org.apache.mxnet.Base.MXFloat] = None, high : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
+ *
+ * Examples::
+ *
+ * A = [22,41,37]
+ * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L65
+ * @param data Array of flat indices + * @param shape Shape of the array into which the multi-indices apply. + * @return org.apache.mxnet.Symbol + */ +@Experimental +def unravel_index (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Return the elements, either from x or y, depending on the condition.
+ *
+ * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
+ * depending on the elements from condition are true or false. x and y must have the same shape.
+ * If condition has the same shape as x, each element in the output array is from x if the
+ * corresponding element in the condition is true, and from y if false.
+ *
+ * If condition does not have the same shape as x, it must be a 1D array whose size is
+ * the same as x's first dimension size. Each row of the output array is from x's row
+ * if the corresponding element from condition is true, and from y's row if false.
+ *
+ * Note that all non-zero values are interpreted as ``True`` in condition.
+ *
+ * Examples::
+ *
+ * x = [[1, 2], [3, 4]]
+ * y = [[5, 6], [7, 8]]
+ * cond = [[0, 1], [-1, 0]]
+ *
+ * where(cond, x, y) = [[5, 2], [3, 8]]
+ *
+ * csr_cond = cast_storage(cond, 'csr')
+ *
+ * where(csr_cond, x, y) = [[5, 2], [3, 8]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/control_flow_op.cc:L57
+ * @param condition condition array + * @param x + * @param y + * @return org.apache.mxnet.Symbol + */ +@Experimental +def where (condition : Option[org.apache.mxnet.Symbol] = None, x : Option[org.apache.mxnet.Symbol] = None, y : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol + /** + * Return an array of zeros with the same shape, type and storage type
+ * as the input array.
+ *
+ * The storage type of ``zeros_like`` output depends on the storage type of the input
+ *
+ * - zeros_like(row_sparse) = row_sparse
+ * - zeros_like(csr) = csr
+ * - zeros_like(default) = default
+ *
+ * Examples::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * zeros_like(x) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ * @param data The input + * @return org.apache.mxnet.Symbol + */ +@Experimental +def zeros_like (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol +} \ No newline at end of file diff --git a/scala-package/core/src/main/scala/org/apache/mxnet/SymbolBase.scala b/scala-package/core/src/main/scala/org/apache/mxnet/SymbolBase.scala new file mode 100644 index 000000000000..669912a0f130 --- /dev/null +++ b/scala-package/core/src/main/scala/org/apache/mxnet/SymbolBase.scala @@ -0,0 +1,5755 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one or more +* contributor license agreements. See the NOTICE file distributed with +* this work for additional information regarding copyright ownership. +* The ASF licenses this file to You under the Apache License, Version 2.0 +* (the "License"); you may not use this file except in compliance with +* the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// scalastyle:off +package org.apache.mxnet +import org.apache.mxnet.annotation.Experimental +abstract class SymbolBase { + /** + * Applies an activation function element-wise to the input.
+ *
+ * The following activation functions are supported:
+ *
+ * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
+ * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
+ * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
+ * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
+ * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
+ *
+ *
+ *
+ * Defined in src/operator/nn/activation.cc:L161
+ * @return org.apache.mxnet.Symbol + */ +def Activation(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Batch normalization.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
+ * two outputs are blocked.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
+ * axis to be the last item in the input shape.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/nn/batch_norm.cc:L575
+ * @return org.apache.mxnet.Symbol + */ +def BatchNorm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Batch normalization.
+ *
+ * This operator is DEPRECATED. Perform BatchNorm on the input.
+ *
+ * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis:
+ *
+ * .. math::
+ *
+ * data\_mean[i] = mean(data[:,i,:,...]) \\
+ * data\_var[i] = var(data[:,i,:,...])
+ *
+ * Then compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
+ *
+ * Both *mean* and *var* returns a scalar by treating the input as a vector.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_var`` as well, which are needed for the backward pass.
+ *
+ * Besides the inputs and the outputs, this operator accepts two auxiliary
+ * states, ``moving_mean`` and ``moving_var``, which are *k*-length
+ * vectors. They are global statistics for the whole dataset, which are updated
+ * by::
+ *
+ * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
+ * moving_var = moving_var * momentum + data_var * (1 - momentum)
+ *
+ * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
+ * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
+ * the output. It is often used during inference.
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
+ * then set ``gamma`` to 1 and its gradient to 0.
+ *
+ *
+ *
+ * Defined in src/operator/batch_norm_v1.cc:L92
+ * @return org.apache.mxnet.Symbol + */ +def BatchNorm_v1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies bilinear sampling to input feature map.
+ *
+ * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
+ * except that the operator has the backward pass.
+ *
+ * Given :math:`data` and :math:`grid`, then the output is computed by
+ *
+ * .. math::
+ * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
+ * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
+ * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
+ *
+ * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
+ * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
+ *
+ * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
+ *
+ * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
+ * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
+ * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
+ *
+ * Example 1::
+ *
+ * ## Zoom out data two times
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * affine_matrix = array([[2, 0, 0],
+ * [0, 2, 0]])
+ *
+ * affine_matrix = reshape(affine_matrix, shape=(1, 6))
+ *
+ * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
+ *
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 0, 0, 0, 0],
+ * [ 0, 3.5, 6.5, 0],
+ * [ 0, 1.25, 2.5, 0],
+ * [ 0, 0, 0, 0]]]
+ *
+ *
+ * Example 2::
+ *
+ * ## shift data horizontally by -1 pixel
+ *
+ * data = array([[[[1, 4, 3, 6],
+ * [1, 8, 8, 9],
+ * [0, 4, 1, 5],
+ * [1, 0, 1, 3]]]])
+ *
+ * warp_maxtrix = array([[[[1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1],
+ * [1, 1, 1, 1]],
+ * [[0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0],
+ * [0, 0, 0, 0]]]])
+ *
+ * grid = GridGenerator(data=warp_matrix, transform_type='warp')
+ * out = BilinearSampler(data, grid)
+ *
+ * out
+ * [[[[ 4, 3, 6, 0],
+ * [ 8, 8, 9, 0],
+ * [ 4, 1, 5, 0],
+ * [ 0, 1, 3, 0]]]
+ *
+ *
+ * Defined in src/operator/bilinear_sampler.cc:L245
+ * @return org.apache.mxnet.Symbol + */ +def BilinearSampler(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @return org.apache.mxnet.Symbol + */ +def BlockGrad(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @return org.apache.mxnet.Symbol + */ +def Cast(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @return org.apache.mxnet.Symbol + */ +def Concat(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Compute *N*-D convolution on *(N+2)*-D input.
+ *
+ * In the 2-D convolution, given input data with shape *(batch_size,
+ * channel, height, width)*, the output is computed by
+ *
+ * .. math::
+ *
+ * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
+ * weight[i,j,:,:]
+ *
+ * where :math:`\star` is the 2-D cross-correlation operator.
+ *
+ * For general 2-D convolution, the shapes are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*.
+ *
+ * Define::
+ *
+ * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
+ *
+ * then we have::
+ *
+ * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
+ * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
+ * width)*. We can choose other layouts such as *NHWC*.
+ *
+ * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
+ * evenly into *g* parts along the channel axis, and also evenly split ``weight``
+ * along the first dimension. Next compute the convolution on the *i*-th part of
+ * the data with the *i*-th weight part. The output is obtained by concatenating all
+ * the *g* results.
+ *
+ * 1-D convolution does not have *height* dimension but only *width* in space.
+ *
+ * - **data**: *(batch_size, channel, width)*
+ * - **weight**: *(num_filter, channel, kernel[0])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * 3-D convolution adds an additional *depth* dimension besides *height* and
+ * *width*. The shapes are
+ *
+ * - **data**: *(batch_size, channel, depth, height, width)*
+ * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
+ * - **bias**: *(num_filter,)*
+ * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
+ *
+ * Both ``weight`` and ``bias`` are learnable parameters.
+ *
+ * There are other options to tune the performance.
+ *
+ * - **cudnn_tune**: enable this option leads to higher startup time but may give
+ * faster speed. Options are
+ *
+ * - **off**: no tuning
+ * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
+ * exceed workspace limit.
+ * - **fastest**: pick the fastest algorithm and ignore workspace limit.
+ * - **None** (default): the behavior is determined by environment variable
+ * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
+ * (default), 2 for fastest.
+ *
+ * - **workspace**: A large number leads to more (GPU) memory usage but may improve
+ * the performance.
+ *
+ *
+ *
+ * Defined in src/operator/nn/convolution.cc:L470
+ * @return org.apache.mxnet.Symbol + */ +def Convolution(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * This operator is DEPRECATED. Apply convolution to input then add a bias.
+ * @return org.apache.mxnet.Symbol + */ +def Convolution_v1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies correlation to inputs.
+ *
+ * The correlation layer performs multiplicative patch comparisons between two feature maps.
+ *
+ * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
+ * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
+ *
+ * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
+ * :math:`x_{2}` in the second map is then defined as:
+ *
+ * .. math::
+ *
+ * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
+ *
+ * for a square patch of size :math:`K:=2k+1`.
+ *
+ * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
+ * data. For this reason, it has no training weights.
+ *
+ * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
+ *
+ * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
+ * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
+ * centered around :math:`x_{1}`.
+ *
+ * The final output is defined by the following expression:
+ *
+ * .. math::
+ * out[n, q, i, j] = c(x_{i, j}, x_{q})
+ *
+ * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
+ *
+ *
+ * Defined in src/operator/correlation.cc:L198
+ * @return org.apache.mxnet.Symbol + */ +def Correlation(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + *
+ *
+ * .. note:: `Crop` is deprecated. Use `slice` instead.
+ *
+ * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
+ * with width and height of the second input symbol, i.e., with one input, we need h_w to
+ * specify the crop height and width, otherwise the second input symbol's size will be used
+ *
+ *
+ * Defined in src/operator/crop.cc:L50
+ * @return org.apache.mxnet.Symbol + */ +def Crop(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Apply a custom operator implemented in a frontend language (like Python).
+ *
+ * Custom operators should override required methods like `forward` and `backward`.
+ * The custom operator must be registered before it can be used.
+ * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
+ *
+ *
+ *
+ * Defined in src/operator/custom/custom.cc:L547
+ * @return org.apache.mxnet.Symbol + */ +def Custom(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
+ * @return org.apache.mxnet.Symbol + */ +def Deconvolution(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies dropout operation to input array.
+ *
+ * - During training, each element of the input is set to zero with probability p.
+ * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
+ * sum of the input unchanged.
+ *
+ * - During testing, this operator does not change the input if mode is 'training'.
+ * If mode is 'always', the same computaion as during training will be applied.
+ *
+ * Example::
+ *
+ * random.seed(998)
+ * input_array = array([[3., 0.5, -0.5, 2., 7.],
+ * [2., -0.4, 7., 3., 0.2]])
+ * a = symbol.Variable('a')
+ * dropout = symbol.Dropout(a, p = 0.2)
+ * executor = dropout.simple_bind(a = input_array.shape)
+ *
+ * ## If training
+ * executor.forward(is_train = True, a = input_array)
+ * executor.outputs
+ * [[ 3.75 0.625 -0. 2.5 8.75 ]
+ * [ 2.5 -0.5 8.75 3.75 0. ]]
+ *
+ * ## If testing
+ * executor.forward(is_train = False, a = input_array)
+ * executor.outputs
+ * [[ 3. 0.5 -0.5 2. 7. ]
+ * [ 2. -0.4 7. 3. 0.2 ]]
+ *
+ *
+ * Defined in src/operator/nn/dropout.cc:L76
+ * @return org.apache.mxnet.Symbol + */ +def Dropout(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @return org.apache.mxnet.Symbol + */ +def ElementWiseSum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Maps integer indices to vector representations (embeddings).
+ *
+ * This operator maps words to real-valued vectors in a high-dimensional space,
+ * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
+ * For example, it has been noted that in the learned embedding spaces, similar words tend
+ * to be close to each other and dissimilar words far apart.
+ *
+ * For an input array of shape (d1, ..., dK),
+ * the shape of an output array is (d1, ..., dK, output_dim).
+ * All the input values should be integers in the range [0, input_dim).
+ *
+ * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
+ * (ip0, op0).
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last vector in an embedding matrix.
+ *
+ * Examples::
+ *
+ * input_dim = 4
+ * output_dim = 5
+ *
+ * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
+ * y = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.],
+ * [ 10., 11., 12., 13., 14.],
+ * [ 15., 16., 17., 18., 19.]]
+ *
+ * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
+ * x = [[ 1., 3.],
+ * [ 0., 2.]]
+ *
+ * // Mapped input x to its vector representation y.
+ * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
+ * [ 15., 16., 17., 18., 19.]],
+ *
+ * [[ 0., 1., 2., 3., 4.],
+ * [ 10., 11., 12., 13., 14.]]]
+ *
+ *
+ * The storage type of weight can be either row_sparse or default, while
+ * the storage type of weight's grad depends on the value of "sparse_grad".
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L232
+ * @return org.apache.mxnet.Symbol + */ +def Embedding(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @return org.apache.mxnet.Symbol + */ +def Flatten(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies a linear transformation: :math:`Y = XW^T + b`.
+ *
+ * If ``flatten`` is set to be true, then the shapes are:
+ *
+ * - **data**: `(batch_size, x1, x2, ..., xn)`
+ * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(batch_size, num_hidden)`
+ *
+ * If ``flatten`` is set to be false, then the shapes are:
+ *
+ * - **data**: `(x1, x2, ..., xn, input_dim)`
+ * - **weight**: `(num_hidden, input_dim)`
+ * - **bias**: `(num_hidden,)`
+ * - **out**: `(x1, x2, ..., xn, num_hidden)`
+ *
+ * The learnable parameters include both ``weight`` and ``bias``.
+ *
+ * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
+ *
+ * Note that the operator also supports forward computation with `row_sparse` weight and bias,
+ * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
+ * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
+ *
+ *
+ *
+ * Defined in src/operator/nn/fully_connected.cc:L254
+ * @return org.apache.mxnet.Symbol + */ +def FullyConnected(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Generates 2D sampling grid for bilinear sampling.
+ * @return org.apache.mxnet.Symbol + */ +def GridGenerator(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Apply a sparse regularization to the output a sigmoid activation function.
+ * @return org.apache.mxnet.Symbol + */ +def IdentityAttachKLSparseReg(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies instance normalization to the n-dimensional input array.
+ *
+ * This operator takes an n-dimensional input array where (n>2) and normalizes
+ * the input using the following formula:
+ *
+ * .. math::
+ *
+ * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
+ *
+ * This layer is similar to batch normalization layer (`BatchNorm`)
+ * with two differences: first, the normalization is
+ * carried out per example (instance), not over a batch. Second, the
+ * same normalization is applied both at test and train time. This
+ * operation is also known as `contrast normalization`.
+ *
+ * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
+ * `gamma` and `beta` parameters must be vectors of shape [channel].
+ *
+ * This implementation is based on paper:
+ *
+ * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
+ * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
+ *
+ * Examples::
+ *
+ * // Input of shape (2,1,2)
+ * x = [[[ 1.1, 2.2]],
+ * [[ 3.3, 4.4]]]
+ *
+ * // gamma parameter of length 1
+ * gamma = [1.5]
+ *
+ * // beta parameter of length 1
+ * beta = [0.5]
+ *
+ * // Instance normalization is calculated with the above formula
+ * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
+ * [[-0.99752653, 1.99752724]]]
+ *
+ *
+ *
+ * Defined in src/operator/instance_norm.cc:L95
+ * @return org.apache.mxnet.Symbol + */ +def InstanceNorm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Normalize the input array using the L2 norm.
+ *
+ * For 1-D NDArray, it computes::
+ *
+ * out = data / sqrt(sum(data ** 2) + eps)
+ *
+ * For N-D NDArray, if the input array has shape (N, N, ..., N),
+ *
+ * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
+ * array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
+ *
+ * for i in 0...N
+ * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
+ *
+ * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
+ * in the array by its L2 norm.::
+ *
+ * for dim in 2...N
+ * for i in 0...N
+ * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
+ * -dim-
+ *
+ * Example::
+ *
+ * x = [[[1,2],
+ * [3,4]],
+ * [[2,2],
+ * [5,6]]]
+ *
+ * L2Normalization(x, mode='instance')
+ * =[[[ 0.18257418 0.36514837]
+ * [ 0.54772252 0.73029673]]
+ * [[ 0.24077171 0.24077171]
+ * [ 0.60192931 0.72231513]]]
+ *
+ * L2Normalization(x, mode='channel')
+ * =[[[ 0.31622776 0.44721359]
+ * [ 0.94868326 0.89442718]]
+ * [[ 0.37139067 0.31622776]
+ * [ 0.92847669 0.94868326]]]
+ *
+ * L2Normalization(x, mode='spatial')
+ * =[[[ 0.44721359 0.89442718]
+ * [ 0.60000002 0.80000001]]
+ * [[ 0.70710677 0.70710677]
+ * [ 0.6401844 0.76822126]]]
+ *
+ *
+ *
+ * Defined in src/operator/l2_normalization.cc:L98
+ * @return org.apache.mxnet.Symbol + */ +def L2Normalization(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies local response normalization to the input.
+ *
+ * The local response normalization layer performs "lateral inhibition" by normalizing
+ * over local input regions.
+ *
+ * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
+ * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
+ * activity :math:`b_{x,y}^{i}` is given by the expression:
+ *
+ * .. math::
+ * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
+ *
+ * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
+ * number of kernels in the layer.
+ *
+ *
+ *
+ * Defined in src/operator/nn/lrn.cc:L175
+ * @return org.apache.mxnet.Symbol + */ +def LRN(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Layer normalization.
+ *
+ * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
+ * well as offset ``beta``.
+ *
+ * Assume the input has more than one dimension and we normalize along axis 1.
+ * We first compute the mean and variance along this axis and then
+ * compute the normalized output, which has the same shape as input, as following:
+ *
+ * .. math::
+ *
+ * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
+ *
+ * Both ``gamma`` and ``beta`` are learnable parameters.
+ *
+ * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
+ *
+ * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
+ * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
+ * ``data_std``. Note that no gradient will be passed through these two outputs.
+ *
+ * The parameter ``axis`` specifies which axis of the input shape denotes
+ * the 'channel' (separately normalized groups). The default is -1, which sets the channel
+ * axis to be the last item in the input shape.
+ *
+ *
+ *
+ * Defined in src/operator/nn/layer_norm.cc:L94
+ * @return org.apache.mxnet.Symbol + */ +def LayerNorm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies Leaky rectified linear unit activation element-wise to the input.
+ *
+ * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
+ * when the input is negative and has a slope of one when input is positive.
+ *
+ * The following modified ReLU Activation functions are supported:
+ *
+ * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
+ * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
+ * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
+ * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
+ * *[lower_bound, upper_bound)* for training, while fixed to be
+ * *(lower_bound+upper_bound)/2* for inference.
+ *
+ *
+ *
+ * Defined in src/operator/leaky_relu.cc:L63
+ * @return org.apache.mxnet.Symbol + */ +def LeakyReLU(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes and optimizes for squared loss during backward propagation.
+ * Just outputs ``data`` during forward propagation.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the squared loss estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
+ *
+ * .. note::
+ * Use the LinearRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LinearRegressionOutput(default, default) = default
+ * - LinearRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L92
+ * @return org.apache.mxnet.Symbol + */ +def LinearRegressionOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies a logistic function to the input.
+ *
+ * The logistic function, also known as the sigmoid function, is computed as
+ * :math:`\frac{1}{1+exp(-\textbf{x})}`.
+ *
+ * Commonly, the sigmoid is used to squash the real-valued output of a linear model
+ * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
+ * It is suitable for binary classification or probability prediction tasks.
+ *
+ * .. note::
+ * Use the LogisticRegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - LogisticRegressionOutput(default, default) = default
+ * - LogisticRegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L148
+ * @return org.apache.mxnet.Symbol + */ +def LogisticRegressionOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes mean absolute error of the input.
+ *
+ * MAE is a risk metric corresponding to the expected value of the absolute error.
+ *
+ * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
+ * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
+ *
+ * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
+ *
+ * .. note::
+ * Use the MAERegressionOutput as the final output layer of a net.
+ *
+ * The storage type of ``label`` can be ``default`` or ``csr``
+ *
+ * - MAERegressionOutput(default, default) = default
+ * - MAERegressionOutput(default, csr) = default
+ *
+ * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
+ * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
+ *
+ *
+ *
+ * Defined in src/operator/regression_output.cc:L120
+ * @return org.apache.mxnet.Symbol + */ +def MAERegressionOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = MakeLoss(cross_entropy)
+ *
+ * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * In addition, we can give a scale to the loss by setting ``grad_scale``,
+ * so that the gradient of the loss will be rescaled in the backpropagation.
+ *
+ * .. note:: This operator should be used as a Symbol instead of NDArray.
+ *
+ *
+ *
+ * Defined in src/operator/make_loss.cc:L71
+ * @return org.apache.mxnet.Symbol + */ +def MakeLoss(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @return org.apache.mxnet.Symbol + */ +def Pad(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Performs pooling on the input.
+ *
+ * The shapes for 1-D pooling are
+ *
+ * - **data**: *(batch_size, channel, width)*,
+ * - **out**: *(batch_size, num_filter, out_width)*.
+ *
+ * The shapes for 2-D pooling are
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ * - **lp**: Lp pooling
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ * Notes on Lp pooling:
+ *
+ * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
+ * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
+ * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
+ *
+ * For each window ``X``, the mathematical expression for Lp pooling is:
+ *
+ * ..math::
+ * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
+ *
+ *
+ *
+ * Defined in src/operator/nn/pooling.cc:L367
+ * @return org.apache.mxnet.Symbol + */ +def Pooling(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * This operator is DEPRECATED.
+ * Perform pooling on the input.
+ *
+ * The shapes for 2-D pooling is
+ *
+ * - **data**: *(batch_size, channel, height, width)*
+ * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
+ *
+ * out_height = f(height, kernel[0], pad[0], stride[0])
+ * out_width = f(width, kernel[1], pad[1], stride[1])
+ *
+ * The definition of *f* depends on ``pooling_convention``, which has two options:
+ *
+ * - **valid** (default)::
+ *
+ * f(x, k, p, s) = floor((x+2*p-k)/s)+1
+ *
+ * - **full**, which is compatible with Caffe::
+ *
+ * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
+ *
+ * But ``global_pool`` is set to be true, then do a global pooling, namely reset
+ * ``kernel=(height, width)``.
+ *
+ * Three pooling options are supported by ``pool_type``:
+ *
+ * - **avg**: average pooling
+ * - **max**: max pooling
+ * - **sum**: sum pooling
+ *
+ * 1-D pooling is special case of 2-D pooling with *weight=1* and
+ * *kernel[1]=1*.
+ *
+ * For 3-D pooling, an additional *depth* dimension is added before
+ * *height*. Namely the input data will have shape *(batch_size, channel, depth,
+ * height, width)*.
+ *
+ *
+ *
+ * Defined in src/operator/pooling_v1.cc:L104
+ * @return org.apache.mxnet.Symbol + */ +def Pooling_v1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
+ * implemented, with both multi-layer and bidirectional support.
+ *
+ * **Vanilla RNN**
+ *
+ * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
+ * ReLU and Tanh.
+ *
+ * With ReLU activation function:
+ *
+ * .. math::
+ * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * With Tanh activtion function:
+ *
+ * .. math::
+ * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
+ *
+ * Reference paper: Finding structure in time - Elman, 1988.
+ * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
+ *
+ * **LSTM**
+ *
+ * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
+ * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
+ * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
+ * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
+ * c_t = f_t * c_{(t-1)} + i_t * g_t \\
+ * h_t = o_t * \tanh(c_t)
+ * \end{array}
+ *
+ * **GRU**
+ *
+ * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
+ *
+ * The definition of GRU here is slightly different from paper but compatible with CUDNN.
+ *
+ * .. math::
+ * \begin{array}{ll}
+ * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
+ * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
+ * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
+ * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
+ * \end{array}
+ * @return org.apache.mxnet.Symbol + */ +def RNN(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Performs region of interest(ROI) pooling on the input array.
+ *
+ * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
+ * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
+ * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
+ * layer mostly used in training a `Fast R-CNN` network for object detection.
+ *
+ * This operator takes a 4D feature map as an input array and region proposals as `rois`,
+ * then it pools over sub-regions of input and produces a fixed-sized output array
+ * regardless of the ROI size.
+ *
+ * To crop the feature map accordingly, you can resize the bounding box coordinates
+ * by changing the parameters `rois` and `spatial_scale`.
+ *
+ * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
+ * indicated by a `pooled_size` parameter. batch_size will change to the number of region
+ * bounding boxes after `ROIPooling`.
+ *
+ * The size of each region of interest doesn't have to be perfectly divisible by
+ * the number of pooling sections(`pooled_size`).
+ *
+ * Example::
+ *
+ * x = [[[[ 0., 1., 2., 3., 4., 5.],
+ * [ 6., 7., 8., 9., 10., 11.],
+ * [ 12., 13., 14., 15., 16., 17.],
+ * [ 18., 19., 20., 21., 22., 23.],
+ * [ 24., 25., 26., 27., 28., 29.],
+ * [ 30., 31., 32., 33., 34., 35.],
+ * [ 36., 37., 38., 39., 40., 41.],
+ * [ 42., 43., 44., 45., 46., 47.]]]]
+ *
+ * // region of interest i.e. bounding box coordinates.
+ * y = [[0,0,0,4,4]]
+ *
+ * // returns array of shape (2,2) according to the given roi with max pooling.
+ * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
+ * [ 26., 28.]]]]
+ *
+ * // region of interest is changed due to the change in `spacial_scale` parameter.
+ * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
+ * [ 19., 21.]]]]
+ *
+ *
+ *
+ * Defined in src/operator/roi_pooling.cc:L295
+ * @return org.apache.mxnet.Symbol + */ +def ROIPooling(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @return org.apache.mxnet.Symbol + */ +def Reshape(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes support vector machine based transformation of the input.
+ *
+ * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
+ * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
+ * @return org.apache.mxnet.Symbol + */ +def SVMOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Takes the last element of a sequence.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
+ * of the form [batch_size, other_feature_dims].
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
+ * an input array of positive ints of dimension [batch_size]. To use this parameter,
+ * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
+ * to have the max sequence length.
+ *
+ * .. note:: Alternatively, you can also use `take` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]],
+ *
+ * [[ 10., 11., 12.],
+ * [ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]]
+ *
+ * // returns last sequence when sequence_length parameter is not used
+ * SequenceLast(x) = [[ 19., 20., 21.],
+ * [ 22., 23., 24.],
+ * [ 25., 26., 27.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.],
+ * [ 7., 8., 9.]]
+ *
+ * // sequence_length is used
+ * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
+ * [[ 1., 2., 3.],
+ * [ 13., 14., 15.],
+ * [ 25., 26., 27.]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_last.cc:L92
+ * @return org.apache.mxnet.Symbol + */ +def SequenceLast(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Sets all elements outside the sequence to a constant value.
+ *
+ * This function takes an n-dimensional input array of the form
+ * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
+ * should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length and
+ * this operator works as the `identity` operator.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // works as identity operator when sequence_length parameter is not used
+ * SequenceMask(x) = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [1,1] means 1 of each batch will be kept
+ * // and other rows are masked with default mask value = 0
+ * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]],
+ *
+ * [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
+ * // and other rows are masked with value = 1
+ * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
+ * [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 1., 1.],
+ * [ 16., 17., 18.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_mask.cc:L114
+ * @return org.apache.mxnet.Symbol + */ +def SequenceMask(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Reverses the elements of each sequence.
+ *
+ * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
+ * and returns an array of the same shape.
+ *
+ * Parameter `sequence_length` is used to handle variable-length sequences.
+ * `sequence_length` should be an input array of positive ints of dimension [batch_size].
+ * To use this parameter, set `use_sequence_length` to `True`,
+ * otherwise each example in the batch is assumed to have the max sequence length.
+ *
+ * Example::
+ *
+ * x = [[[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // Batch 1
+ * B1 = [[ 1., 2., 3.],
+ * [ 7., 8., 9.],
+ * [ 13., 14., 15.]]
+ *
+ * // Batch 2
+ * B2 = [[ 4., 5., 6.],
+ * [ 10., 11., 12.],
+ * [ 16., 17., 18.]]
+ *
+ * // returns reverse sequence when sequence_length parameter is not used
+ * SequenceReverse(x) = [[[ 13., 14., 15.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]]]
+ *
+ * // sequence_length [2,2] means 2 rows of
+ * // both batch B1 and B2 will be reversed.
+ * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 4., 5., 6.]],
+ *
+ * [[ 13., 14., 15.],
+ * [ 16., 17., 18.]]]
+ *
+ * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
+ * // will be reversed.
+ * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
+ * [[[ 7., 8., 9.],
+ * [ 16., 17., 18.]],
+ *
+ * [[ 1., 2., 3.],
+ * [ 10., 11., 12.]],
+ *
+ * [[ 13., 14, 15.],
+ * [ 4., 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/sequence_reverse.cc:L113
+ * @return org.apache.mxnet.Symbol + */ +def SequenceReverse(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @return org.apache.mxnet.Symbol + */ +def SliceChannel(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Please use `SoftmaxOutput`.
+ *
+ * .. note::
+ *
+ * This operator has been renamed to `SoftmaxOutput`, which
+ * computes the gradient of cross-entropy loss w.r.t softmax output.
+ * To just compute softmax output, use the `softmax` operator.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L138
+ * @return org.apache.mxnet.Symbol + */ +def Softmax(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies softmax activation to input. This is intended for internal layers.
+ *
+ * .. note::
+ *
+ * This operator has been deprecated, please use `softmax`.
+ *
+ * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
+ * This is the default mode.
+ *
+ * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
+ * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
+ * has at least 3 dimensions.
+ * This can be used for `fully convolutional network`, `image segmentation`, etc.
+ *
+ * Example::
+ *
+ * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
+ * >>> [2., -.4, 7., 3., 0.2]])
+ * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
+ * >>> print softmax_act.asnumpy()
+ * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
+ * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax_activation.cc:L59
+ * @return org.apache.mxnet.Symbol + */ +def SoftmaxActivation(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the gradient of cross entropy loss with respect to softmax output.
+ *
+ * - This operator computes the gradient in two steps.
+ * The cross entropy loss does not actually need to be computed.
+ *
+ * - Applies softmax function on the input array.
+ * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
+ *
+ * - The softmax function, cross entropy loss and gradient is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * - The gradient of cross entropy loss w.r.t softmax output:
+ *
+ * .. math:: \text{gradient} = \text{output} - \text{label}
+ *
+ * - During forward propagation, the softmax function is computed for each instance in the input array.
+ *
+ * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
+ * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
+ * and `multi_output` to specify the way to compute softmax:
+ *
+ * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
+ * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
+ * each row in the reshaped array, and afterwards reshape it back to the original shape
+ * :math:`(d_1, d_2, ..., d_n)`.
+ * - If `preserve_shape` is ``true``, the softmax function will be computed along
+ * the last axis (`axis` = ``-1``).
+ * - If `multi_output` is ``true``, the softmax function will be computed along
+ * the second axis (`axis` = ``1``).
+ *
+ * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
+ * The provided label can be a one-hot label array or a probability label array.
+ *
+ * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
+ * with a particular label to be ignored during backward propagation. **This has no effect when
+ * softmax `output` has same shape as `label`**.
+ *
+ * Example::
+ *
+ * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
+ * label = [1,0,2,3]
+ * ignore_label = 1
+ * SoftmaxOutput(data=data, label = label,\
+ * multi_output=true, use_ignore=true,\
+ * ignore_label=ignore_label)
+ * ## forward softmax output
+ * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]
+ * [ 0.25 0.25 0.25 0.25 ]]
+ * ## backward gradient output
+ * [[ 0. 0. 0. 0. ]
+ * [-0.75 0.25 0.25 0.25]
+ * [ 0.25 0.25 -0.75 0.25]
+ * [ 0.25 0.25 0.25 -0.75]]
+ * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
+ *
+ * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
+ * give each loss function different weights.
+ *
+ * - This operator also supports various ways to normalize the gradient by `normalization`,
+ * The `normalization` is applied if softmax output has different shape than the labels.
+ * The `normalization` mode can be set to the followings:
+ *
+ * - ``'null'``: do nothing.
+ * - ``'batch'``: divide the gradient by the batch size.
+ * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
+ *
+ *
+ *
+ * Defined in src/operator/softmax_output.cc:L123
+ * @return org.apache.mxnet.Symbol + */ +def SoftmaxOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies a spatial transformer to input feature map.
+ * @return org.apache.mxnet.Symbol + */ +def SpatialTransformer(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @return org.apache.mxnet.Symbol + */ +def SwapAxis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Performs nearest neighbor/bilinear up sampling to inputs.
+ * @return org.apache.mxnet.Symbol + */ +def UpSampling(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise absolute value of the input.
+ *
+ * Example::
+ *
+ * abs([-2, 0, 3]) = [2, 0, 3]
+ *
+ * The storage type of ``abs`` output depends upon the input storage type:
+ *
+ * - abs(default) = default
+ * - abs(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
+ * @return org.apache.mxnet.Symbol + */ +def abs(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Update function for Adam optimizer. Adam is seen as a generalization
+ * of AdaGrad.
+ *
+ * Adam update consists of the following steps, where g represents gradient and m, v
+ * are 1st and 2nd order moment estimates (mean and variance).
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
+ *
+ * It updates the weights using::
+ *
+ * m = beta1*m + (1-beta1)*grad
+ * v = beta2*v + (1-beta2)*(grad**2)
+ * w += - learning_rate * m / (sqrt(v) + epsilon)
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
+ * type of weight is the same as those of m and v,
+ * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
+ *
+ * for row in grad.indices:
+ * m[row] = beta1*m[row] + (1-beta1)*grad[row]
+ * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
+ * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L495
+ * @return org.apache.mxnet.Symbol + */ +def adam_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Adds all input arguments element-wise.
+ *
+ * .. math::
+ * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
+ *
+ * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
+ *
+ * The storage type of ``add_n`` output depends on storage types of inputs
+ *
+ * - add_n(row_sparse, row_sparse, ..) = row_sparse
+ * - otherwise, ``add_n`` generates output with default storage
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_sum.cc:L150
+ * @return org.apache.mxnet.Symbol + */ +def add_n(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise inverse cosine of the input array.
+ *
+ * The input should be in range `[-1, 1]`.
+ * The output is in the closed interval :math:`[0, \pi]`
+ *
+ * .. math::
+ * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
+ *
+ * The storage type of ``arccos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
+ * @return org.apache.mxnet.Symbol + */ +def arccos(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the element-wise inverse hyperbolic cosine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arccosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
+ * @return org.apache.mxnet.Symbol + */ +def arccosh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise inverse sine of the input array.
+ *
+ * The input should be in the range `[-1, 1]`.
+ * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
+ *
+ * .. math::
+ * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
+ *
+ * The storage type of ``arcsin`` output depends upon the input storage type:
+ *
+ * - arcsin(default) = default
+ * - arcsin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
+ * @return org.apache.mxnet.Symbol + */ +def arcsin(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the element-wise inverse hyperbolic sine of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arcsinh`` output depends upon the input storage type:
+ *
+ * - arcsinh(default) = default
+ * - arcsinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
+ * @return org.apache.mxnet.Symbol + */ +def arcsinh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise inverse tangent of the input array.
+ *
+ * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
+ *
+ * .. math::
+ * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
+ *
+ * The storage type of ``arctan`` output depends upon the input storage type:
+ *
+ * - arctan(default) = default
+ * - arctan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
+ * @return org.apache.mxnet.Symbol + */ +def arctan(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the element-wise inverse hyperbolic tangent of the input array, \
+ * computed element-wise.
+ *
+ * The storage type of ``arctanh`` output depends upon the input storage type:
+ *
+ * - arctanh(default) = default
+ * - arctanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
+ * @return org.apache.mxnet.Symbol + */ +def arctanh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns indices of the maximum values along an axis.
+ *
+ * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmax along axis 0
+ * argmax(x, axis=0) = [ 1., 1., 1.]
+ *
+ * // argmax along axis 1
+ * argmax(x, axis=1) = [ 2., 2.]
+ *
+ * // argmax along axis 1 keeping same dims as an input array
+ * argmax(x, axis=1, keepdims=True) = [[ 2.],
+ * [ 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
+ * @return org.apache.mxnet.Symbol + */ +def argmax(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns argmax indices of each channel from the input array.
+ *
+ * The result will be an NDArray of shape (num_channel,).
+ *
+ * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * argmax_channel(x) = [ 2., 2.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
+ * @return org.apache.mxnet.Symbol + */ +def argmax_channel(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns indices of the minimum values along an axis.
+ *
+ * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
+ * are returned.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2.],
+ * [ 3., 4., 5.]]
+ *
+ * // argmin along axis 0
+ * argmin(x, axis=0) = [ 0., 0., 0.]
+ *
+ * // argmin along axis 1
+ * argmin(x, axis=1) = [ 0., 0.]
+ *
+ * // argmin along axis 1 keeping same dims as an input array
+ * argmin(x, axis=1, keepdims=True) = [[ 0.],
+ * [ 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
+ * @return org.apache.mxnet.Symbol + */ +def argmin(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the indices that would sort an input array along the given axis.
+ *
+ * This function performs sorting along the given axis and returns an array of indices having same shape
+ * as an input array that index data in sorted order.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // sort along axis -1
+ * argsort(x) = [[ 1., 0., 2.],
+ * [ 0., 2., 1.]]
+ *
+ * // sort along axis 0
+ * argsort(x, axis=0) = [[ 1., 0., 1.]
+ * [ 0., 1., 0.]]
+ *
+ * // flatten and then sort
+ * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L176
+ * @return org.apache.mxnet.Symbol + */ +def argsort(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Batchwise dot product.
+ *
+ * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
+ * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
+ *
+ * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
+ * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
+ * which is computed by::
+ *
+ * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L117
+ * @return org.apache.mxnet.Symbol + */ +def batch_dot(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Takes elements from a data batch.
+ *
+ * .. note::
+ * `batch_take` is deprecated. Use `pick` instead.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // takes elements with specified indices
+ * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L444
+ * @return org.apache.mxnet.Symbol + */ +def batch_take(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_add(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_axes(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Broadcasts the input array over particular axes.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * Example::
+ *
+ * // given x of shape (1,2,1)
+ * x = [[[ 1.],
+ * [ 2.]]]
+ *
+ * // broadcast x on on axis 2
+ * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ * // broadcast x on on axes 0 and 2
+ * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
+ * [ 2., 2., 2.]],
+ * [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]]
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise division of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 6., 6., 6.],
+ * [ 6., 6., 6.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_div(x, y) = [[ 3., 3., 3.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_div(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_div(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_equal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_greater(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_greater_equal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the hypotenuse of a right angled triangle, given its "legs"
+ * with broadcasting.
+ *
+ * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
+ *
+ * Example::
+ *
+ * x = [[ 3., 3., 3.]]
+ *
+ * y = [[ 4.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, y) = [[ 5., 5., 5.],
+ * [ 5., 5., 5.]]
+ *
+ * z = [[ 0.],
+ * [ 4.]]
+ *
+ * broadcast_hypot(x, z) = [[ 3., 3., 3.],
+ * [ 5., 5., 5.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_hypot(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser(x, y) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_lesser(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_lesser_equal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **logical and** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_logical_and(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **logical or** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_logical_or(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **logical xor** with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 0.],
+ * [ 1., 1., 0.]]
+ *
+ * y = [[ 1.],
+ * [ 0.]]
+ *
+ * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
+ * [ 1., 1., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_logical_xor(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise maximum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise maxima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_maximum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise minimum of the input arrays with broadcasting.
+ *
+ * This function compares two input arrays and returns a new array having the element-wise minima.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_maximum(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_minimum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_minus(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise modulo of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 8., 8., 8.],
+ * [ 8., 8., 8.]]
+ *
+ * y = [[ 2.],
+ * [ 3.]]
+ *
+ * broadcast_mod(x, y) = [[ 0., 0., 0.],
+ * [ 2., 2., 2.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_mod(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise product of the input arrays with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_mul(x, y) = [[ 0., 0., 0.],
+ * [ 1., 1., 1.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_mul(csr, dense(1D)) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_mul(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_not_equal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise sum of the input arrays with broadcasting.
+ *
+ * `broadcast_plus` is an alias to the function `broadcast_add`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_add(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * broadcast_plus(x, y) = [[ 1., 1., 1.],
+ * [ 2., 2., 2.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_add(csr, dense(1D)) = dense
+ * broadcast_add(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_plus(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_power(x, y) = [[ 2., 2., 2.],
+ * [ 4., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_power(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise difference of the input arrays with broadcasting.
+ *
+ * `broadcast_minus` is an alias to the function `broadcast_sub`.
+ *
+ * Example::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * y = [[ 0.],
+ * [ 1.]]
+ *
+ * broadcast_sub(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * broadcast_minus(x, y) = [[ 1., 1., 1.],
+ * [ 0., 0., 0.]]
+ *
+ * Supported sparse operations:
+ *
+ * broadcast_sub/minus(csr, dense(1D)) = dense
+ * broadcast_sub/minus(dense(1D), csr) = dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_sub(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Broadcasts the input array to a new shape.
+ *
+ * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
+ * with arrays of different shapes efficiently without creating multiple copies of arrays.
+ * Also see, `Broadcasting `_ for more explanation.
+ *
+ * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
+ * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
+ *
+ * For example::
+ *
+ * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
+ * [ 1., 2., 3.]])
+ *
+ * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
+ * So with `shape=(2,0)`, we will obtain the same result as in the above example.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
+ * @return org.apache.mxnet.Symbol + */ +def broadcast_to(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Casts all elements of the input to a new type.
+ *
+ * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
+ *
+ * Example::
+ *
+ * cast([0.9, 1.3], dtype='int32') = [0, 1]
+ * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
+ * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
+ * @return org.apache.mxnet.Symbol + */ +def cast(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Casts tensor storage type to the new type.
+ *
+ * When an NDArray with default storage type is cast to csr or row_sparse storage,
+ * the result is compact, which means:
+ *
+ * - for csr, zero values will not be retained
+ * - for row_sparse, row slices of all zeros will not be retained
+ *
+ * The storage type of ``cast_storage`` output depends on stype parameter:
+ *
+ * - cast_storage(csr, 'default') = default
+ * - cast_storage(row_sparse, 'default') = default
+ * - cast_storage(default, 'csr') = csr
+ * - cast_storage(default, 'row_sparse') = row_sparse
+ * - cast_storage(csr, 'csr') = csr
+ * - cast_storage(row_sparse, 'row_sparse') = row_sparse
+ *
+ * Example::
+ *
+ * dense = [[ 0., 1., 0.],
+ * [ 2., 0., 3.],
+ * [ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * # cast to row_sparse storage type
+ * rsp = cast_storage(dense, 'row_sparse')
+ * rsp.indices = [0, 1]
+ * rsp.values = [[ 0., 1., 0.],
+ * [ 2., 0., 3.]]
+ *
+ * # cast to csr storage type
+ * csr = cast_storage(dense, 'csr')
+ * csr.indices = [1, 0, 2]
+ * csr.values = [ 1., 2., 3.]
+ * csr.indptr = [0, 1, 3, 3, 3]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/cast_storage.cc:L71
+ * @return org.apache.mxnet.Symbol + */ +def cast_storage(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise cube-root value of the input.
+ *
+ * .. math::
+ * cbrt(x) = \sqrt[3]{x}
+ *
+ * Example::
+ *
+ * cbrt([1, 8, -125]) = [1, 2, -5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
+ * @return org.apache.mxnet.Symbol + */ +def cbrt(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise ceiling of the input.
+ *
+ * The ceil of the scalar x is the smallest integer i, such that i >= x.
+ *
+ * Example::
+ *
+ * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
+ *
+ * The storage type of ``ceil`` output depends upon the input storage type:
+ *
+ * - ceil(default) = default
+ * - ceil(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
+ * @return org.apache.mxnet.Symbol + */ +def ceil(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
+ * @return org.apache.mxnet.Symbol + */ +def choose_element_0index(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Clips (limits) the values in an array.
+ *
+ * Given an interval, values outside the interval are clipped to the interval edges.
+ * Clipping ``x`` between `a_min` and `a_x` would be::
+ *
+ * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
+ *
+ * Example::
+ *
+ * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+ *
+ * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
+ *
+ * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
+ * parameter values:
+ *
+ * - clip(default) = default
+ * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
+ * - clip(csr, a_min <= 0, a_max >= 0) = csr
+ * - clip(row_sparse, a_min < 0, a_max < 0) = default
+ * - clip(row_sparse, a_min > 0, a_max > 0) = default
+ * - clip(csr, a_min < 0, a_max < 0) = csr
+ * - clip(csr, a_min > 0, a_max > 0) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L617
+ * @return org.apache.mxnet.Symbol + */ +def clip(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Joins input arrays along a given axis.
+ *
+ * .. note:: `Concat` is deprecated. Use `concat` instead.
+ *
+ * The dimensions of the input arrays should be the same except the axis along
+ * which they will be concatenated.
+ * The dimension of the output array along the concatenated axis will be equal
+ * to the sum of the corresponding dimensions of the input arrays.
+ *
+ * The storage type of ``concat`` output depends on storage types of inputs
+ *
+ * - concat(csr, csr, ..., csr, dim=0) = csr
+ * - otherwise, ``concat`` generates output with default storage
+ *
+ * Example::
+ *
+ * x = [[1,1],[2,2]]
+ * y = [[3,3],[4,4],[5,5]]
+ * z = [[6,6], [7,7],[8,8]]
+ *
+ * concat(x,y,z,dim=0) = [[ 1., 1.],
+ * [ 2., 2.],
+ * [ 3., 3.],
+ * [ 4., 4.],
+ * [ 5., 5.],
+ * [ 6., 6.],
+ * [ 7., 7.],
+ * [ 8., 8.]]
+ *
+ * Note that you cannot concat x,y,z along dimension 1 since dimension
+ * 0 is not the same for all the input arrays.
+ *
+ * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
+ * [ 4., 4., 7., 7.],
+ * [ 5., 5., 8., 8.]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/concat.cc:L260
+ * @return org.apache.mxnet.Symbol + */ +def concat(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the element-wise cosine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
+ *
+ * The storage type of ``cos`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
+ * @return org.apache.mxnet.Symbol + */ +def cos(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the hyperbolic cosine of the input array, computed element-wise.
+ *
+ * .. math::
+ * cosh(x) = 0.5\times(exp(x) + exp(-x))
+ *
+ * The storage type of ``cosh`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
+ * @return org.apache.mxnet.Symbol + */ +def cosh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @return org.apache.mxnet.Symbol + */ +def crop(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Converts each element of the input array from radians to degrees.
+ *
+ * .. math::
+ * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
+ *
+ * The storage type of ``degrees`` output depends upon the input storage type:
+ *
+ * - degrees(default) = default
+ * - degrees(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
+ * @return org.apache.mxnet.Symbol + */ +def degrees(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Dot product of two arrays.
+ *
+ * ``dot``'s behavior depends on the input array dimensions:
+ *
+ * - 1-D arrays: inner product of vectors
+ * - 2-D arrays: matrix multiplication
+ * - N-D arrays: a sum product over the last axis of the first input and the first
+ * axis of the second input
+ *
+ * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
+ * result array will have shape `(n,m,r,s)`. It is computed by::
+ *
+ * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
+ *
+ * Example::
+ *
+ * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
+ * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
+ * dot(x,y)[0,0,1,1] = 0
+ * sum(x[0,0,:]*y[:,1,1]) = 0
+ *
+ * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
+ * forward_stype option for output storage type. Implemented sparse operations include:
+ *
+ * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
+ * - dot(csr, default, transpose_a=True) = default
+ * - dot(csr, default, transpose_a=True) = row_sparse
+ * - dot(csr, default) = default
+ * - dot(csr, row_sparse) = default
+ * - dot(default, csr) = csr (CPU only)
+ * - dot(default, csr, forward_stype='default') = default
+ * - dot(default, csr, transpose_b=True, forward_stype='default') = default
+ *
+ * If the combination of input storage types and forward_stype does not match any of the
+ * above patterns, ``dot`` will fallback and generate output with default storage.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/dot.cc:L69
+ * @return org.apache.mxnet.Symbol + */ +def dot(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Adds arguments element-wise.
+ *
+ * The storage type of ``elemwise_add`` output depends on storage types of inputs
+ *
+ * - elemwise_add(row_sparse, row_sparse) = row_sparse
+ * - elemwise_add(csr, csr) = csr
+ * - elemwise_add(default, csr) = default
+ * - elemwise_add(csr, default) = default
+ * - elemwise_add(default, rsp) = default
+ * - elemwise_add(rsp, default) = default
+ * - otherwise, ``elemwise_add`` generates output with default storage
+ * @return org.apache.mxnet.Symbol + */ +def elemwise_add(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Divides arguments element-wise.
+ *
+ * The storage type of ``elemwise_div`` output is always dense
+ * @return org.apache.mxnet.Symbol + */ +def elemwise_div(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Multiplies arguments element-wise.
+ *
+ * The storage type of ``elemwise_mul`` output depends on storage types of inputs
+ *
+ * - elemwise_mul(default, default) = default
+ * - elemwise_mul(row_sparse, row_sparse) = row_sparse
+ * - elemwise_mul(default, row_sparse) = row_sparse
+ * - elemwise_mul(row_sparse, default) = row_sparse
+ * - elemwise_mul(csr, csr) = csr
+ * - otherwise, ``elemwise_mul`` generates output with default storage
+ * @return org.apache.mxnet.Symbol + */ +def elemwise_mul(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Subtracts arguments element-wise.
+ *
+ * The storage type of ``elemwise_sub`` output depends on storage types of inputs
+ *
+ * - elemwise_sub(row_sparse, row_sparse) = row_sparse
+ * - elemwise_sub(csr, csr) = csr
+ * - elemwise_sub(default, csr) = default
+ * - elemwise_sub(csr, default) = default
+ * - elemwise_sub(default, rsp) = default
+ * - elemwise_sub(rsp, default) = default
+ * - otherwise, ``elemwise_sub`` generates output with default storage
+ * @return org.apache.mxnet.Symbol + */ +def elemwise_sub(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise exponential value of the input.
+ *
+ * .. math::
+ * exp(x) = e^x \approx 2.718^x
+ *
+ * Example::
+ *
+ * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
+ *
+ * The storage type of ``exp`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
+ * @return org.apache.mxnet.Symbol + */ +def exp(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Inserts a new axis of size 1 into the array shape
+ *
+ * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
+ * will return a new array with shape ``(2,1,3,4)``.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L346
+ * @return org.apache.mxnet.Symbol + */ +def expand_dims(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns ``exp(x) - 1`` computed element-wise on the input.
+ *
+ * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
+ *
+ * The storage type of ``expm1`` output depends upon the input storage type:
+ *
+ * - expm1(default) = default
+ * - expm1(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
+ * @return org.apache.mxnet.Symbol + */ +def expm1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
+ * @return org.apache.mxnet.Symbol + */ +def fill_element_0index(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise rounded value to the nearest \
+ * integer towards zero of the input.
+ *
+ * Example::
+ *
+ * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
+ *
+ * The storage type of ``fix`` output depends upon the input storage type:
+ *
+ * - fix(default) = default
+ * - fix(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
+ * @return org.apache.mxnet.Symbol + */ +def fix(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Flattens the input array into a 2-D array by collapsing the higher dimensions.
+ *
+ * .. note:: `Flatten` is deprecated. Use `flatten` instead.
+ *
+ * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
+ * the input array into an output array of shape ``(d1, d2*...*dk)``.
+ *
+ * Note that the bahavior of this function is different from numpy.ndarray.flatten,
+ * which behaves similar to mxnet.ndarray.reshape((-1,)).
+ *
+ * Example::
+ *
+ * x = [[
+ * [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ],
+ * [ [1,2,3],
+ * [4,5,6],
+ * [7,8,9]
+ * ]],
+ *
+ * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
+ * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L258
+ * @return org.apache.mxnet.Symbol + */ +def flatten(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @return org.apache.mxnet.Symbol + */ +def flip(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise floor of the input.
+ *
+ * The floor of the scalar x is the largest integer i, such that i <= x.
+ *
+ * Example::
+ *
+ * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
+ *
+ * The storage type of ``floor`` output depends upon the input storage type:
+ *
+ * - floor(default) = default
+ * - floor(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
+ * @return org.apache.mxnet.Symbol + */ +def floor(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * The FTML optimizer described in
+ * *FTML - Follow the Moving Leader in Deep Learning*,
+ * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
+ * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
+ * \sigma_t = d_t - \beta_1 d_{t-1}
+ * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
+ * W_t = - \frac{ z_t }{ d_t }
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L447
+ * @return org.apache.mxnet.Symbol + */ +def ftml_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Update function for Ftrl optimizer.
+ * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
+ * http://dl.acm.org/citation.cfm?id=2488200.
+ *
+ * It updates the weights using::
+ *
+ * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
+ * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
+ * n += rescaled_grad**2
+ * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
+ *
+ * If w, z and n are all of ``row_sparse`` storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
+ *
+ * for row in grad.indices:
+ * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
+ * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
+ * n[row] += rescaled_grad[row]**2
+ * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L632
+ * @return org.apache.mxnet.Symbol + */ +def ftrl_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the gamma function (extension of the factorial function \
+ * to the reals), computed element-wise on the input array.
+ *
+ * The storage type of ``gamma`` output is always dense
+ * @return org.apache.mxnet.Symbol + */ +def gamma(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise log of the absolute value of the gamma function \
+ * of the input.
+ *
+ * The storage type of ``gammaln`` output is always dense
+ * @return org.apache.mxnet.Symbol + */ +def gammaln(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Gather elements or slices from `data` and store to a tensor whose
+ * shape is defined by `indices`.
+ *
+ * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}]
+ *
+ * Examples::
+ *
+ * data = [[0, 1], [2, 3]]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * gather_nd(data, indices) = [2, 3, 0]
+ * @return org.apache.mxnet.Symbol + */ +def gather_nd(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes hard sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = max(0, min(1, alpha * x + beta))
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
+ * @return org.apache.mxnet.Symbol + */ +def hard_sigmoid(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns a copy of the input.
+ *
+ * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
+ * @return org.apache.mxnet.Symbol + */ +def identity(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the Khatri-Rao product of the input matrices.
+ *
+ * Given a collection of :math:`n` input matrices,
+ *
+ * .. math::
+ * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
+ *
+ * the (column-wise) Khatri-Rao product is defined as the matrix,
+ *
+ * .. math::
+ * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
+ *
+ * where the :math:`k` th column is equal to the column-wise outer product
+ * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
+ * column of the ith matrix.
+ *
+ * Example::
+ *
+ * >>> A = mx.nd.array([[1, -1],
+ * >>> [2, -3]])
+ * >>> B = mx.nd.array([[1, 4],
+ * >>> [2, 5],
+ * >>> [3, 6]])
+ * >>> C = mx.nd.khatri_rao(A, B)
+ * >>> print(C.asnumpy())
+ * [[ 1. -4.]
+ * [ 2. -5.]
+ * [ 3. -6.]
+ * [ 2. -12.]
+ * [ 4. -15.]
+ * [ 6. -18.]]
+ *
+ *
+ *
+ * Defined in src/operator/contrib/krprod.cc:L108
+ * @return org.apache.mxnet.Symbol + */ +def khatri_rao(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * LQ factorization for general matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
+ * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
+ * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
+ * that:
+ *
+ * *A* = *L* \* *Q*
+ *
+ * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
+ * and *Q* is row-orthonormal, meaning that
+ *
+ * *Q* \* *Q*\ :sup:`T`
+ *
+ * is equal to the identity matrix of shape *(x, x)*.
+ *
+ * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single LQ factorization
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * Q, L = gelqf(A)
+ * Q = [[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]]
+ * L = [[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]]
+ *
+ * // Batch LQ factorization
+ * A = [[[1., 2., 3.], [4., 5., 6.]],
+ * [[7., 8., 9.], [10., 11., 12.]]]
+ * Q, L = gelqf(A)
+ * Q = [[[-0.26726124, -0.53452248, -0.80178373],
+ * [0.87287156, 0.21821789, -0.43643578]],
+ * [[-0.50257071, -0.57436653, -0.64616234],
+ * [0.7620735, 0.05862104, -0.64483142]]]
+ * L = [[[-3.74165739, 0.],
+ * [-8.55235974, 1.96396101]],
+ * [[-13.92838828, 0.],
+ * [-19.09768702, 0.52758934]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L552
+ * @return org.apache.mxnet.Symbol + */ +def linalg_gelqf(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Performs general matrix multiplication and accumulation.
+ * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
+ *
+ * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
+ * matrix transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = swapaxes(C, dim1=1, dim2=3)
+ * C = gemm(A1, B1, C)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply-add
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
+ * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
+ *
+ * // Batch matrix multiply-add
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * C = [[[10.0]], [[0.01]]]
+ * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
+ * = [[[104.0]], [[0.14]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L81
+ * @return org.apache.mxnet.Symbol + */ +def linalg_gemm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Performs general matrix multiplication.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, the BLAS3 function *gemm* is performed:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
+ *
+ * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
+ * transposition (depending on *transpose_a*, *transpose_b*).
+ *
+ * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
+ * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
+ * parameter. By default, the trailing two dimensions will be used for matrix encoding.
+ *
+ * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
+ * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
+ *
+ * A1 = swapaxes(A, dim1=1, dim2=3)
+ * B1 = swapaxes(B, dim1=1, dim2=3)
+ * C = gemm2(A1, B1)
+ * C = swapaxis(C, dim1=1, dim2=3)
+ *
+ * without the overhead of the additional swapaxis operations.
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1.0, 1.0], [1.0, 1.0]]
+ * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
+ * gemm2(A, B, transpose_b=True, alpha=2.0)
+ * = [[[4.0]], [[0.04 ]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L151
+ * @return org.apache.mxnet.Symbol + */ +def linalg_gemm2(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Performs Cholesky factorization of a symmetric positive-definite matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
+ * computed. *L* is lower triangular (entries of upper triangle are all zero), has
+ * positive diagonal entries, and:
+ *
+ * *A* = *L* \* *L*\ :sup:`T`
+ *
+ * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix factorization
+ * A = [[4.0, 1.0], [1.0, 4.25]]
+ * potrf(A) = [[2.0, 0], [0.5, 2.0]]
+ *
+ * // Batch matrix factorization
+ * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
+ * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L201
+ * @return org.apache.mxnet.Symbol + */ +def linalg_potrf(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Performs matrix inversion from a Cholesky factorization.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
+ * with positive diagonal. We compute:
+ *
+ * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
+ *
+ * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
+ * *B* (obtained by *potrf*), then
+ *
+ * *out* = *B*\ :sup:`-1`
+ *
+ * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
+ * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
+ * (*trsm*). The latter is numerically much safer, and also cheaper.
+ *
+ * Examples::
+ *
+ * // Single matrix inverse
+ * A = [[2.0, 0], [0.5, 2.0]]
+ * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
+ *
+ * // Batch matrix inverse
+ * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
+ * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
+ * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L259
+ * @return org.apache.mxnet.Symbol + */ +def linalg_potri(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the sum of the logarithms of the diagonal elements of a square matrix.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
+ * logarithms of the diagonal elements, the result has shape (1,).
+ *
+ * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix reduction
+ * A = [[1.0, 1.0], [1.0, 7.0]]
+ * sumlogdiag(A) = [1.9459]
+ *
+ * // Batch matrix reduction
+ * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
+ * sumlogdiag(A) = [1.9459, 3.9318]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L428
+ * @return org.apache.mxnet.Symbol + */ +def linalg_sumlogdiag(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Multiplication of matrix with its transpose.
+ * Input is a tensor *A* of dimension *n >= 2*.
+ *
+ * If *n=2*, the operator performs the BLAS3 function *syrk*:
+ *
+ * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
+ *
+ * if *transpose=False*, or
+ *
+ * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
+ *
+ * if *transpose=True*.
+ *
+ * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
+ * inputs (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix multiply
+ * A = [[1., 2., 3.], [4., 5., 6.]]
+ * syrk(A, alpha=1., transpose=False)
+ * = [[14., 32.],
+ * [32., 77.]]
+ * syrk(A, alpha=1., transpose=True)
+ * = [[17., 22., 27.],
+ * [22., 29., 36.],
+ * [27., 36., 45.]]
+ *
+ * // Batch matrix multiply
+ * A = [[[1., 1.]], [[0.1, 0.1]]]
+ * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L484
+ * @return org.apache.mxnet.Symbol + */ +def linalg_syrk(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Performs multiplication with a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trmm*:
+ *
+ * *out* = *alpha* \* *op*\ (*A*) \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* = *alpha* \* *B* \* *op*\ (*A*)
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ *
+ * Examples::
+ *
+ * // Single triangular matrix multiply
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ *
+ * // Batch triangular matrix multiply
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
+ * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L316
+ * @return org.apache.mxnet.Symbol + */ +def linalg_trmm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Solves matrix equation involving a lower triangular matrix.
+ * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
+ * on the leading *n-2* dimensions.
+ *
+ * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
+ * *trsm*, solving for *out* in:
+ *
+ * *op*\ (*A*) \* *out* = *alpha* \* *B*
+ *
+ * if *rightside=False*, or
+ *
+ * *out* \* *op*\ (*A*) = *alpha* \* *B*
+ *
+ * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
+ * identity or the matrix transposition (depending on *transpose*).
+ *
+ * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
+ * (batch mode).
+ *
+ * .. note:: The operator supports float32 and float64 data types only.
+ *
+ * Examples::
+ *
+ * // Single matrix solve
+ * A = [[1.0, 0], [1.0, 1.0]]
+ * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
+ * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
+ *
+ * // Batch matrix solve
+ * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
+ * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
+ * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
+ * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
+ * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
+ *
+ *
+ * Defined in src/operator/tensor/la_op.cc:L379
+ * @return org.apache.mxnet.Symbol + */ +def linalg_trsm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise Natural logarithmic value of the input.
+ *
+ * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
+ *
+ * The storage type of ``log`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
+ * @return org.apache.mxnet.Symbol + */ +def log(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise Base-10 logarithmic value of the input.
+ *
+ * ``10**log10(x) = x``
+ *
+ * The storage type of ``log10`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
+ * @return org.apache.mxnet.Symbol + */ +def log10(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise ``log(1 + x)`` value of the input.
+ *
+ * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
+ * :math:`1+x\approx 1`
+ *
+ * The storage type of ``log1p`` output depends upon the input storage type:
+ *
+ * - log1p(default) = default
+ * - log1p(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
+ * @return org.apache.mxnet.Symbol + */ +def log1p(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise Base-2 logarithmic value of the input.
+ *
+ * ``2**log2(x) = x``
+ *
+ * The storage type of ``log2`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
+ * @return org.apache.mxnet.Symbol + */ +def log2(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the log softmax of the input.
+ * This is equivalent to computing softmax followed by log.
+ *
+ * Examples::
+ *
+ * >>> x = mx.nd.array([1, 2, .1])
+ * >>> mx.nd.log_softmax(x).asnumpy()
+ * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
+ *
+ * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
+ * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
+ * array([[-0.34115392, -0.69314718, -1.24115396],
+ * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
+ * @return org.apache.mxnet.Symbol + */ +def log_softmax(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the result of logical NOT (!) function
+ *
+ * Example:
+ * logical_not([-2., 0., 1.]) = [0., 1., 0.]
+ * @return org.apache.mxnet.Symbol + */ +def logical_not(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Make your own loss function in network construction.
+ *
+ * This operator accepts a customized loss function symbol as a terminal loss and
+ * the symbol should be an operator with no backward dependency.
+ * The output of this function is the gradient of loss with respect to the input data.
+ *
+ * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
+ * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
+ *
+ * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
+ * loss = make_loss(cross_entropy)
+ *
+ * We will need to use ``make_loss`` when we are creating our own loss function or we want to
+ * combine multiple loss functions. Also we may want to stop some variables' gradients
+ * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
+ *
+ * The storage type of ``make_loss`` output depends upon the input storage type:
+ *
+ * - make_loss(default) = default
+ * - make_loss(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
+ * @return org.apache.mxnet.Symbol + */ +def make_loss(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @return org.apache.mxnet.Symbol + */ +def max(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the max of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
+ * @return org.apache.mxnet.Symbol + */ +def max_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the mean of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
+ * @return org.apache.mxnet.Symbol + */ +def mean(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @return org.apache.mxnet.Symbol + */ +def min(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the min of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
+ * @return org.apache.mxnet.Symbol + */ +def min_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Updater function for multi-precision sgd optimizer
+ * @return org.apache.mxnet.Symbol + */ +def mp_sgd_mom_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Updater function for multi-precision sgd optimizer
+ * @return org.apache.mxnet.Symbol + */ +def mp_sgd_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
+ * @return org.apache.mxnet.Symbol + */ +def nanprod(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
+ * @return org.apache.mxnet.Symbol + */ +def nansum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Numerical negative of the argument, element-wise.
+ *
+ * The storage type of ``negative`` output depends upon the input storage type:
+ *
+ * - negative(default) = default
+ * - negative(row_sparse) = row_sparse
+ * - negative(csr) = csr
+ * @return org.apache.mxnet.Symbol + */ +def negative(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the norm on an NDArray.
+ *
+ * This operator computes the norm on an NDArray with the specified axis, depending
+ * on the value of the ord parameter. By default, it computes the L2 norm on the entire
+ * array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * norm(x) = [5.47722578]
+ *
+ * rsp = x.cast_storage('row_sparse')
+ *
+ * norm(rsp) = [5.47722578]
+ *
+ * csr = x.cast_storage('csr')
+ *
+ * norm(csr) = [5.47722578]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
+ * @return org.apache.mxnet.Symbol + */ +def norm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @return org.apache.mxnet.Symbol + */ +def normal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns a one-hot array.
+ *
+ * The locations represented by `indices` take value `on_value`, while all
+ * other locations take value `off_value`.
+ *
+ * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
+ * in an output array of shape ``(i0, i1, d)`` with::
+ *
+ * output[i,j,:] = off_value
+ * output[i,j,indices[i,j]] = on_value
+ *
+ * Examples::
+ *
+ * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
+ * [ 1. 0. 0.]
+ * [ 0. 0. 1.]
+ * [ 1. 0. 0.]]
+ *
+ * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
+ * dtype='int32') = [[1 8 1]
+ * [8 1 1]
+ * [1 1 8]
+ * [8 1 1]]
+ *
+ * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 1. 0.]
+ * [ 1. 0. 0.]]
+ *
+ * [[ 0. 0. 1.]
+ * [ 1. 0. 0.]]]
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L490
+ * @return org.apache.mxnet.Symbol + */ +def one_hot(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Return an array of ones with the same shape and type
+ * as the input array.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * ones_like(x) = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ * @return org.apache.mxnet.Symbol + */ +def ones_like(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Pads an input array with a constant or edge values of the array.
+ *
+ * .. note:: `Pad` is deprecated. Use `pad` instead.
+ *
+ * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
+ * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
+ *
+ * This operation pads an input array with either a `constant_value` or edge values
+ * along each axis of the input array. The amount of padding is specified by `pad_width`.
+ *
+ * `pad_width` is a tuple of integer padding widths for each axis of the format
+ * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
+ * where ``N`` is the number of dimensions of the array.
+ *
+ * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
+ * to add before and after the elements of the array along dimension ``N``.
+ * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
+ * ``after_2`` must be 0.
+ *
+ * Example::
+ *
+ * x = [[[[ 1. 2. 3.]
+ * [ 4. 5. 6.]]
+ *
+ * [[ 7. 8. 9.]
+ * [ 10. 11. 12.]]]
+ *
+ *
+ * [[[ 11. 12. 13.]
+ * [ 14. 15. 16.]]
+ *
+ * [[ 17. 18. 19.]
+ * [ 20. 21. 22.]]]]
+ *
+ * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 1. 1. 2. 3. 3.]
+ * [ 1. 1. 2. 3. 3.]
+ * [ 4. 4. 5. 6. 6.]
+ * [ 4. 4. 5. 6. 6.]]
+ *
+ * [[ 7. 7. 8. 9. 9.]
+ * [ 7. 7. 8. 9. 9.]
+ * [ 10. 10. 11. 12. 12.]
+ * [ 10. 10. 11. 12. 12.]]]
+ *
+ *
+ * [[[ 11. 11. 12. 13. 13.]
+ * [ 11. 11. 12. 13. 13.]
+ * [ 14. 14. 15. 16. 16.]
+ * [ 14. 14. 15. 16. 16.]]
+ *
+ * [[ 17. 17. 18. 19. 19.]
+ * [ 17. 17. 18. 19. 19.]
+ * [ 20. 20. 21. 22. 22.]
+ * [ 20. 20. 21. 22. 22.]]]]
+ *
+ * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
+ *
+ * [[[[ 0. 0. 0. 0. 0.]
+ * [ 0. 1. 2. 3. 0.]
+ * [ 0. 4. 5. 6. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 7. 8. 9. 0.]
+ * [ 0. 10. 11. 12. 0.]
+ * [ 0. 0. 0. 0. 0.]]]
+ *
+ *
+ * [[[ 0. 0. 0. 0. 0.]
+ * [ 0. 11. 12. 13. 0.]
+ * [ 0. 14. 15. 16. 0.]
+ * [ 0. 0. 0. 0. 0.]]
+ *
+ * [[ 0. 0. 0. 0. 0.]
+ * [ 0. 17. 18. 19. 0.]
+ * [ 0. 20. 21. 22. 0.]
+ * [ 0. 0. 0. 0. 0.]]]]
+ *
+ *
+ *
+ *
+ * Defined in src/operator/pad.cc:L766
+ * @return org.apache.mxnet.Symbol + */ +def pad(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Picks elements from an input array according to the input indices along the given axis.
+ *
+ * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
+ * an output array of shape ``(i0,)`` with::
+ *
+ * output[i] = input[i, indices[i]]
+ *
+ * By default, if any index mentioned is too large, it is replaced by the index that addresses
+ * the last element along an axis (the `clip` mode).
+ *
+ * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // picks elements with specified indices along axis 0
+ * pick(x, y=[0,1], 0) = [ 1., 4.]
+ *
+ * // picks elements with specified indices along axis 1
+ * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
+ *
+ * y = [[ 1.],
+ * [ 0.],
+ * [ 2.]]
+ *
+ * // picks elements with specified indices along axis 1 and dims are maintained
+ * pick(x,y, 1, keepdims=True) = [[ 2.],
+ * [ 3.],
+ * [ 6.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
+ * @return org.apache.mxnet.Symbol + */ +def pick(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the product of array elements over given axes.
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
+ * @return org.apache.mxnet.Symbol + */ +def prod(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Converts each element of the input array from degrees to radians.
+ *
+ * .. math::
+ * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
+ *
+ * The storage type of ``radians`` output depends upon the input storage type:
+ *
+ * - radians(default) = default
+ * - radians(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
+ * @return org.apache.mxnet.Symbol + */ +def radians(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Draw random samples from an exponential distribution.
+ *
+ * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
+ *
+ * Example::
+ *
+ * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
+ * [ 0.04146638, 0.31715935]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L115
+ * @return org.apache.mxnet.Symbol + */ +def random_exponential(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Draw random samples from a gamma distribution.
+ *
+ * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
+ *
+ * Example::
+ *
+ * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
+ * [ 3.91697288, 3.65933681]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L100
+ * @return org.apache.mxnet.Symbol + */ +def random_gamma(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Draw random samples from a generalized negative binomial distribution.
+ *
+ * Samples are distributed according to a generalized negative binomial distribution parametrized by
+ * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
+ * number of unsuccessful experiments (generalized to real numbers).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
+ * [ 6., 4.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L168
+ * @return org.apache.mxnet.Symbol + */ +def random_generalized_negative_binomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Draw random samples from a negative binomial distribution.
+ *
+ * Samples are distributed according to a negative binomial distribution parametrized by
+ * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
+ * [ 2., 5.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L149
+ * @return org.apache.mxnet.Symbol + */ +def random_negative_binomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Draw random samples from a normal (Gaussian) distribution.
+ *
+ * .. note:: The existing alias ``normal`` is deprecated.
+ *
+ * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
+ *
+ * Example::
+ *
+ * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
+ * [-1.23474145, 1.55807114]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L85
+ * @return org.apache.mxnet.Symbol + */ +def random_normal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Draw random samples from a Poisson distribution.
+ *
+ * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
+ * Samples will always be returned as a floating point data type.
+ *
+ * Example::
+ *
+ * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
+ * [ 4., 6.]]
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L132
+ * @return org.apache.mxnet.Symbol + */ +def random_poisson(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @return org.apache.mxnet.Symbol + */ +def random_uniform(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
+ *
+ * Examples::
+ *
+ * A = [[3,6,6],[4,5,1]]
+ * ravel(A, shape=(7,6)) = [22,41,37]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L41
+ * @return org.apache.mxnet.Symbol + */ +def ravel_multi_index(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise inverse cube-root value of the input.
+ *
+ * .. math::
+ * rcbrt(x) = 1/\sqrt[3]{x}
+ *
+ * Example::
+ *
+ * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
+ * @return org.apache.mxnet.Symbol + */ +def rcbrt(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the reciprocal of the argument, element-wise.
+ *
+ * Calculates 1/x.
+ *
+ * Example::
+ *
+ * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
+ * @return org.apache.mxnet.Symbol + */ +def reciprocal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes rectified linear.
+ *
+ * .. math::
+ * max(features, 0)
+ *
+ * The storage type of ``relu`` output depends upon the input storage type:
+ *
+ * - relu(default) = default
+ * - relu(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
+ * @return org.apache.mxnet.Symbol + */ +def relu(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Repeats elements of an array.
+ *
+ * By default, ``repeat`` flattens the input array into 1-D and then repeats the
+ * elements::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
+ *
+ * The parameter ``axis`` specifies the axis along which to perform repeat::
+ *
+ * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
+ * [ 1., 2.],
+ * [ 3., 4.],
+ * [ 3., 4.]]
+ *
+ * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
+ * [ 3., 3., 4., 4.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L690
+ * @return org.apache.mxnet.Symbol + */ +def repeat(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Reshapes the input array.
+ *
+ * .. note:: ``Reshape`` is deprecated, use ``reshape``
+ *
+ * Given an array and a shape, this function returns a copy of the array in the new shape.
+ * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
+ *
+ * Example::
+ *
+ * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
+ *
+ * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
+ *
+ * - ``0`` copy this dimension from the input to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
+ * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
+ *
+ * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
+ * keeping the size of the new array same as that of the input array.
+ * At most one dimension of shape can be -1.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
+ * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
+ * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
+ *
+ * - ``-2`` copy all/remainder of the input dimensions to the output shape.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
+ * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
+ *
+ * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
+ * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
+ * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
+ * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
+ *
+ * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
+ *
+ * Example::
+ *
+ * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
+ * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
+ *
+ * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
+ *
+ * Example::
+ *
+ * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
+ * - with reverse=1, output shape will be (50,4).
+ *
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L168
+ * @return org.apache.mxnet.Symbol + */ +def reshape(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Reshape lhs to have the same shape as rhs.
+ * @return org.apache.mxnet.Symbol + */ +def reshape_like(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Reverses the order of elements along given axis while preserving array shape.
+ *
+ * Note: reverse and flip are equivalent. We use reverse in the following examples.
+ *
+ * Examples::
+ *
+ * x = [[ 0., 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8., 9.]]
+ *
+ * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
+ * [ 0., 1., 2., 3., 4.]]
+ *
+ * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
+ * [ 9., 8., 7., 6., 5.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L792
+ * @return org.apache.mxnet.Symbol + */ +def reverse(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * .. note::
+ * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
+ * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
+ *
+ * Example::
+ *
+ * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
+ *
+ * The storage type of ``rint`` output depends upon the input storage type:
+ *
+ * - rint(default) = default
+ * - rint(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
+ * @return org.apache.mxnet.Symbol + */ +def rint(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Update function for `RMSProp` optimizer.
+ *
+ * `RMSprop` is a variant of stochastic gradient descent where the gradients are
+ * divided by a cache which grows with the sum of squares of recent gradients?
+ *
+ * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
+ * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
+ * each parameter monotonically over the course of training.
+ * While this is analytically motivated for convex optimizations, it may not be ideal
+ * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
+ * learning rates to rebound as the denominator decays over time.
+ *
+ * Define the Root Mean Square (RMS) error criterion of the gradient as
+ * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
+ * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
+ *
+ * The :math:`E[g^2]_t` is given by:
+ *
+ * .. math::
+ * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
+ *
+ * The RMSProp code follows the version in
+ * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
+ * Tieleman & Hinton, 2012.
+ *
+ * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
+ * :math:`\eta` to be 0.001.
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L553
+ * @return org.apache.mxnet.Symbol + */ +def rmsprop_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Update function for RMSPropAlex optimizer.
+ *
+ * `RMSPropAlex` is non-centered version of `RMSProp`.
+ *
+ * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
+ * :math:`E[g]_t` is the decaying average over past gradient.
+ *
+ * .. math::
+ * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
+ * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
+ * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
+ *
+ * The update step is
+ *
+ * .. math::
+ * \theta_{t+1} = \theta_t + \Delta_t
+ *
+ * The RMSPropAlex code follows the version in
+ * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
+ *
+ * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
+ * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L592
+ * @return org.apache.mxnet.Symbol + */ +def rmspropalex_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise rounded value to the nearest integer of the input.
+ *
+ * Example::
+ *
+ * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
+ *
+ * The storage type of ``round`` output depends upon the input storage type:
+ *
+ * - round(default) = default
+ * - round(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
+ * @return org.apache.mxnet.Symbol + */ +def round(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise inverse square-root value of the input.
+ *
+ * .. math::
+ * rsqrt(x) = 1/\sqrt{x}
+ *
+ * Example::
+ *
+ * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
+ *
+ * The storage type of ``rsqrt`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
+ * @return org.apache.mxnet.Symbol + */ +def rsqrt(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * exponential distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_exponential(lam) = [ 0.51837951, 0.09994757]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
+ * [ 0.09994757, 0.50447971]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L284
+ * @return org.apache.mxnet.Symbol + */ +def sample_exponential(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * alpha = [ 0.0, 2.5 ]
+ * beta = [ 1.0, 0.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
+ * [ 2.25797319, 1.70734084]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L282
+ * @return org.apache.mxnet.Symbol + */ +def sample_gamma(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * mu = [ 2.0, 2.5 ]
+ * alpha = [ 1.0, 0.1 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
+ * [ 3., 1.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L293
+ * @return org.apache.mxnet.Symbol + */ +def sample_generalized_negative_binomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple multinomial distributions.
+ *
+ * *data* is an *n* dimensional array whose last dimension has length *k*, where
+ * *k* is the number of possible outcomes of each multinomial distribution. This
+ * operator will draw *shape* samples from each distribution. If shape is empty
+ * one sample will be drawn from each distribution.
+ *
+ * If *get_prob* is true, a second array containing log likelihood of the drawn
+ * samples will also be returned. This is usually used for reinforcement learning
+ * where you can provide reward as head gradient for this array to estimate
+ * gradient.
+ *
+ * Note that the input distribution must be normalized, i.e. *data* must sum to
+ * 1 along its last axis.
+ *
+ * Examples::
+ *
+ * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
+ *
+ * // Draw a single sample for each distribution
+ * sample_multinomial(probs) = [3, 0]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_multinomial(probs, shape=(2)) = [[4, 2],
+ * [0, 0]]
+ *
+ * // requests log likelihood
+ * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
+ * @return org.apache.mxnet.Symbol + */ +def sample_multinomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * k = [ 20, 49 ]
+ * p = [ 0.4 , 0.77 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_negative_binomial(k, p) = [ 15., 16.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
+ * [ 16., 12.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L289
+ * @return org.apache.mxnet.Symbol + */ +def sample_negative_binomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * mu = [ 0.0, 2.5 ]
+ * sigma = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
+ * [ 0.95934606, 4.48287058]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L279
+ * @return org.apache.mxnet.Symbol + */ +def sample_normal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * Poisson distributions with parameters lambda (rate).
+ *
+ * The parameters of the distributions are provided as an input array.
+ * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input value at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input array.
+ *
+ * Samples will always be returned as a floating point data type.
+ *
+ * Examples::
+ *
+ * lam = [ 1.0, 8.5 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_poisson(lam) = [ 0., 13.]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
+ * [ 13., 8.]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L286
+ * @return org.apache.mxnet.Symbol + */ +def sample_poisson(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Concurrent sampling from multiple
+ * uniform distributions on the intervals given by *[low,high)*.
+ *
+ * The parameters of the distributions are provided as input arrays.
+ * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
+ * be the shape specified as the parameter of the operator, and *m* be the dimension
+ * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
+ *
+ * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
+ * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
+ * which is parameterized by the input values at index *i*. If the shape parameter of the
+ * operator is not set, then one sample will be drawn per distribution and the output array
+ * has the same shape as the input arrays.
+ *
+ * Examples::
+ *
+ * low = [ 0.0, 2.5 ]
+ * high = [ 1.0, 3.7 ]
+ *
+ * // Draw a single sample for each distribution
+ * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
+ *
+ * // Draw a vector containing two samples for each distribution
+ * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
+ * [ 3.18687344, 3.68352246]]
+ *
+ *
+ * Defined in src/operator/random/multisample_op.cc:L277
+ * @return org.apache.mxnet.Symbol + */ +def sample_uniform(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Scatters data into a new tensor according to indices.
+ *
+ * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
+ * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
+ * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
+ *
+ * The elements in output is defined as follows::
+ *
+ * output[indices[0, y_0, ..., y_{K-1}],
+ * ...,
+ * indices[M-1, y_0, ..., y_{K-1}],
+ * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
+ *
+ * all other entries in output are 0.
+ *
+ * .. warning::
+ *
+ * If the indices have duplicates, the result will be non-deterministic and
+ * the gradient of `scatter_nd` will not be correct!!
+ *
+ *
+ * Examples::
+ *
+ * data = [2, 3, 0]
+ * indices = [[1, 1, 0], [0, 1, 0]]
+ * shape = (2, 2)
+ * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
+ * @return org.apache.mxnet.Symbol + */ +def scatter_nd(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
+ *
+ * Momentum update has better convergence rates on neural networks. Mathematically it looks
+ * like below:
+ *
+ * .. math::
+ *
+ * v_1 = \alpha * \nabla J(W_0)\\
+ * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} + v_t
+ *
+ * It updates the weights using::
+ *
+ * v = momentum * v - learning_rate * gradient
+ * weight += v
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
+ * type is the same as momentum's storage type,
+ * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
+ *
+ * for row in gradient.indices:
+ * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
+ * weight[row] += v[row]
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L372
+ * @return org.apache.mxnet.Symbol + */ +def sgd_mom_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Update function for Stochastic Gradient Descent (SDG) optimizer.
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * (gradient + wd * weight)
+ *
+ * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
+ * only the row slices whose indices appear in grad.indices are updated::
+ *
+ * for row in gradient.indices:
+ * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
+ *
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L331
+ * @return org.apache.mxnet.Symbol + */ +def sgd_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Randomly shuffle the elements.
+ *
+ * This shuffles the array along the first axis.
+ * The order of the elements in each subarray does not change.
+ * For example, if a 2D array is given, the order of the rows randomly changes,
+ * but the order of the elements in each row does not change.
+ * @return org.apache.mxnet.Symbol + */ +def shuffle(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes sigmoid of x element-wise.
+ *
+ * .. math::
+ * y = 1 / (1 + exp(-x))
+ *
+ * The storage type of ``sigmoid`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
+ * @return org.apache.mxnet.Symbol + */ +def sigmoid(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise sign of the input.
+ *
+ * Example::
+ *
+ * sign([-2, 0, 3]) = [-1, 0, 1]
+ *
+ * The storage type of ``sign`` output depends upon the input storage type:
+ *
+ * - sign(default) = default
+ * - sign(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
+ * @return org.apache.mxnet.Symbol + */ +def sign(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Update function for SignSGD optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
+ *
+ * It updates the weights using::
+ *
+ * weight = weight - learning_rate * sign(gradient)
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L57
+ * @return org.apache.mxnet.Symbol + */ +def signsgd_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * SIGN momentUM (Signum) optimizer.
+ *
+ * .. math::
+ *
+ * g_t = \nabla J(W_{t-1})\\
+ * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
+ * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
+ *
+ * It updates the weights using::
+ * state = momentum * state + (1-momentum) * gradient
+ * weight = weight - learning_rate * sign(state)
+ *
+ * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
+ *
+ * .. note::
+ * - sparse ndarray not supported for this optimizer yet.
+ *
+ *
+ * Defined in src/operator/optimizer_op.cc:L86
+ * @return org.apache.mxnet.Symbol + */ +def signum_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the element-wise sine of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
+ *
+ * The storage type of ``sin`` output depends upon the input storage type:
+ *
+ * - sin(default) = default
+ * - sin(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
+ * @return org.apache.mxnet.Symbol + */ +def sin(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the hyperbolic sine of the input array, computed element-wise.
+ *
+ * .. math::
+ * sinh(x) = 0.5\times(exp(x) - exp(-x))
+ *
+ * The storage type of ``sinh`` output depends upon the input storage type:
+ *
+ * - sinh(default) = default
+ * - sinh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
+ * @return org.apache.mxnet.Symbol + */ +def sinh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Slices a region of the array.
+ *
+ * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
+ *
+ * This function returns a sliced array between the indices given
+ * by `begin` and `end` with the corresponding `step`.
+ *
+ * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * slice operation with ``begin=(b_0, b_1...b_m-1)``,
+ * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
+ * where m <= n, results in an array with the shape
+ * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
+ *
+ * The resulting array's *k*-th dimension contains elements
+ * from the *k*-th dimension of the input array starting
+ * from index ``b_k`` (inclusive) with step ``s_k``
+ * until reaching ``e_k`` (exclusive).
+ *
+ * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
+ * and `step`, the following rule will be used to set default values.
+ * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
+ * else, set `b_k=d_k-1`, `e_k=-1`.
+ *
+ * The storage type of ``slice`` output depends on storage types of inputs
+ *
+ * - slice(csr) = csr
+ * - otherwise, ``slice`` generates output with default storage
+ *
+ * .. note:: When input data storage type is csr, it only supports
+ * step=(), or step=(None,), or step=(1,) to generate a csr output.
+ * For other step parameter values, it falls back to slicing
+ * a dense tensor.
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
+ * [ 6., 7., 8.]]
+ * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
+ * [5., 7.],
+ * [1., 3.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L412
+ * @return org.apache.mxnet.Symbol + */ +def slice(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Slices along a given axis.
+ *
+ * Returns an array slice along a given `axis` starting from the `begin` index
+ * to the `end` index.
+ *
+ * Examples::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
+ * [ 5., 6.],
+ * [ 9., 10.]]
+ *
+ * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
+ * [ 6., 7.],
+ * [ 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L499
+ * @return org.apache.mxnet.Symbol + */ +def slice_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Slices a region of the array like the shape of another array.
+ *
+ * This function is similar to ``slice``, however, the `begin` are always `0`s
+ * and `end` of specific axes are inferred from the second input `shape_like`.
+ *
+ * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
+ * a ``slice_like`` operator with default empty `axes`, it performs the
+ * following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
+ *
+ * When `axes` is not empty, it is used to speficy which axes are being sliced.
+ *
+ * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
+ * will perform the following operation:
+ *
+ * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
+ *
+ * Note that it is allowed to have first and second input with different dimensions,
+ * however, you have to make sure the `axes` are specified and not exceeding the
+ * dimension limits.
+ *
+ * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
+ * ``shape=(1,2,3)``, it is not allowed to use:
+ *
+ * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
+ * is 3.
+ *
+ * The following is allowed in this situation:
+ *
+ * `` out = slice_like(a, b, axes=(0, 2))``
+ *
+ * Example::
+ *
+ * x = [[ 1., 2., 3., 4.],
+ * [ 5., 6., 7., 8.],
+ * [ 9., 10., 11., 12.]]
+ *
+ * y = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ *
+ * slice_like(x, y) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]]
+ * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
+ * [ 5., 6., 7., 8.]]
+ * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
+ * [ 5., 6., 7.]
+ * [ 9., 10., 11.]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L568
+ * @return org.apache.mxnet.Symbol + */ +def slice_like(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Calculate Smooth L1 Loss(lhs, scalar) by summing
+ *
+ * .. math::
+ *
+ * f(x) =
+ * \begin{cases}
+ * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
+ * |x|-0.5/\sigma^2,& \text{otherwise}
+ * \end{cases}
+ *
+ * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
+ *
+ * Example::
+ *
+ * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
+ * @return org.apache.mxnet.Symbol + */ +def smooth_l1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Applies the softmax function.
+ *
+ * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
+ *
+ * .. math::
+ * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
+ *
+ * for :math:`j = 1, ..., K`
+ *
+ * Example::
+ *
+ * x = [[ 1. 1. 1.]
+ * [ 1. 1. 1.]]
+ *
+ * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
+ * [ 0.5 0.5 0.5]]
+ *
+ * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
+ * [ 0.33333334, 0.33333334, 0.33333334]]
+ *
+ *
+ *
+ * Defined in src/operator/nn/softmax.cc:L95
+ * @return org.apache.mxnet.Symbol + */ +def softmax(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Calculate cross entropy of softmax output and one-hot label.
+ *
+ * - This operator computes the cross entropy in two steps:
+ * - Applies softmax function on the input array.
+ * - Computes and returns the cross entropy loss between the softmax output and the labels.
+ *
+ * - The softmax function and cross entropy loss is given by:
+ *
+ * - Softmax Function:
+ *
+ * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
+ *
+ * - Cross Entropy Function:
+ *
+ * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
+ *
+ * Example::
+ *
+ * x = [[1, 2, 3],
+ * [11, 7, 5]]
+ *
+ * label = [2, 0]
+ *
+ * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
+ * [0.97962922, 0.01794253, 0.00242826]]
+ *
+ * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
+ *
+ *
+ *
+ * Defined in src/operator/loss_binary_op.cc:L59
+ * @return org.apache.mxnet.Symbol + */ +def softmax_cross_entropy(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes softsign of x element-wise.
+ *
+ * .. math::
+ * y = x / (1 + abs(x))
+ *
+ * The storage type of ``softsign`` output is always dense
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
+ * @return org.apache.mxnet.Symbol + */ +def softsign(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns a sorted copy of an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 4],
+ * [ 3, 1]]
+ *
+ * // sorts along the last axis
+ * sort(x) = [[ 1., 4.],
+ * [ 1., 3.]]
+ *
+ * // flattens and then sorts
+ * sort(x) = [ 1., 1., 3., 4.]
+ *
+ * // sorts along the first axis
+ * sort(x, axis=0) = [[ 1., 1.],
+ * [ 3., 4.]]
+ *
+ * // in a descend order
+ * sort(x, is_ascend=0) = [[ 4., 1.],
+ * [ 3., 1.]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L126
+ * @return org.apache.mxnet.Symbol + */ +def sort(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Splits an array along a particular axis into multiple sub-arrays.
+ *
+ * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
+ *
+ * **Note** that `num_outputs` should evenly divide the length of the axis
+ * along which to split the array.
+ *
+ * Example::
+ *
+ * x = [[[ 1.]
+ * [ 2.]]
+ * [[ 3.]
+ * [ 4.]]
+ * [[ 5.]
+ * [ 6.]]]
+ * x.shape = (3, 2, 1)
+ *
+ * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
+ * y = [[[ 1.]]
+ * [[ 3.]]
+ * [[ 5.]]]
+ *
+ * [[[ 2.]]
+ * [[ 4.]]
+ * [[ 6.]]]
+ *
+ * y[0].shape = (3, 1, 1)
+ *
+ * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
+ * z = [[[ 1.]
+ * [ 2.]]]
+ *
+ * [[[ 3.]
+ * [ 4.]]]
+ *
+ * [[[ 5.]
+ * [ 6.]]]
+ *
+ * z[0].shape = (1, 2, 1)
+ *
+ * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
+ * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
+ * along the `axis` which it is split.
+ * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
+ *
+ * Example::
+ *
+ * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
+ * z = [[ 1.]
+ * [ 2.]]
+ *
+ * [[ 3.]
+ * [ 4.]]
+ *
+ * [[ 5.]
+ * [ 6.]]
+ * z[0].shape = (2 ,1 )
+ *
+ *
+ *
+ * Defined in src/operator/slice_channel.cc:L107
+ * @return org.apache.mxnet.Symbol + */ +def split(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise square-root value of the input.
+ *
+ * .. math::
+ * \textrm{sqrt}(x) = \sqrt{x}
+ *
+ * Example::
+ *
+ * sqrt([4, 9, 16]) = [2, 3, 4]
+ *
+ * The storage type of ``sqrt`` output depends upon the input storage type:
+ *
+ * - sqrt(default) = default
+ * - sqrt(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
+ * @return org.apache.mxnet.Symbol + */ +def sqrt(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns element-wise squared value of the input.
+ *
+ * .. math::
+ * square(x) = x^2
+ *
+ * Example::
+ *
+ * square([2, 3, 4]) = [4, 9, 16]
+ *
+ * The storage type of ``square`` output depends upon the input storage type:
+ *
+ * - square(default) = default
+ * - square(row_sparse) = row_sparse
+ * - square(csr) = csr
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
+ * @return org.apache.mxnet.Symbol + */ +def square(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Remove single-dimensional entries from the shape of an array.
+ * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
+ * See the following note for exception.
+ *
+ * Examples::
+ *
+ * data = [[[0], [1], [2]]]
+ * squeeze(data) = [0, 1, 2]
+ * squeeze(data, axis=0) = [[0], [1], [2]]
+ * squeeze(data, axis=2) = [[0, 1, 2]]
+ * squeeze(data, axis=(0, 2)) = [0, 1, 2]
+ *
+ * .. Note::
+ * The output of this operator will keep at least one dimension not removed. For example,
+ * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
+ * @return org.apache.mxnet.Symbol + */ +def squeeze(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Join a sequence of arrays along a new axis.
+ *
+ * The axis parameter specifies the index of the new axis in the dimensions of the
+ * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
+ * will be the last dimension.
+ *
+ * Examples::
+ *
+ * x = [1, 2]
+ * y = [3, 4]
+ *
+ * stack(x, y) = [[1, 2],
+ * [3, 4]]
+ * stack(x, y, axis=1) = [[1, 3],
+ * [2, 4]]
+ * @return org.apache.mxnet.Symbol + */ +def stack(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Stops gradient computation.
+ *
+ * Stops the accumulated gradient of the inputs from flowing through this operator
+ * in the backward direction. In other words, this operator prevents the contribution
+ * of its inputs to be taken into account for computing gradients.
+ *
+ * Example::
+ *
+ * v1 = [1, 2]
+ * v2 = [0, 1]
+ * a = Variable('a')
+ * b = Variable('b')
+ * b_stop_grad = stop_gradient(3 * b)
+ * loss = MakeLoss(b_stop_grad + a)
+ *
+ * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
+ * executor.forward(is_train=True, a=v1, b=v2)
+ * executor.outputs
+ * [ 1. 5.]
+ *
+ * executor.backward()
+ * executor.grad_arrays
+ * [ 0. 0.]
+ * [ 1. 1.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
+ * @return org.apache.mxnet.Symbol + */ +def stop_gradient(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @return org.apache.mxnet.Symbol + */ +def sum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the sum of array elements over given axes.
+ *
+ * .. Note::
+ *
+ * `sum` and `sum_axis` are equivalent.
+ * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
+ * Setting keepdims or exclude to True will cause a fallback to dense operator.
+ *
+ * Example::
+ *
+ * data = [[[1,2],[2,3],[1,3]],
+ * [[1,4],[4,3],[5,2]],
+ * [[7,1],[7,2],[7,3]]]
+ *
+ * sum(data, axis=1)
+ * [[ 4. 8.]
+ * [ 10. 9.]
+ * [ 21. 6.]]
+ *
+ * sum(data, axis=[1,2])
+ * [ 12. 19. 27.]
+ *
+ * data = [[1,2,0],
+ * [3,0,1],
+ * [4,1,0]]
+ *
+ * csr = cast_storage(data, 'csr')
+ *
+ * sum(csr, axis=0)
+ * [ 8. 3. 1.]
+ *
+ * sum(csr, axis=1)
+ * [ 3. 4. 5.]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
+ * @return org.apache.mxnet.Symbol + */ +def sum_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Interchanges two axes of an array.
+ *
+ * Examples::
+ *
+ * x = [[1, 2, 3]])
+ * swapaxes(x, 0, 1) = [[ 1],
+ * [ 2],
+ * [ 3]]
+ *
+ * x = [[[ 0, 1],
+ * [ 2, 3]],
+ * [[ 4, 5],
+ * [ 6, 7]]] // (2,2,2) array
+ *
+ * swapaxes(x, 0, 2) = [[[ 0, 4],
+ * [ 2, 6]],
+ * [[ 1, 5],
+ * [ 3, 7]]]
+ *
+ *
+ * Defined in src/operator/swapaxis.cc:L70
+ * @return org.apache.mxnet.Symbol + */ +def swapaxes(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Takes elements from an input array along the given axis.
+ *
+ * This function slices the input array along a particular axis with the provided indices.
+ *
+ * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
+ * will have shape ``(i0, i1, d1, d2)``, computed by::
+ *
+ * output[i,j,:,:] = input[indices[i,j],:,:]
+ *
+ * .. note::
+ * - `axis`- Only slicing along axis 0 is supported for now.
+ * - `mode`- Only `clip` mode is supported for now.
+ *
+ * Examples::
+ * x = [4. 5. 6.]
+ *
+ * // Trivial case, take the second element along the first axis.
+ * take(x, [1]) = [ 5. ]
+ *
+ * x = [[ 1., 2.],
+ * [ 3., 4.],
+ * [ 5., 6.]]
+ *
+ * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
+ * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 3., 4.],
+ * [ 5., 6.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/indexing_op.cc:L389
+ * @return org.apache.mxnet.Symbol + */ +def take(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Computes the element-wise tangent of the input array.
+ *
+ * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
+ *
+ * .. math::
+ * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
+ *
+ * The storage type of ``tan`` output depends upon the input storage type:
+ *
+ * - tan(default) = default
+ * - tan(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
+ * @return org.apache.mxnet.Symbol + */ +def tan(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the hyperbolic tangent of the input array, computed element-wise.
+ *
+ * .. math::
+ * tanh(x) = sinh(x) / cosh(x)
+ *
+ * The storage type of ``tanh`` output depends upon the input storage type:
+ *
+ * - tanh(default) = default
+ * - tanh(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
+ * @return org.apache.mxnet.Symbol + */ +def tanh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Repeats the whole array multiple times.
+ *
+ * If ``reps`` has length *d*, and input array has dimension of *n*. There are
+ * three cases:
+ *
+ * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
+ *
+ * x = [[1, 2],
+ * [3, 4]]
+ *
+ * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]
+ *
+ * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
+ * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
+ *
+ *
+ * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4.]]
+ *
+ * - **n + * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
+ *
+ * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]],
+ *
+ * [[ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.],
+ * [ 1., 2., 1., 2., 1., 2.],
+ * [ 3., 4., 3., 4., 3., 4.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L751
+ * @return org.apache.mxnet.Symbol + */ +def tile(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Returns the top *k* elements in an input array along the given axis.
+ *
+ * Examples::
+ *
+ * x = [[ 0.3, 0.2, 0.4],
+ * [ 0.1, 0.3, 0.2]]
+ *
+ * // returns an index of the largest element on last axis
+ * topk(x) = [[ 2.],
+ * [ 1.]]
+ *
+ * // returns the value of top-2 largest elements on last axis
+ * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
+ * [ 0.3, 0.2]]
+ *
+ * // returns the value of top-2 smallest elements on last axis
+ * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
+ * [ 0.1 , 0.2]]
+ *
+ * // returns the value of top-2 largest elements on axis 0
+ * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
+ * [ 0.1, 0.2, 0.2]]
+ *
+ * // flattens and then returns list of both values and indices
+ * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ordering_op.cc:L63
+ * @return org.apache.mxnet.Symbol + */ +def topk(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Permutes the dimensions of an array.
+ *
+ * Examples::
+ *
+ * x = [[ 1, 2],
+ * [ 3, 4]]
+ *
+ * transpose(x) = [[ 1., 3.],
+ * [ 2., 4.]]
+ *
+ * x = [[[ 1., 2.],
+ * [ 3., 4.]],
+ *
+ * [[ 5., 6.],
+ * [ 7., 8.]]]
+ *
+ * transpose(x) = [[[ 1., 5.],
+ * [ 3., 7.]],
+ *
+ * [[ 2., 6.],
+ * [ 4., 8.]]]
+ *
+ * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
+ * [ 5., 6.]],
+ *
+ * [[ 3., 4.],
+ * [ 7., 8.]]]
+ *
+ *
+ * Defined in src/operator/tensor/matrix_op.cc:L310
+ * @return org.apache.mxnet.Symbol + */ +def transpose(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Return the element-wise truncated value of the input.
+ *
+ * The truncated value of the scalar x is the nearest integer i which is closer to
+ * zero than x is. In short, the fractional part of the signed number x is discarded.
+ *
+ * Example::
+ *
+ * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
+ *
+ * The storage type of ``trunc`` output depends upon the input storage type:
+ *
+ * - trunc(default) = default
+ * - trunc(row_sparse) = row_sparse
+ *
+ *
+ *
+ * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
+ * @return org.apache.mxnet.Symbol + */ +def trunc(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Draw random samples from a uniform distribution.
+ *
+ * .. note:: The existing alias ``uniform`` is deprecated.
+ *
+ * Samples are uniformly distributed over the half-open interval *[low, high)*
+ * (includes *low*, but excludes *high*).
+ *
+ * Example::
+ *
+ * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
+ * [ 0.54488319, 0.84725171]]
+ *
+ *
+ *
+ * Defined in src/operator/random/sample_op.cc:L66
+ * @return org.apache.mxnet.Symbol + */ +def uniform(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
+ *
+ * Examples::
+ *
+ * A = [22,41,37]
+ * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/ravel.cc:L65
+ * @return org.apache.mxnet.Symbol + */ +def unravel_index(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Return the elements, either from x or y, depending on the condition.
+ *
+ * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
+ * depending on the elements from condition are true or false. x and y must have the same shape.
+ * If condition has the same shape as x, each element in the output array is from x if the
+ * corresponding element in the condition is true, and from y if false.
+ *
+ * If condition does not have the same shape as x, it must be a 1D array whose size is
+ * the same as x's first dimension size. Each row of the output array is from x's row
+ * if the corresponding element from condition is true, and from y's row if false.
+ *
+ * Note that all non-zero values are interpreted as ``True`` in condition.
+ *
+ * Examples::
+ *
+ * x = [[1, 2], [3, 4]]
+ * y = [[5, 6], [7, 8]]
+ * cond = [[0, 1], [-1, 0]]
+ *
+ * where(cond, x, y) = [[5, 2], [3, 8]]
+ *
+ * csr_cond = cast_storage(cond, 'csr')
+ *
+ * where(csr_cond, x, y) = [[5, 2], [3, 8]]
+ *
+ *
+ *
+ * Defined in src/operator/tensor/control_flow_op.cc:L57
+ * @return org.apache.mxnet.Symbol + */ +def where(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol + /** + * Return an array of zeros with the same shape, type and storage type
+ * as the input array.
+ *
+ * The storage type of ``zeros_like`` output depends on the storage type of the input
+ *
+ * - zeros_like(row_sparse) = row_sparse
+ * - zeros_like(csr) = csr
+ * - zeros_like(default) = default
+ *
+ * Examples::
+ *
+ * x = [[ 1., 1., 1.],
+ * [ 1., 1., 1.]]
+ *
+ * zeros_like(x) = [[ 0., 0., 0.],
+ * [ 0., 0., 0.]]
+ * @return org.apache.mxnet.Symbol + */ +def zeros_like(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol +} \ No newline at end of file diff --git a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala index f3afd4d9f623..82fc9b6ce109 100644 --- a/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala +++ b/scala-package/examples/src/main/scala/org/apache/mxnetexamples/neuralstyle/end2end/GenV4.scala @@ -43,7 +43,7 @@ object GenV4 { var conv4_1 = Conv(conv3_1, 32, 4096) var conv5_1 = Conv(conv4_1, 48, 4096) var conv6_1 = Conv(conv5_1, 32, 4096) - var out = Symbol.api.Convolution(data = Some(conv6_1), num_filter = 3, kernel = Shape(3,3), + var out = Symbol.api.Convolution(data = Some(conv6_1), num_filter = 3, kernel = Shape(3, 3), pad = Some(Shape(1, 1)), no_bias = Some(true), workspace = Some(4096)) out = Symbol.api.BatchNorm(data = Some(out), fix_gamma = Some(false)) out = Symbol.api.Activation(data = Some(out), act_type = "tanh") @@ -69,4 +69,4 @@ object GenV4 { forTraining = forTraining, inputsNeedGrad = inputsNeedGrad) mod } -} \ No newline at end of file +} From fa3aa9a9ffd2b5d7f7279c9e0476ef86240d2410 Mon Sep 17 00:00:00 2001 From: Qing Date: Tue, 10 Jul 2018 10:28:26 -0700 Subject: [PATCH 6/9] remove redundant files --- .../org/apache/mxnet/NDArrayAPIBase.scala | 6859 --------- .../scala/org/apache/mxnet/NDArrayBase.scala | 11488 ---------------- .../org/apache/mxnet/SymbolAPIBase.scala | 6859 --------- .../scala/org/apache/mxnet/SymbolBase.scala | 5755 -------- 4 files changed, 30961 deletions(-) delete mode 100644 scala-package/core/src/main/scala/org/apache/mxnet/NDArrayAPIBase.scala delete mode 100644 scala-package/core/src/main/scala/org/apache/mxnet/NDArrayBase.scala delete mode 100644 scala-package/core/src/main/scala/org/apache/mxnet/SymbolAPIBase.scala delete mode 100644 scala-package/core/src/main/scala/org/apache/mxnet/SymbolBase.scala diff --git a/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayAPIBase.scala b/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayAPIBase.scala deleted file mode 100644 index ddc1d9a526a6..000000000000 --- a/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayAPIBase.scala +++ /dev/null @@ -1,6859 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// scalastyle:off -package org.apache.mxnet -import org.apache.mxnet.annotation.Experimental -abstract class NDArrayAPIBase { - /** - * Applies an activation function element-wise to the input.
- *
- * The following activation functions are supported:
- *
- * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
- * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
- * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
- * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
- * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
- *
- *
- *
- * Defined in src/operator/nn/activation.cc:L161
- * @param data The input array. - * @param act_type Activation function to be applied. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Activation (data : org.apache.mxnet.NDArray, act_type : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Batch normalization.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
- * two outputs are blocked.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
- * axis to be the last item in the input shape.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/nn/batch_norm.cc:L575
- * @param data Input data to batch normalization - * @param gamma gamma array - * @param beta beta array - * @param moving_mean running mean of input - * @param moving_var running variance of input - * @param eps Epsilon to prevent div 0. Must be no less than CUDNN_BN_MIN_EPSILON defined in cudnn.h when using cudnn (usually 1e-5) - * @param momentum Momentum for moving average - * @param fix_gamma Fix gamma while training - * @param use_global_stats Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator. - * @param output_mean_var Output the mean and inverse std - * @param axis Specify which shape axis the channel is specified - * @param cudnn_off Do not select CUDNN operator, if available - * @return org.apache.mxnet.NDArray - */ -@Experimental -def BatchNorm (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, beta : org.apache.mxnet.NDArray, moving_mean : org.apache.mxnet.NDArray, moving_var : org.apache.mxnet.NDArray, eps : Option[Double] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, fix_gamma : Option[Boolean] = None, use_global_stats : Option[Boolean] = None, output_mean_var : Option[Boolean] = None, axis : Option[Int] = None, cudnn_off : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Batch normalization.
- *
- * This operator is DEPRECATED. Perform BatchNorm on the input.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_var`` as well, which are needed for the backward pass.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/batch_norm_v1.cc:L92
- * @param data Input data to batch normalization - * @param gamma gamma array - * @param beta beta array - * @param eps Epsilon to prevent div 0 - * @param momentum Momentum for moving average - * @param fix_gamma Fix gamma while training - * @param use_global_stats Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator. - * @param output_mean_var Output All,normal mean and var - * @return org.apache.mxnet.NDArray - */ -@Experimental -def BatchNorm_v1 (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, beta : org.apache.mxnet.NDArray, eps : Option[org.apache.mxnet.Base.MXFloat] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, fix_gamma : Option[Boolean] = None, use_global_stats : Option[Boolean] = None, output_mean_var : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies bilinear sampling to input feature map.
- *
- * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
- * except that the operator has the backward pass.
- *
- * Given :math:`data` and :math:`grid`, then the output is computed by
- *
- * .. math::
- * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
- * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
- * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
- *
- * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
- * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
- *
- * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
- *
- * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
- * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
- * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
- *
- * Example 1::
- *
- * ## Zoom out data two times
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * affine_matrix = array([[2, 0, 0],
- * [0, 2, 0]])
- *
- * affine_matrix = reshape(affine_matrix, shape=(1, 6))
- *
- * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
- *
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 0, 0, 0, 0],
- * [ 0, 3.5, 6.5, 0],
- * [ 0, 1.25, 2.5, 0],
- * [ 0, 0, 0, 0]]]
- *
- *
- * Example 2::
- *
- * ## shift data horizontally by -1 pixel
- *
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * warp_maxtrix = array([[[[1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1]],
- * [[0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0]]]])
- *
- * grid = GridGenerator(data=warp_matrix, transform_type='warp')
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 4, 3, 6, 0],
- * [ 8, 8, 9, 0],
- * [ 4, 1, 5, 0],
- * [ 0, 1, 3, 0]]]
- *
- *
- * Defined in src/operator/bilinear_sampler.cc:L245
- * @param data Input data to the BilinearsamplerOp. - * @param grid Input grid to the BilinearsamplerOp.grid has two channels: x_src, y_src - * @return org.apache.mxnet.NDArray - */ -@Experimental -def BilinearSampler (data : org.apache.mxnet.NDArray, grid : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def BlockGrad (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @param data The input. - * @param dtype Output data type. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Cast (data : org.apache.mxnet.NDArray, dtype : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @param data List of arrays to concatenate - * @param num_args Number of inputs to be concated. - * @param dim the dimension to be concated. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Concat (data : Array[org.apache.mxnet.NDArray], num_args : Int, dim : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Compute *N*-D convolution on *(N+2)*-D input.
- *
- * In the 2-D convolution, given input data with shape *(batch_size,
- * channel, height, width)*, the output is computed by
- *
- * .. math::
- *
- * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
- * weight[i,j,:,:]
- *
- * where :math:`\star` is the 2-D cross-correlation operator.
- *
- * For general 2-D convolution, the shapes are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*.
- *
- * Define::
- *
- * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
- *
- * then we have::
- *
- * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
- * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
- * width)*. We can choose other layouts such as *NHWC*.
- *
- * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
- * evenly into *g* parts along the channel axis, and also evenly split ``weight``
- * along the first dimension. Next compute the convolution on the *i*-th part of
- * the data with the *i*-th weight part. The output is obtained by concatenating all
- * the *g* results.
- *
- * 1-D convolution does not have *height* dimension but only *width* in space.
- *
- * - **data**: *(batch_size, channel, width)*
- * - **weight**: *(num_filter, channel, kernel[0])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * 3-D convolution adds an additional *depth* dimension besides *height* and
- * *width*. The shapes are
- *
- * - **data**: *(batch_size, channel, depth, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
- *
- * Both ``weight`` and ``bias`` are learnable parameters.
- *
- * There are other options to tune the performance.
- *
- * - **cudnn_tune**: enable this option leads to higher startup time but may give
- * faster speed. Options are
- *
- * - **off**: no tuning
- * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
- * exceed workspace limit.
- * - **fastest**: pick the fastest algorithm and ignore workspace limit.
- * - **None** (default): the behavior is determined by environment variable
- * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
- * (default), 2 for fastest.
- *
- * - **workspace**: A large number leads to more (GPU) memory usage but may improve
- * the performance.
- *
- *
- *
- * Defined in src/operator/nn/convolution.cc:L470
- * @param data Input data to the ConvolutionOp. - * @param weight Weight matrix. - * @param bias Bias parameter. - * @param kernel Convolution kernel size: (w,), (h, w) or (d, h, w) - * @param stride Convolution stride: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. - * @param dilate Convolution dilate: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. - * @param pad Zero pad for convolution: (w,), (h, w) or (d, h, w). Defaults to no padding. - * @param num_filter Convolution filter(channel) number - * @param num_group Number of group partitions. - * @param workspace Maximum temporary workspace allowed (MB) in convolution.This parameter has two usages. When CUDNN is not used, it determines the effective batch size of the convolution kernel. When CUDNN is used, it controls the maximum temporary storage used for tuning the best CUDNN kernel when `limited_workspace` strategy is used. - * @param no_bias Whether to disable bias parameter. - * @param cudnn_tune Whether to pick convolution algo by running performance test. - * @param cudnn_off Turn off cudnn for this layer. - * @param layout Set layout for input, output and weight. Empty for - default layout: NCW for 1d, NCHW for 2d and NCDHW for 3d. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Convolution (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, bias : org.apache.mxnet.NDArray, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * This operator is DEPRECATED. Apply convolution to input then add a bias.
- * @param data Input data to the ConvolutionV1Op. - * @param weight Weight matrix. - * @param bias Bias parameter. - * @param kernel convolution kernel size: (h, w) or (d, h, w) - * @param stride convolution stride: (h, w) or (d, h, w) - * @param dilate convolution dilate: (h, w) or (d, h, w) - * @param pad pad for convolution: (h, w) or (d, h, w) - * @param num_filter convolution filter(channel) number - * @param num_group Number of group partitions. Equivalent to slicing input into num_group - partitions, apply convolution on each, then concatenate the results - * @param workspace Maximum temporary workspace allowed for convolution (MB).This parameter determines the effective batch size of the convolution kernel, which may be smaller than the given batch size. Also, the workspace will be automatically enlarged to make sure that we can run the kernel with batch_size=1 - * @param no_bias Whether to disable bias parameter. - * @param cudnn_tune Whether to pick convolution algo by running performance test. - Leads to higher startup time but may give faster speed. Options are: - 'off': no tuning - 'limited_workspace': run test and pick the fastest algorithm that doesn't exceed workspace limit. - 'fastest': pick the fastest algorithm and ignore workspace limit. - If set to None (default), behavior is determined by environment - variable MXNET_CUDNN_AUTOTUNE_DEFAULT: 0 for off, - 1 for limited workspace (default), 2 for fastest. - * @param cudnn_off Turn off cudnn for this layer. - * @param layout Set layout for input, output and weight. Empty for - default layout: NCHW for 2d and NCDHW for 3d. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Convolution_v1 (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, bias : org.apache.mxnet.NDArray, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies correlation to inputs.
- *
- * The correlation layer performs multiplicative patch comparisons between two feature maps.
- *
- * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
- * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
- *
- * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
- * :math:`x_{2}` in the second map is then defined as:
- *
- * .. math::
- *
- * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
- *
- * for a square patch of size :math:`K:=2k+1`.
- *
- * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
- * data. For this reason, it has no training weights.
- *
- * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
- *
- * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
- * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
- * centered around :math:`x_{1}`.
- *
- * The final output is defined by the following expression:
- *
- * .. math::
- * out[n, q, i, j] = c(x_{i, j}, x_{q})
- *
- * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
- *
- *
- * Defined in src/operator/correlation.cc:L198
- * @param data1 Input data1 to the correlation. - * @param data2 Input data2 to the correlation. - * @param kernel_size kernel size for Correlation must be an odd number - * @param max_displacement Max displacement of Correlation - * @param stride1 stride1 quantize data1 globally - * @param stride2 stride2 quantize data2 within the neighborhood centered around data1 - * @param pad_size pad for Correlation - * @param is_multiply operation type is either multiplication or subduction - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Correlation (data1 : org.apache.mxnet.NDArray, data2 : org.apache.mxnet.NDArray, kernel_size : Option[Int] = None, max_displacement : Option[Int] = None, stride1 : Option[Int] = None, stride2 : Option[Int] = None, pad_size : Option[Int] = None, is_multiply : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - *
- *
- * .. note:: `Crop` is deprecated. Use `slice` instead.
- *
- * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
- * with width and height of the second input symbol, i.e., with one input, we need h_w to
- * specify the crop height and width, otherwise the second input symbol's size will be used
- *
- *
- * Defined in src/operator/crop.cc:L50
- * @param data Tensor or List of Tensors, the second input will be used as crop_like shape reference - * @param num_args Number of inputs for crop, if equals one, then we will use the h_wfor crop height and width, else if equals two, then we will use the heightand width of the second input symbol, we name crop_like here - * @param offset crop offset coordinate: (y, x) - * @param h_w crop height and width: (h, w) - * @param center_crop If set to true, then it will use be the center_crop,or it will crop using the shape of crop_like - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Crop (data : Array[org.apache.mxnet.NDArray], num_args : Int, offset : Option[org.apache.mxnet.Shape] = None, h_w : Option[org.apache.mxnet.Shape] = None, center_crop : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Apply a custom operator implemented in a frontend language (like Python).
- *
- * Custom operators should override required methods like `forward` and `backward`.
- * The custom operator must be registered before it can be used.
- * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
- *
- *
- *
- * Defined in src/operator/custom/custom.cc:L547
- * @param data Input data for the custom operator. - * @param op_type Name of the custom operator. This is the name that is passed to `mx.operator.register` to register the operator. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Custom (data : Array[org.apache.mxnet.NDArray], op_type : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
- * @param data Input tensor to the deconvolution operation. - * @param weight Weights representing the kernel. - * @param bias Bias added to the result after the deconvolution operation. - * @param kernel Deconvolution kernel size: (w,), (h, w) or (d, h, w). This is same as the kernel size used for the corresponding convolution - * @param stride The stride used for the corresponding convolution: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. - * @param dilate Dilation factor for each dimension of the input: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. - * @param pad The amount of implicit zero padding added during convolution for each dimension of the input: (w,), (h, w) or (d, h, w). ``(kernel-1)/2`` is usually a good choice. If `target_shape` is set, `pad` will be ignored and a padding that will generate the target shape will be used. Defaults to no padding. - * @param adj Adjustment for output shape: (w,), (h, w) or (d, h, w). If `target_shape` is set, `adj` will be ignored and computed accordingly. - * @param target_shape Shape of the output tensor: (w,), (h, w) or (d, h, w). - * @param num_filter Number of output filters. - * @param num_group Number of groups partition. - * @param workspace Maximum temporary workspace allowed (MB) in deconvolution.This parameter has two usages. When CUDNN is not used, it determines the effective batch size of the deconvolution kernel. When CUDNN is used, it controls the maximum temporary storage used for tuning the best CUDNN kernel when `limited_workspace` strategy is used. - * @param no_bias Whether to disable bias parameter. - * @param cudnn_tune Whether to pick convolution algorithm by running performance test. - * @param cudnn_off Turn off cudnn for this layer. - * @param layout Set layout for input, output and weight. Empty for default layout, NCW for 1d, NCHW for 2d and NCDHW for 3d. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Deconvolution (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, bias : org.apache.mxnet.NDArray, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, adj : Option[org.apache.mxnet.Shape] = None, target_shape : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies dropout operation to input array.
- *
- * - During training, each element of the input is set to zero with probability p.
- * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
- * sum of the input unchanged.
- *
- * - During testing, this operator does not change the input if mode is 'training'.
- * If mode is 'always', the same computaion as during training will be applied.
- *
- * Example::
- *
- * random.seed(998)
- * input_array = array([[3., 0.5, -0.5, 2., 7.],
- * [2., -0.4, 7., 3., 0.2]])
- * a = symbol.Variable('a')
- * dropout = symbol.Dropout(a, p = 0.2)
- * executor = dropout.simple_bind(a = input_array.shape)
- *
- * ## If training
- * executor.forward(is_train = True, a = input_array)
- * executor.outputs
- * [[ 3.75 0.625 -0. 2.5 8.75 ]
- * [ 2.5 -0.5 8.75 3.75 0. ]]
- *
- * ## If testing
- * executor.forward(is_train = False, a = input_array)
- * executor.outputs
- * [[ 3. 0.5 -0.5 2. 7. ]
- * [ 2. -0.4 7. 3. 0.2 ]]
- *
- *
- * Defined in src/operator/nn/dropout.cc:L76
- * @param data Input array to which dropout will be applied. - * @param p Fraction of the input that gets dropped out during training time. - * @param mode Whether to only turn on dropout during training or to also turn on for inference. - * @param axes Axes for variational dropout kernel. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Dropout (data : org.apache.mxnet.NDArray, p : Option[org.apache.mxnet.Base.MXFloat] = None, mode : Option[String] = None, axes : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @param args Positional input arguments - * @return org.apache.mxnet.NDArray - */ -@Experimental -def ElementWiseSum (args : Array[org.apache.mxnet.NDArray], out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Maps integer indices to vector representations (embeddings).
- *
- * This operator maps words to real-valued vectors in a high-dimensional space,
- * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
- * For example, it has been noted that in the learned embedding spaces, similar words tend
- * to be close to each other and dissimilar words far apart.
- *
- * For an input array of shape (d1, ..., dK),
- * the shape of an output array is (d1, ..., dK, output_dim).
- * All the input values should be integers in the range [0, input_dim).
- *
- * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
- * (ip0, op0).
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last vector in an embedding matrix.
- *
- * Examples::
- *
- * input_dim = 4
- * output_dim = 5
- *
- * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
- * y = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.],
- * [ 10., 11., 12., 13., 14.],
- * [ 15., 16., 17., 18., 19.]]
- *
- * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
- * x = [[ 1., 3.],
- * [ 0., 2.]]
- *
- * // Mapped input x to its vector representation y.
- * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
- * [ 15., 16., 17., 18., 19.]],
- *
- * [[ 0., 1., 2., 3., 4.],
- * [ 10., 11., 12., 13., 14.]]]
- *
- *
- * The storage type of weight can be either row_sparse or default, while
- * the storage type of weight's grad depends on the value of "sparse_grad".
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L232
- * @param data The input array to the embedding operator. - * @param weight The embedding weight matrix. - * @param input_dim Vocabulary size of the input indices. - * @param output_dim Dimension of the embedding vectors. - * @param dtype Data type of weight. - * @param sparse_grad Compute row sparse gradient in the backward calculation. If set to True, the grad's storage type is row_sparse. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Embedding (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, input_dim : Int, output_dim : Int, dtype : Option[String] = None, sparse_grad : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @param data Input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Flatten (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies a linear transformation: :math:`Y = XW^T + b`.
- *
- * If ``flatten`` is set to be true, then the shapes are:
- *
- * - **data**: `(batch_size, x1, x2, ..., xn)`
- * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(batch_size, num_hidden)`
- *
- * If ``flatten`` is set to be false, then the shapes are:
- *
- * - **data**: `(x1, x2, ..., xn, input_dim)`
- * - **weight**: `(num_hidden, input_dim)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(x1, x2, ..., xn, num_hidden)`
- *
- * The learnable parameters include both ``weight`` and ``bias``.
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * Note that the operator also supports forward computation with `row_sparse` weight and bias,
- * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
- * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
- *
- *
- *
- * Defined in src/operator/nn/fully_connected.cc:L254
- * @param data Input data. - * @param weight Weight matrix. - * @param bias Bias parameter. - * @param num_hidden Number of hidden nodes of the output. - * @param no_bias Whether to disable bias parameter. - * @param flatten Whether to collapse all but the first axis of the input data tensor. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def FullyConnected (data : org.apache.mxnet.NDArray, weight : org.apache.mxnet.NDArray, bias : org.apache.mxnet.NDArray, num_hidden : Int, no_bias : Option[Boolean] = None, flatten : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Generates 2D sampling grid for bilinear sampling.
- * @param data Input data to the function. - * @param transform_type The type of transformation. For `affine`, input data should be an affine matrix of size (batch, 6). For `warp`, input data should be an optical flow of size (batch, 2, h, w). - * @param target_shape Specifies the output shape (H, W). This is required if transformation type is `affine`. If transformation type is `warp`, this parameter is ignored. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def GridGenerator (data : org.apache.mxnet.NDArray, transform_type : String, target_shape : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Apply a sparse regularization to the output a sigmoid activation function.
- * @param data Input data. - * @param sparseness_target The sparseness target - * @param penalty The tradeoff parameter for the sparseness penalty - * @param momentum The momentum for running average - * @return org.apache.mxnet.NDArray - */ -@Experimental -def IdentityAttachKLSparseReg (data : org.apache.mxnet.NDArray, sparseness_target : Option[org.apache.mxnet.Base.MXFloat] = None, penalty : Option[org.apache.mxnet.Base.MXFloat] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies instance normalization to the n-dimensional input array.
- *
- * This operator takes an n-dimensional input array where (n>2) and normalizes
- * the input using the following formula:
- *
- * .. math::
- *
- * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
- *
- * This layer is similar to batch normalization layer (`BatchNorm`)
- * with two differences: first, the normalization is
- * carried out per example (instance), not over a batch. Second, the
- * same normalization is applied both at test and train time. This
- * operation is also known as `contrast normalization`.
- *
- * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
- * `gamma` and `beta` parameters must be vectors of shape [channel].
- *
- * This implementation is based on paper:
- *
- * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
- * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
- *
- * Examples::
- *
- * // Input of shape (2,1,2)
- * x = [[[ 1.1, 2.2]],
- * [[ 3.3, 4.4]]]
- *
- * // gamma parameter of length 1
- * gamma = [1.5]
- *
- * // beta parameter of length 1
- * beta = [0.5]
- *
- * // Instance normalization is calculated with the above formula
- * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
- * [[-0.99752653, 1.99752724]]]
- *
- *
- *
- * Defined in src/operator/instance_norm.cc:L95
- * @param data An n-dimensional input array (n > 2) of the form [batch, channel, spatial_dim1, spatial_dim2, ...]. - * @param gamma A vector of length 'channel', which multiplies the normalized input. - * @param beta A vector of length 'channel', which is added to the product of the normalized input and the weight. - * @param eps An `epsilon` parameter to prevent division by 0. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def InstanceNorm (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, beta : org.apache.mxnet.NDArray, eps : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Normalize the input array using the L2 norm.
- *
- * For 1-D NDArray, it computes::
- *
- * out = data / sqrt(sum(data ** 2) + eps)
- *
- * For N-D NDArray, if the input array has shape (N, N, ..., N),
- *
- * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
- * array by its L2 norm.::
- *
- * for i in 0...N
- * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
- *
- * for i in 0...N
- * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
- * in the array by its L2 norm.::
- *
- * for dim in 2...N
- * for i in 0...N
- * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
- * -dim-
- *
- * Example::
- *
- * x = [[[1,2],
- * [3,4]],
- * [[2,2],
- * [5,6]]]
- *
- * L2Normalization(x, mode='instance')
- * =[[[ 0.18257418 0.36514837]
- * [ 0.54772252 0.73029673]]
- * [[ 0.24077171 0.24077171]
- * [ 0.60192931 0.72231513]]]
- *
- * L2Normalization(x, mode='channel')
- * =[[[ 0.31622776 0.44721359]
- * [ 0.94868326 0.89442718]]
- * [[ 0.37139067 0.31622776]
- * [ 0.92847669 0.94868326]]]
- *
- * L2Normalization(x, mode='spatial')
- * =[[[ 0.44721359 0.89442718]
- * [ 0.60000002 0.80000001]]
- * [[ 0.70710677 0.70710677]
- * [ 0.6401844 0.76822126]]]
- *
- *
- *
- * Defined in src/operator/l2_normalization.cc:L98
- * @param data Input array to normalize. - * @param eps A small constant for numerical stability. - * @param mode Specify the dimension along which to compute L2 norm. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def L2Normalization (data : org.apache.mxnet.NDArray, eps : Option[org.apache.mxnet.Base.MXFloat] = None, mode : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies local response normalization to the input.
- *
- * The local response normalization layer performs "lateral inhibition" by normalizing
- * over local input regions.
- *
- * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
- * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
- * activity :math:`b_{x,y}^{i}` is given by the expression:
- *
- * .. math::
- * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
- *
- * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
- * number of kernels in the layer.
- *
- *
- *
- * Defined in src/operator/nn/lrn.cc:L175
- * @param data Input data to LRN - * @param alpha The variance scaling parameter :math:`lpha` in the LRN expression. - * @param beta The power parameter :math:`eta` in the LRN expression. - * @param knorm The parameter :math:`k` in the LRN expression. - * @param nsize normalization window width in elements. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def LRN (data : org.apache.mxnet.NDArray, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, knorm : Option[org.apache.mxnet.Base.MXFloat] = None, nsize : Int, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Layer normalization.
- *
- * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis and then
- * compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
- *
- * Both ``gamma`` and ``beta`` are learnable parameters.
- *
- * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_std``. Note that no gradient will be passed through these two outputs.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is -1, which sets the channel
- * axis to be the last item in the input shape.
- *
- *
- *
- * Defined in src/operator/nn/layer_norm.cc:L94
- * @param data Input data to layer normalization - * @param gamma gamma array - * @param beta beta array - * @param axis The axis to perform layer normalization. Usually, this should be be axis of the channel dimension. Negative values means indexing from right to left. - * @param eps An `epsilon` parameter to prevent division by 0. - * @param output_mean_var Output the mean and std calculated along the given axis. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def LayerNorm (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, beta : org.apache.mxnet.NDArray, axis : Option[Int] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, output_mean_var : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies Leaky rectified linear unit activation element-wise to the input.
- *
- * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
- * when the input is negative and has a slope of one when input is positive.
- *
- * The following modified ReLU Activation functions are supported:
- *
- * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
- * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
- * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
- * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
- * *[lower_bound, upper_bound)* for training, while fixed to be
- * *(lower_bound+upper_bound)/2* for inference.
- *
- *
- *
- * Defined in src/operator/leaky_relu.cc:L63
- * @param data Input data to activation function. - * @param gamma Slope parameter for PReLU. Only required when act_type is 'prelu'. It should be either a vector of size 1, or the same size as the second dimension of data. - * @param act_type Activation function to be applied. - * @param slope Init slope for the activation. (For leaky and elu only) - * @param lower_bound Lower bound of random slope. (For rrelu only) - * @param upper_bound Upper bound of random slope. (For rrelu only) - * @return org.apache.mxnet.NDArray - */ -@Experimental -def LeakyReLU (data : org.apache.mxnet.NDArray, gamma : org.apache.mxnet.NDArray, act_type : Option[String] = None, slope : Option[org.apache.mxnet.Base.MXFloat] = None, lower_bound : Option[org.apache.mxnet.Base.MXFloat] = None, upper_bound : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes and optimizes for squared loss during backward propagation.
- * Just outputs ``data`` during forward propagation.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the squared loss estimated over :math:`n` samples is defined as
- *
- * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
- *
- * .. note::
- * Use the LinearRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LinearRegressionOutput(default, default) = default
- * - LinearRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L92
- * @param data Input data to the function. - * @param label Input label to the function. - * @param grad_scale Scale the gradient by a float factor - * @return org.apache.mxnet.NDArray - */ -@Experimental -def LinearRegressionOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies a logistic function to the input.
- *
- * The logistic function, also known as the sigmoid function, is computed as
- * :math:`\frac{1}{1+exp(-\textbf{x})}`.
- *
- * Commonly, the sigmoid is used to squash the real-valued output of a linear model
- * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
- * It is suitable for binary classification or probability prediction tasks.
- *
- * .. note::
- * Use the LogisticRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LogisticRegressionOutput(default, default) = default
- * - LogisticRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L148
- * @param data Input data to the function. - * @param label Input label to the function. - * @param grad_scale Scale the gradient by a float factor - * @return org.apache.mxnet.NDArray - */ -@Experimental -def LogisticRegressionOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes mean absolute error of the input.
- *
- * MAE is a risk metric corresponding to the expected value of the absolute error.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
- *
- * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
- *
- * .. note::
- * Use the MAERegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - MAERegressionOutput(default, default) = default
- * - MAERegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L120
- * @param data Input data to the function. - * @param label Input label to the function. - * @param grad_scale Scale the gradient by a float factor - * @return org.apache.mxnet.NDArray - */ -@Experimental -def MAERegressionOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = MakeLoss(cross_entropy)
- *
- * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * In addition, we can give a scale to the loss by setting ``grad_scale``,
- * so that the gradient of the loss will be rescaled in the backpropagation.
- *
- * .. note:: This operator should be used as a Symbol instead of NDArray.
- *
- *
- *
- * Defined in src/operator/make_loss.cc:L71
- * @param data Input array. - * @param grad_scale Gradient scale as a supplement to unary and binary operators - * @param valid_thresh clip each element in the array to 0 when it is less than ``valid_thresh``. This is used when ``normalization`` is set to ``'valid'``. - * @param normalization If this is set to null, the output gradient will not be normalized. If this is set to batch, the output gradient will be divided by the batch size. If this is set to valid, the output gradient will be divided by the number of valid input elements. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def MakeLoss (data : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, valid_thresh : Option[org.apache.mxnet.Base.MXFloat] = None, normalization : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @param data An n-dimensional input array. - * @param mode Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges. - * @param pad_width Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ... , before_N, after_N)``. It should be of length ``2*N`` where ``N`` is the number of dimensions of the array.This is equivalent to pad_width in numpy.pad, but flattened. - * @param constant_value The value used for padding when `mode` is "constant". - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Pad (data : org.apache.mxnet.NDArray, mode : String, pad_width : org.apache.mxnet.Shape, constant_value : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs pooling on the input.
- *
- * The shapes for 1-D pooling are
- *
- * - **data**: *(batch_size, channel, width)*,
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * The shapes for 2-D pooling are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- * - **lp**: Lp pooling
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- * Notes on Lp pooling:
- *
- * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
- * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
- * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
- *
- * For each window ``X``, the mathematical expression for Lp pooling is:
- *
- * ..math::
- * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
- *
- *
- *
- * Defined in src/operator/nn/pooling.cc:L367
- * @param data Input data to the pooling operator. - * @param kernel Pooling kernel size: (y, x) or (d, y, x) - * @param pool_type Pooling type to be applied. - * @param global_pool Ignore kernel size, do global pooling based on current input feature map. - * @param cudnn_off Turn off cudnn pooling and use MXNet pooling operator. - * @param pooling_convention Pooling convention to be applied. - * @param stride Stride: for pooling (y, x) or (d, y, x). Defaults to 1 for each dimension. - * @param pad Pad for pooling: (y, x) or (d, y, x). Defaults to no padding. - * @param p_value Value of p for Lp pooling, can be 1 or 2, required for Lp Pooling. - * @param count_include_pad Only used for AvgPool, specify whether to count padding elements for averagecalculation. For example, with a 5*5 kernel on a 3*3 corner of a image,the sum of the 9 valid elements will be divided by 25 if this is set to true,or it will be divided by 9 if this is set to false. Defaults to true. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Pooling (data : org.apache.mxnet.NDArray, kernel : Option[org.apache.mxnet.Shape] = None, pool_type : Option[String] = None, global_pool : Option[Boolean] = None, cudnn_off : Option[Boolean] = None, pooling_convention : Option[String] = None, stride : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, p_value : Option[Int] = None, count_include_pad : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * This operator is DEPRECATED.
- * Perform pooling on the input.
- *
- * The shapes for 2-D pooling is
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- *
- * 1-D pooling is special case of 2-D pooling with *weight=1* and
- * *kernel[1]=1*.
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- *
- *
- * Defined in src/operator/pooling_v1.cc:L104
- * @param data Input data to the pooling operator. - * @param kernel pooling kernel size: (y, x) or (d, y, x) - * @param pool_type Pooling type to be applied. - * @param global_pool Ignore kernel size, do global pooling based on current input feature map. - * @param pooling_convention Pooling convention to be applied. - * @param stride stride: for pooling (y, x) or (d, y, x) - * @param pad pad for pooling: (y, x) or (d, y, x) - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Pooling_v1 (data : org.apache.mxnet.NDArray, kernel : Option[org.apache.mxnet.Shape] = None, pool_type : Option[String] = None, global_pool : Option[Boolean] = None, pooling_convention : Option[String] = None, stride : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
- * implemented, with both multi-layer and bidirectional support.
- *
- * **Vanilla RNN**
- *
- * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
- * ReLU and Tanh.
- *
- * With ReLU activation function:
- *
- * .. math::
- * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * With Tanh activtion function:
- *
- * .. math::
- * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * Reference paper: Finding structure in time - Elman, 1988.
- * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
- *
- * **LSTM**
- *
- * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
- *
- * .. math::
- * \begin{array}{ll}
- * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
- * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
- * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
- * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
- * c_t = f_t * c_{(t-1)} + i_t * g_t \\
- * h_t = o_t * \tanh(c_t)
- * \end{array}
- *
- * **GRU**
- *
- * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
- *
- * The definition of GRU here is slightly different from paper but compatible with CUDNN.
- *
- * .. math::
- * \begin{array}{ll}
- * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
- * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
- * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
- * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
- * \end{array}
- * @param data Input data to RNN - * @param parameters Vector of all RNN trainable parameters concatenated - * @param state initial hidden state of the RNN - * @param state_cell initial cell state for LSTM networks (only for LSTM) - * @param state_size size of the state for each layer - * @param num_layers number of stacked layers - * @param bidirectional whether to use bidirectional recurrent layers - * @param mode the type of RNN to compute - * @param p Dropout probability, fraction of the input that gets dropped out at training time - * @param state_outputs Whether to have the states as symbol outputs. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def RNN (data : org.apache.mxnet.NDArray, parameters : org.apache.mxnet.NDArray, state : org.apache.mxnet.NDArray, state_cell : org.apache.mxnet.NDArray, state_size : Int, num_layers : Int, bidirectional : Option[Boolean] = None, mode : String, p : Option[org.apache.mxnet.Base.MXFloat] = None, state_outputs : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs region of interest(ROI) pooling on the input array.
- *
- * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
- * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
- * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
- * layer mostly used in training a `Fast R-CNN` network for object detection.
- *
- * This operator takes a 4D feature map as an input array and region proposals as `rois`,
- * then it pools over sub-regions of input and produces a fixed-sized output array
- * regardless of the ROI size.
- *
- * To crop the feature map accordingly, you can resize the bounding box coordinates
- * by changing the parameters `rois` and `spatial_scale`.
- *
- * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
- * indicated by a `pooled_size` parameter. batch_size will change to the number of region
- * bounding boxes after `ROIPooling`.
- *
- * The size of each region of interest doesn't have to be perfectly divisible by
- * the number of pooling sections(`pooled_size`).
- *
- * Example::
- *
- * x = [[[[ 0., 1., 2., 3., 4., 5.],
- * [ 6., 7., 8., 9., 10., 11.],
- * [ 12., 13., 14., 15., 16., 17.],
- * [ 18., 19., 20., 21., 22., 23.],
- * [ 24., 25., 26., 27., 28., 29.],
- * [ 30., 31., 32., 33., 34., 35.],
- * [ 36., 37., 38., 39., 40., 41.],
- * [ 42., 43., 44., 45., 46., 47.]]]]
- *
- * // region of interest i.e. bounding box coordinates.
- * y = [[0,0,0,4,4]]
- *
- * // returns array of shape (2,2) according to the given roi with max pooling.
- * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
- * [ 26., 28.]]]]
- *
- * // region of interest is changed due to the change in `spacial_scale` parameter.
- * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
- * [ 19., 21.]]]]
- *
- *
- *
- * Defined in src/operator/roi_pooling.cc:L295
- * @param data The input array to the pooling operator, a 4D Feature maps - * @param rois Bounding box coordinates, a 2D array of [[batch_index, x1, y1, x2, y2]], where (x1, y1) and (x2, y2) are top left and bottom right corners of designated region of interest. `batch_index` indicates the index of corresponding image in the input array - * @param pooled_size ROI pooling output shape (h,w) - * @param spatial_scale Ratio of input feature map height (or w) to raw image height (or w). Equals the reciprocal of total stride in convolutional layers - * @return org.apache.mxnet.NDArray - */ -@Experimental -def ROIPooling (data : org.apache.mxnet.NDArray, rois : org.apache.mxnet.NDArray, pooled_size : org.apache.mxnet.Shape, spatial_scale : org.apache.mxnet.Base.MXFloat, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @param data Input data to reshape. - * @param shape The target shape - * @param reverse If true then the special values are inferred from right to left - * @param target_shape (Deprecated! Use ``shape`` instead.) Target new shape. One and only one dim can be 0, in which case it will be inferred from the rest of dims - * @param keep_highest (Deprecated! Use ``shape`` instead.) Whether keep the highest dim unchanged.If set to true, then the first dim in target_shape is ignored,and always fixed as input - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Reshape (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, reverse : Option[Boolean] = None, target_shape : Option[org.apache.mxnet.Shape] = None, keep_highest : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes support vector machine based transformation of the input.
- *
- * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
- * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
- * @param data Input data for SVM transformation. - * @param label Class label for the input data. - * @param margin The loss function penalizes outputs that lie outside this margin. Default margin is 1. - * @param regularization_coefficient Regularization parameter for the SVM. This balances the tradeoff between coefficient size and error. - * @param use_linear Whether to use L1-SVM objective. L2-SVM objective is used by default. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def SVMOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, margin : Option[org.apache.mxnet.Base.MXFloat] = None, regularization_coefficient : Option[org.apache.mxnet.Base.MXFloat] = None, use_linear : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Takes the last element of a sequence.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
- * of the form [batch_size, other_feature_dims].
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
- * an input array of positive ints of dimension [batch_size]. To use this parameter,
- * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
- * to have the max sequence length.
- *
- * .. note:: Alternatively, you can also use `take` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]],
- *
- * [[ 10., 11., 12.],
- * [ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]]
- *
- * // returns last sequence when sequence_length parameter is not used
- * SequenceLast(x) = [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 13., 14., 15.],
- * [ 25., 26., 27.]]
- *
- *
- *
- * Defined in src/operator/sequence_last.cc:L92
- * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2 - * @param sequence_length vector of sequence lengths of the form [batch_size] - * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence - * @param axis The sequence axis. Only values of 0 and 1 are currently supported. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def SequenceLast (data : org.apache.mxnet.NDArray, sequence_length : org.apache.mxnet.NDArray, use_sequence_length : Option[Boolean] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Sets all elements outside the sequence to a constant value.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
- * should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length and
- * this operator works as the `identity` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // works as identity operator when sequence_length parameter is not used
- * SequenceMask(x) = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [1,1] means 1 of each batch will be kept
- * // and other rows are masked with default mask value = 0
- * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]]]
- *
- * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
- * // and other rows are masked with value = 1
- * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 1., 1.],
- * [ 16., 17., 18.]]]
- *
- *
- *
- * Defined in src/operator/sequence_mask.cc:L114
- * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2 - * @param sequence_length vector of sequence lengths of the form [batch_size] - * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence - * @param value The value to be used as a mask. - * @param axis The sequence axis. Only values of 0 and 1 are currently supported. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def SequenceMask (data : org.apache.mxnet.NDArray, sequence_length : org.apache.mxnet.NDArray, use_sequence_length : Option[Boolean] = None, value : Option[org.apache.mxnet.Base.MXFloat] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reverses the elements of each sequence.
- *
- * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
- * and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences.
- * `sequence_length` should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // returns reverse sequence when sequence_length parameter is not used
- * SequenceReverse(x) = [[[ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]]]
- *
- * // sequence_length [2,2] means 2 rows of
- * // both batch B1 and B2 will be reversed.
- * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
- * // will be reversed.
- * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 16., 17., 18.]],
- *
- * [[ 1., 2., 3.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14, 15.],
- * [ 4., 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/sequence_reverse.cc:L113
- * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other dims] where n>2 - * @param sequence_length vector of sequence lengths of the form [batch_size] - * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence - * @param axis The sequence axis. Only 0 is currently supported. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def SequenceReverse (data : org.apache.mxnet.NDArray, sequence_length : org.apache.mxnet.NDArray, use_sequence_length : Option[Boolean] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @param data The input - * @param num_outputs Number of splits. Note that this should evenly divide the length of the `axis`. - * @param axis Axis along which to split. - * @param squeeze_axis If true, Removes the axis with length 1 from the shapes of the output arrays. **Note** that setting `squeeze_axis` to ``true`` removes axis with length 1 only along the `axis` which it is split. Also `squeeze_axis` can be set to ``true`` only if ``input.shape[axis] == num_outputs``. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def SliceChannel (data : org.apache.mxnet.NDArray, num_outputs : Int, axis : Option[Int] = None, squeeze_axis : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Please use `SoftmaxOutput`.
- *
- * .. note::
- *
- * This operator has been renamed to `SoftmaxOutput`, which
- * computes the gradient of cross-entropy loss w.r.t softmax output.
- * To just compute softmax output, use the `softmax` operator.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L138
- * @param data Input array. - * @param grad_scale Scales the gradient by a float factor. - * @param ignore_label The instances whose `labels` == `ignore_label` will be ignored during backward, if `use_ignore` is set to ``true``). - * @param multi_output If set to ``true``, the softmax function will be computed along axis ``1``. This is applied when the shape of input array differs from the shape of label array. - * @param use_ignore If set to ``true``, the `ignore_label` value will not contribute to the backward gradient. - * @param preserve_shape If set to ``true``, the softmax function will be computed along the last axis (``-1``). - * @param normalization Normalizes the gradient. - * @param out_grad Multiplies gradient with output gradient element-wise. - * @param smooth_alpha Constant for computing a label smoothed version of cross-entropyfor the backwards pass. This constant gets subtracted from theone-hot encoding of the gold label and distributed uniformly toall other labels. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def Softmax (data : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, ignore_label : Option[org.apache.mxnet.Base.MXFloat] = None, multi_output : Option[Boolean] = None, use_ignore : Option[Boolean] = None, preserve_shape : Option[Boolean] = None, normalization : Option[String] = None, out_grad : Option[Boolean] = None, smooth_alpha : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies softmax activation to input. This is intended for internal layers.
- *
- * .. note::
- *
- * This operator has been deprecated, please use `softmax`.
- *
- * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
- * This is the default mode.
- *
- * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
- * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
- * has at least 3 dimensions.
- * This can be used for `fully convolutional network`, `image segmentation`, etc.
- *
- * Example::
- *
- * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
- * >>> [2., -.4, 7., 3., 0.2]])
- * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
- * >>> print softmax_act.asnumpy()
- * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
- * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
- *
- *
- *
- * Defined in src/operator/nn/softmax_activation.cc:L59
- * @param data The input array. - * @param mode Specifies how to compute the softmax. If set to ``instance``, it computes softmax for each instance. If set to ``channel``, It computes cross channel softmax for each position of each instance. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def SoftmaxActivation (data : org.apache.mxnet.NDArray, mode : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the gradient of cross entropy loss with respect to softmax output.
- *
- * - This operator computes the gradient in two steps.
- * The cross entropy loss does not actually need to be computed.
- *
- * - Applies softmax function on the input array.
- * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
- *
- * - The softmax function, cross entropy loss and gradient is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * - The gradient of cross entropy loss w.r.t softmax output:
- *
- * .. math:: \text{gradient} = \text{output} - \text{label}
- *
- * - During forward propagation, the softmax function is computed for each instance in the input array.
- *
- * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
- * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
- * and `multi_output` to specify the way to compute softmax:
- *
- * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
- * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
- * each row in the reshaped array, and afterwards reshape it back to the original shape
- * :math:`(d_1, d_2, ..., d_n)`.
- * - If `preserve_shape` is ``true``, the softmax function will be computed along
- * the last axis (`axis` = ``-1``).
- * - If `multi_output` is ``true``, the softmax function will be computed along
- * the second axis (`axis` = ``1``).
- *
- * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
- * The provided label can be a one-hot label array or a probability label array.
- *
- * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
- * with a particular label to be ignored during backward propagation. **This has no effect when
- * softmax `output` has same shape as `label`**.
- *
- * Example::
- *
- * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
- * label = [1,0,2,3]
- * ignore_label = 1
- * SoftmaxOutput(data=data, label = label,\
- * multi_output=true, use_ignore=true,\
- * ignore_label=ignore_label)
- * ## forward softmax output
- * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]]
- * ## backward gradient output
- * [[ 0. 0. 0. 0. ]
- * [-0.75 0.25 0.25 0.25]
- * [ 0.25 0.25 -0.75 0.25]
- * [ 0.25 0.25 0.25 -0.75]]
- * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
- *
- * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
- * give each loss function different weights.
- *
- * - This operator also supports various ways to normalize the gradient by `normalization`,
- * The `normalization` is applied if softmax output has different shape than the labels.
- * The `normalization` mode can be set to the followings:
- *
- * - ``'null'``: do nothing.
- * - ``'batch'``: divide the gradient by the batch size.
- * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L123
- * @param data Input array. - * @param label Ground truth label. - * @param grad_scale Scales the gradient by a float factor. - * @param ignore_label The instances whose `labels` == `ignore_label` will be ignored during backward, if `use_ignore` is set to ``true``). - * @param multi_output If set to ``true``, the softmax function will be computed along axis ``1``. This is applied when the shape of input array differs from the shape of label array. - * @param use_ignore If set to ``true``, the `ignore_label` value will not contribute to the backward gradient. - * @param preserve_shape If set to ``true``, the softmax function will be computed along the last axis (``-1``). - * @param normalization Normalizes the gradient. - * @param out_grad Multiplies gradient with output gradient element-wise. - * @param smooth_alpha Constant for computing a label smoothed version of cross-entropyfor the backwards pass. This constant gets subtracted from theone-hot encoding of the gold label and distributed uniformly toall other labels. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def SoftmaxOutput (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, ignore_label : Option[org.apache.mxnet.Base.MXFloat] = None, multi_output : Option[Boolean] = None, use_ignore : Option[Boolean] = None, preserve_shape : Option[Boolean] = None, normalization : Option[String] = None, out_grad : Option[Boolean] = None, smooth_alpha : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies a spatial transformer to input feature map.
- * @param data Input data to the SpatialTransformerOp. - * @param loc localisation net, the output dim should be 6 when transform_type is affine. You shold initialize the weight and bias with identity tranform. - * @param target_shape output shape(h, w) of spatial transformer: (y, x) - * @param transform_type transformation type - * @param sampler_type sampling type - * @return org.apache.mxnet.NDArray - */ -@Experimental -def SpatialTransformer (data : org.apache.mxnet.NDArray, loc : org.apache.mxnet.NDArray, target_shape : Option[org.apache.mxnet.Shape] = None, transform_type : String, sampler_type : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @param data Input array. - * @param dim1 the first axis to be swapped. - * @param dim2 the second axis to be swapped. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def SwapAxis (data : org.apache.mxnet.NDArray, dim1 : Option[Int] = None, dim2 : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs nearest neighbor/bilinear up sampling to inputs.
- * @param data Array of tensors to upsample - * @param scale Up sampling scale - * @param num_filter Input filter. Only used by bilinear sample_type. - * @param sample_type upsampling method - * @param multi_input_mode How to handle multiple input. concat means concatenate upsampled images along the channel dimension. sum means add all images together, only available for nearest neighbor upsampling. - * @param num_args Number of inputs to be upsampled. For nearest neighbor upsampling, this can be 1-N; the size of output will be(scale*h_0,scale*w_0) and all other inputs will be upsampled to thesame size. For bilinear upsampling this must be 2; 1 input and 1 weight. - * @param workspace Tmp workspace for deconvolution (MB) - * @return org.apache.mxnet.NDArray - */ -@Experimental -def UpSampling (data : Array[org.apache.mxnet.NDArray], scale : Int, num_filter : Option[Int] = None, sample_type : String, multi_input_mode : Option[String] = None, num_args : Int, workspace : Option[Long] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise absolute value of the input.
- *
- * Example::
- *
- * abs([-2, 0, 3]) = [2, 0, 3]
- *
- * The storage type of ``abs`` output depends upon the input storage type:
- *
- * - abs(default) = default
- * - abs(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def abs (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for Adam optimizer. Adam is seen as a generalization
- * of AdaGrad.
- *
- * Adam update consists of the following steps, where g represents gradient and m, v
- * are 1st and 2nd order moment estimates (mean and variance).
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
- *
- * It updates the weights using::
- *
- * m = beta1*m + (1-beta1)*grad
- * v = beta2*v + (1-beta2)*(grad**2)
- * w += - learning_rate * m / (sqrt(v) + epsilon)
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
- * type of weight is the same as those of m and v,
- * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
- *
- * for row in grad.indices:
- * m[row] = beta1*m[row] + (1-beta1)*grad[row]
- * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
- * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L495
- * @param weight Weight - * @param grad Gradient - * @param mean Moving mean - * @param vari Moving variance - * @param lr Learning rate - * @param beta1 The decay rate for the 1st moment estimates. - * @param beta2 The decay rate for the 2nd moment estimates. - * @param epsilon A small constant for numerical stability. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and all of w, m and v have the same stype - * @return org.apache.mxnet.NDArray - */ -@Experimental -def adam_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, mean : org.apache.mxnet.NDArray, vari : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, beta1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @param args Positional input arguments - * @return org.apache.mxnet.NDArray - */ -@Experimental -def add_n (args : Array[org.apache.mxnet.NDArray], out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse cosine of the input array.
- *
- * The input should be in range `[-1, 1]`.
- * The output is in the closed interval :math:`[0, \pi]`
- *
- * .. math::
- * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
- *
- * The storage type of ``arccos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def arccos (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the element-wise inverse hyperbolic cosine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arccosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def arccosh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse sine of the input array.
- *
- * The input should be in the range `[-1, 1]`.
- * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
- *
- * .. math::
- * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
- *
- * The storage type of ``arcsin`` output depends upon the input storage type:
- *
- * - arcsin(default) = default
- * - arcsin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def arcsin (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the element-wise inverse hyperbolic sine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arcsinh`` output depends upon the input storage type:
- *
- * - arcsinh(default) = default
- * - arcsinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def arcsinh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse tangent of the input array.
- *
- * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
- *
- * .. math::
- * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
- *
- * The storage type of ``arctan`` output depends upon the input storage type:
- *
- * - arctan(default) = default
- * - arctan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def arctan (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the element-wise inverse hyperbolic tangent of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arctanh`` output depends upon the input storage type:
- *
- * - arctanh(default) = default
- * - arctanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def arctanh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns indices of the maximum values along an axis.
- *
- * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmax along axis 0
- * argmax(x, axis=0) = [ 1., 1., 1.]
- *
- * // argmax along axis 1
- * argmax(x, axis=1) = [ 2., 2.]
- *
- * // argmax along axis 1 keeping same dims as an input array
- * argmax(x, axis=1, keepdims=True) = [[ 2.],
- * [ 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
- * @param data The input - * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` - * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def argmax (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, keepdims : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns argmax indices of each channel from the input array.
- *
- * The result will be an NDArray of shape (num_channel,).
- *
- * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * argmax_channel(x) = [ 2., 2.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
- * @param data The input array - * @return org.apache.mxnet.NDArray - */ -@Experimental -def argmax_channel (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns indices of the minimum values along an axis.
- *
- * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmin along axis 0
- * argmin(x, axis=0) = [ 0., 0., 0.]
- *
- * // argmin along axis 1
- * argmin(x, axis=1) = [ 0., 0.]
- *
- * // argmin along axis 1 keeping same dims as an input array
- * argmin(x, axis=1, keepdims=True) = [[ 0.],
- * [ 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
- * @param data The input - * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` - * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def argmin (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, keepdims : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the indices that would sort an input array along the given axis.
- *
- * This function performs sorting along the given axis and returns an array of indices having same shape
- * as an input array that index data in sorted order.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // sort along axis -1
- * argsort(x) = [[ 1., 0., 2.],
- * [ 0., 2., 1.]]
- *
- * // sort along axis 0
- * argsort(x, axis=0) = [[ 1., 0., 1.]
- * [ 0., 1., 0.]]
- *
- * // flatten and then sort
- * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L176
- * @param data The input array - * @param axis Axis along which to sort the input tensor. If not given, the flattened array is used. Default is -1. - * @param is_ascend Whether to sort in ascending or descending order. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def argsort (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, is_ascend : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Batchwise dot product.
- *
- * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
- * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
- *
- * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
- * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
- * which is computed by::
- *
- * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L117
- * @param lhs The first input - * @param rhs The second input - * @param transpose_a If true then transpose the first input before dot. - * @param transpose_b If true then transpose the second input before dot. - * @param forward_stype The desired storage type of the forward output given by user, if thecombination of input storage types and this hint does not matchany implemented ones, the dot operator will perform fallback operationand still produce an output of the desired storage type. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def batch_dot (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, forward_stype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Takes elements from a data batch.
- *
- * .. note::
- * `batch_take` is deprecated. Use `pick` instead.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // takes elements with specified indices
- * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L444
- * @param a The input array - * @param indices The index array - * @return org.apache.mxnet.NDArray - */ -@Experimental -def batch_take (a : org.apache.mxnet.NDArray, indices : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_add (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @param data The input - * @param axis The axes to perform the broadcasting. - * @param size Target sizes of the broadcasting axes. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_axes (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, size : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @param data The input - * @param axis The axes to perform the broadcasting. - * @param size Target sizes of the broadcasting axes. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_axis (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, size : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise division of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 6., 6., 6.],
- * [ 6., 6., 6.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_div(x, y) = [[ 3., 3., 3.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_div(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_div (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_equal (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_greater (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_greater_equal (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hypotenuse of a right angled triangle, given its "legs"
- * with broadcasting.
- *
- * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
- *
- * Example::
- *
- * x = [[ 3., 3., 3.]]
- *
- * y = [[ 4.],
- * [ 4.]]
- *
- * broadcast_hypot(x, y) = [[ 5., 5., 5.],
- * [ 5., 5., 5.]]
- *
- * z = [[ 0.],
- * [ 4.]]
- *
- * broadcast_hypot(x, z) = [[ 3., 3., 3.],
- * [ 5., 5., 5.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_hypot (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser(x, y) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_lesser (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_lesser_equal (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **logical and** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_logical_and (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **logical or** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_logical_or (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **logical xor** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_logical_xor (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise maximum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise maxima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_maximum (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise minimum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise minima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_minimum (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_minus (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise modulo of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 8., 8., 8.],
- * [ 8., 8., 8.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_mod(x, y) = [[ 0., 0., 0.],
- * [ 2., 2., 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_mod (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise product of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_mul(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- * Supported sparse operations:
- *
- * broadcast_mul(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_mul (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_not_equal (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_plus (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_power(x, y) = [[ 2., 2., 2.],
- * [ 4., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_power (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_sub (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Broadcasts the input array to a new shape.
- *
- * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
- * with arrays of different shapes efficiently without creating multiple copies of arrays.
- * Also see, `Broadcasting `_ for more explanation.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * For example::
- *
- * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
- * [ 1., 2., 3.]])
- *
- * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
- * So with `shape=(2,0)`, we will obtain the same result as in the above example.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
- * @param data The input - * @param shape The shape of the desired array. We can set the dim to zero if it's same as the original. E.g `A = broadcast_to(B, shape=(10, 0, 0))` has the same meaning as `A = broadcast_axis(B, axis=0, size=10)`. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def broadcast_to (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @param data The input. - * @param dtype Output data type. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def cast (data : org.apache.mxnet.NDArray, dtype : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Casts tensor storage type to the new type.
- *
- * When an NDArray with default storage type is cast to csr or row_sparse storage,
- * the result is compact, which means:
- *
- * - for csr, zero values will not be retained
- * - for row_sparse, row slices of all zeros will not be retained
- *
- * The storage type of ``cast_storage`` output depends on stype parameter:
- *
- * - cast_storage(csr, 'default') = default
- * - cast_storage(row_sparse, 'default') = default
- * - cast_storage(default, 'csr') = csr
- * - cast_storage(default, 'row_sparse') = row_sparse
- * - cast_storage(csr, 'csr') = csr
- * - cast_storage(row_sparse, 'row_sparse') = row_sparse
- *
- * Example::
- *
- * dense = [[ 0., 1., 0.],
- * [ 2., 0., 3.],
- * [ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * # cast to row_sparse storage type
- * rsp = cast_storage(dense, 'row_sparse')
- * rsp.indices = [0, 1]
- * rsp.values = [[ 0., 1., 0.],
- * [ 2., 0., 3.]]
- *
- * # cast to csr storage type
- * csr = cast_storage(dense, 'csr')
- * csr.indices = [1, 0, 2]
- * csr.values = [ 1., 2., 3.]
- * csr.indptr = [0, 1, 3, 3, 3]
- *
- *
- *
- * Defined in src/operator/tensor/cast_storage.cc:L71
- * @param data The input. - * @param stype Output storage type. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def cast_storage (data : org.apache.mxnet.NDArray, stype : String, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise cube-root value of the input.
- *
- * .. math::
- * cbrt(x) = \sqrt[3]{x}
- *
- * Example::
- *
- * cbrt([1, 8, -125]) = [1, 2, -5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def cbrt (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise ceiling of the input.
- *
- * The ceil of the scalar x is the smallest integer i, such that i >= x.
- *
- * Example::
- *
- * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
- *
- * The storage type of ``ceil`` output depends upon the input storage type:
- *
- * - ceil(default) = default
- * - ceil(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def ceil (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
- * @param lhs Left operand to the function. - * @param rhs Right operand to the function. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def choose_element_0index (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Clips (limits) the values in an array.
- *
- * Given an interval, values outside the interval are clipped to the interval edges.
- * Clipping ``x`` between `a_min` and `a_x` would be::
- *
- * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
- *
- * Example::
- *
- * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- *
- * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
- *
- * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
- * parameter values:
- *
- * - clip(default) = default
- * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
- * - clip(csr, a_min <= 0, a_max >= 0) = csr
- * - clip(row_sparse, a_min < 0, a_max < 0) = default
- * - clip(row_sparse, a_min > 0, a_max > 0) = default
- * - clip(csr, a_min < 0, a_max < 0) = csr
- * - clip(csr, a_min > 0, a_max > 0) = csr
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L617
- * @param data Input array. - * @param a_min Minimum value - * @param a_max Maximum value - * @return org.apache.mxnet.NDArray - */ -@Experimental -def clip (data : org.apache.mxnet.NDArray, a_min : org.apache.mxnet.Base.MXFloat, a_max : org.apache.mxnet.Base.MXFloat, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @param data List of arrays to concatenate - * @param num_args Number of inputs to be concated. - * @param dim the dimension to be concated. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def concat (data : Array[org.apache.mxnet.NDArray], num_args : Int, dim : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the element-wise cosine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
- *
- * The storage type of ``cos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def cos (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hyperbolic cosine of the input array, computed element-wise.
- *
- * .. math::
- * cosh(x) = 0.5\times(exp(x) + exp(-x))
- *
- * The storage type of ``cosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def cosh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @param data Source input - * @param begin starting indices for the slice operation, supports negative indices. - * @param end ending indices for the slice operation, supports negative indices. - * @param step step for the slice operation, supports negative values. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def crop (data : org.apache.mxnet.NDArray, begin : org.apache.mxnet.Shape, end : org.apache.mxnet.Shape, step : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts each element of the input array from radians to degrees.
- *
- * .. math::
- * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
- *
- * The storage type of ``degrees`` output depends upon the input storage type:
- *
- * - degrees(default) = default
- * - degrees(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def degrees (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Dot product of two arrays.
- *
- * ``dot``'s behavior depends on the input array dimensions:
- *
- * - 1-D arrays: inner product of vectors
- * - 2-D arrays: matrix multiplication
- * - N-D arrays: a sum product over the last axis of the first input and the first
- * axis of the second input
- *
- * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
- * result array will have shape `(n,m,r,s)`. It is computed by::
- *
- * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
- *
- * Example::
- *
- * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
- * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
- * dot(x,y)[0,0,1,1] = 0
- * sum(x[0,0,:]*y[:,1,1]) = 0
- *
- * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
- * forward_stype option for output storage type. Implemented sparse operations include:
- *
- * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
- * - dot(csr, default, transpose_a=True) = default
- * - dot(csr, default, transpose_a=True) = row_sparse
- * - dot(csr, default) = default
- * - dot(csr, row_sparse) = default
- * - dot(default, csr) = csr (CPU only)
- * - dot(default, csr, forward_stype='default') = default
- * - dot(default, csr, transpose_b=True, forward_stype='default') = default
- *
- * If the combination of input storage types and forward_stype does not match any of the
- * above patterns, ``dot`` will fallback and generate output with default storage.
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L69
- * @param lhs The first input - * @param rhs The second input - * @param transpose_a If true then transpose the first input before dot. - * @param transpose_b If true then transpose the second input before dot. - * @param forward_stype The desired storage type of the forward output given by user, if thecombination of input storage types and this hint does not matchany implemented ones, the dot operator will perform fallback operationand still produce an output of the desired storage type. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def dot (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, forward_stype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Adds arguments element-wise.
- *
- * The storage type of ``elemwise_add`` output depends on storage types of inputs
- *
- * - elemwise_add(row_sparse, row_sparse) = row_sparse
- * - elemwise_add(csr, csr) = csr
- * - elemwise_add(default, csr) = default
- * - elemwise_add(csr, default) = default
- * - elemwise_add(default, rsp) = default
- * - elemwise_add(rsp, default) = default
- * - otherwise, ``elemwise_add`` generates output with default storage
- * @param lhs first input - * @param rhs second input - * @return org.apache.mxnet.NDArray - */ -@Experimental -def elemwise_add (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Divides arguments element-wise.
- *
- * The storage type of ``elemwise_div`` output is always dense
- * @param lhs first input - * @param rhs second input - * @return org.apache.mxnet.NDArray - */ -@Experimental -def elemwise_div (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Multiplies arguments element-wise.
- *
- * The storage type of ``elemwise_mul`` output depends on storage types of inputs
- *
- * - elemwise_mul(default, default) = default
- * - elemwise_mul(row_sparse, row_sparse) = row_sparse
- * - elemwise_mul(default, row_sparse) = row_sparse
- * - elemwise_mul(row_sparse, default) = row_sparse
- * - elemwise_mul(csr, csr) = csr
- * - otherwise, ``elemwise_mul`` generates output with default storage
- * @param lhs first input - * @param rhs second input - * @return org.apache.mxnet.NDArray - */ -@Experimental -def elemwise_mul (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Subtracts arguments element-wise.
- *
- * The storage type of ``elemwise_sub`` output depends on storage types of inputs
- *
- * - elemwise_sub(row_sparse, row_sparse) = row_sparse
- * - elemwise_sub(csr, csr) = csr
- * - elemwise_sub(default, csr) = default
- * - elemwise_sub(csr, default) = default
- * - elemwise_sub(default, rsp) = default
- * - elemwise_sub(rsp, default) = default
- * - otherwise, ``elemwise_sub`` generates output with default storage
- * @param lhs first input - * @param rhs second input - * @return org.apache.mxnet.NDArray - */ -@Experimental -def elemwise_sub (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise exponential value of the input.
- *
- * .. math::
- * exp(x) = e^x \approx 2.718^x
- *
- * Example::
- *
- * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
- *
- * The storage type of ``exp`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def exp (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Inserts a new axis of size 1 into the array shape
- *
- * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
- * will return a new array with shape ``(2,1,3,4)``.
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L346
- * @param data Source input - * @param axis Position where new axis is to be inserted. Suppose that the input `NDArray`'s dimension is `ndim`, the range of the inserted axis is `[-ndim, ndim]` - * @return org.apache.mxnet.NDArray - */ -@Experimental -def expand_dims (data : org.apache.mxnet.NDArray, axis : Int, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns ``exp(x) - 1`` computed element-wise on the input.
- *
- * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
- *
- * The storage type of ``expm1`` output depends upon the input storage type:
- *
- * - expm1(default) = default
- * - expm1(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def expm1 (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
- * @param lhs Left operand to the function. - * @param mhs Middle operand to the function. - * @param rhs Right operand to the function. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def fill_element_0index (lhs : org.apache.mxnet.NDArray, mhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise rounded value to the nearest \
- * integer towards zero of the input.
- *
- * Example::
- *
- * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
- *
- * The storage type of ``fix`` output depends upon the input storage type:
- *
- * - fix(default) = default
- * - fix(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def fix (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @param data Input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def flatten (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @param data Input data array - * @param axis The axis which to reverse elements. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def flip (data : org.apache.mxnet.NDArray, axis : org.apache.mxnet.Shape, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise floor of the input.
- *
- * The floor of the scalar x is the largest integer i, such that i <= x.
- *
- * Example::
- *
- * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
- *
- * The storage type of ``floor`` output depends upon the input storage type:
- *
- * - floor(default) = default
- * - floor(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def floor (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * The FTML optimizer described in
- * *FTML - Follow the Moving Leader in Deep Learning*,
- * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
- * \sigma_t = d_t - \beta_1 d_{t-1}
- * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
- * W_t = - \frac{ z_t }{ d_t }
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L447
- * @param weight Weight - * @param grad Gradient - * @param d Internal state ``d_t`` - * @param v Internal state ``v_t`` - * @param z Internal state ``z_t`` - * @param lr Learning rate. - * @param beta1 Generally close to 0.5. - * @param beta2 Generally close to 1. - * @param epsilon Epsilon to prevent div 0. - * @param t Number of update. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_grad Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def ftml_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, d : org.apache.mxnet.NDArray, v : org.apache.mxnet.NDArray, z : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, beta1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[Double] = None, t : Int, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_grad : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for Ftrl optimizer.
- * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
- * http://dl.acm.org/citation.cfm?id=2488200.
- *
- * It updates the weights using::
- *
- * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
- * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
- * n += rescaled_grad**2
- * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
- *
- * If w, z and n are all of ``row_sparse`` storage type,
- * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
- *
- * for row in grad.indices:
- * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
- * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
- * n[row] += rescaled_grad[row]**2
- * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L632
- * @param weight Weight - * @param grad Gradient - * @param z z - * @param n Square of grad - * @param lr Learning rate - * @param lamda1 The L1 regularization coefficient. - * @param beta Per-Coordinate Learning Rate beta. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def ftrl_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, z : org.apache.mxnet.NDArray, n : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, lamda1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the gamma function (extension of the factorial function \
- * to the reals), computed element-wise on the input array.
- *
- * The storage type of ``gamma`` output is always dense
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def gamma (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise log of the absolute value of the gamma function \
- * of the input.
- *
- * The storage type of ``gammaln`` output is always dense
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def gammaln (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Gather elements or slices from `data` and store to a tensor whose
- * shape is defined by `indices`.
- *
- * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}]
- *
- * Examples::
- *
- * data = [[0, 1], [2, 3]]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * gather_nd(data, indices) = [2, 3, 0]
- * @param data data - * @param indices indices - * @return org.apache.mxnet.NDArray - */ -@Experimental -def gather_nd (data : org.apache.mxnet.NDArray, indices : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes hard sigmoid of x element-wise.
- *
- * .. math::
- * y = max(0, min(1, alpha * x + beta))
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
- * @param data The input array. - * @param alpha Slope of hard sigmoid - * @param beta Bias of hard sigmoid. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def hard_sigmoid (data : org.apache.mxnet.NDArray, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns a copy of the input.
- *
- * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def identity (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the Khatri-Rao product of the input matrices.
- *
- * Given a collection of :math:`n` input matrices,
- *
- * .. math::
- * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
- *
- * the (column-wise) Khatri-Rao product is defined as the matrix,
- *
- * .. math::
- * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
- *
- * where the :math:`k` th column is equal to the column-wise outer product
- * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
- * column of the ith matrix.
- *
- * Example::
- *
- * >>> A = mx.nd.array([[1, -1],
- * >>> [2, -3]])
- * >>> B = mx.nd.array([[1, 4],
- * >>> [2, 5],
- * >>> [3, 6]])
- * >>> C = mx.nd.khatri_rao(A, B)
- * >>> print(C.asnumpy())
- * [[ 1. -4.]
- * [ 2. -5.]
- * [ 3. -6.]
- * [ 2. -12.]
- * [ 4. -15.]
- * [ 6. -18.]]
- *
- *
- *
- * Defined in src/operator/contrib/krprod.cc:L108
- * @param args Positional input matrices - * @return org.apache.mxnet.NDArray - */ -@Experimental -def khatri_rao (args : Array[org.apache.mxnet.NDArray], out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * LQ factorization for general matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
- * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
- * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
- * that:
- *
- * *A* = *L* \* *Q*
- *
- * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
- * and *Q* is row-orthonormal, meaning that
- *
- * *Q* \* *Q*\ :sup:`T`
- *
- * is equal to the identity matrix of shape *(x, x)*.
- *
- * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single LQ factorization
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * Q, L = gelqf(A)
- * Q = [[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]]
- * L = [[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]]
- *
- * // Batch LQ factorization
- * A = [[[1., 2., 3.], [4., 5., 6.]],
- * [[7., 8., 9.], [10., 11., 12.]]]
- * Q, L = gelqf(A)
- * Q = [[[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]],
- * [[-0.50257071, -0.57436653, -0.64616234],
- * [0.7620735, 0.05862104, -0.64483142]]]
- * L = [[[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]],
- * [[-13.92838828, 0.],
- * [-19.09768702, 0.52758934]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L552
- * @param A Tensor of input matrices to be factorized - * @return org.apache.mxnet.NDArray - */ -@Experimental -def linalg_gelqf (A : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs general matrix multiplication and accumulation.
- * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
- *
- * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
- * matrix transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = swapaxes(C, dim1=1, dim2=3)
- * C = gemm(A1, B1, C)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply-add
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
- * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
- *
- * // Batch matrix multiply-add
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * C = [[[10.0]], [[0.01]]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
- * = [[[104.0]], [[0.14]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L81
- * @param A Tensor of input matrices - * @param B Tensor of input matrices - * @param C Tensor of input matrices - * @param transpose_a Multiply with transposed of first input (A). - * @param transpose_b Multiply with transposed of second input (B). - * @param alpha Scalar factor multiplied with A*B. - * @param beta Scalar factor multiplied with C. - * @param axis Axis corresponding to the matrix rows. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def linalg_gemm (A : org.apache.mxnet.NDArray, B : org.apache.mxnet.NDArray, C : org.apache.mxnet.NDArray, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, alpha : Option[Double] = None, beta : Option[Double] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs general matrix multiplication.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
- *
- * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
- * transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = gemm2(A1, B1)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
- *
- * // Batch matrix multiply
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[[4.0]], [[0.04 ]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L151
- * @param A Tensor of input matrices - * @param B Tensor of input matrices - * @param transpose_a Multiply with transposed of first input (A). - * @param transpose_b Multiply with transposed of second input (B). - * @param alpha Scalar factor multiplied with A*B. - * @param axis Axis corresponding to the matrix row indices. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def linalg_gemm2 (A : org.apache.mxnet.NDArray, B : org.apache.mxnet.NDArray, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, alpha : Option[Double] = None, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs Cholesky factorization of a symmetric positive-definite matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
- * computed. *L* is lower triangular (entries of upper triangle are all zero), has
- * positive diagonal entries, and:
- *
- * *A* = *L* \* *L*\ :sup:`T`
- *
- * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix factorization
- * A = [[4.0, 1.0], [1.0, 4.25]]
- * potrf(A) = [[2.0, 0], [0.5, 2.0]]
- *
- * // Batch matrix factorization
- * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
- * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L201
- * @param A Tensor of input matrices to be decomposed - * @return org.apache.mxnet.NDArray - */ -@Experimental -def linalg_potrf (A : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs matrix inversion from a Cholesky factorization.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
- * with positive diagonal. We compute:
- *
- * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
- *
- * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
- * *B* (obtained by *potrf*), then
- *
- * *out* = *B*\ :sup:`-1`
- *
- * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
- * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
- * (*trsm*). The latter is numerically much safer, and also cheaper.
- *
- * Examples::
- *
- * // Single matrix inverse
- * A = [[2.0, 0], [0.5, 2.0]]
- * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
- *
- * // Batch matrix inverse
- * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
- * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L259
- * @param A Tensor of lower triangular matrices - * @return org.apache.mxnet.NDArray - */ -@Experimental -def linalg_potri (A : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of the logarithms of the diagonal elements of a square matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
- * logarithms of the diagonal elements, the result has shape (1,).
- *
- * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix reduction
- * A = [[1.0, 1.0], [1.0, 7.0]]
- * sumlogdiag(A) = [1.9459]
- *
- * // Batch matrix reduction
- * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
- * sumlogdiag(A) = [1.9459, 3.9318]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L428
- * @param A Tensor of square matrices - * @return org.apache.mxnet.NDArray - */ -@Experimental -def linalg_sumlogdiag (A : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Multiplication of matrix with its transpose.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the operator performs the BLAS3 function *syrk*:
- *
- * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
- *
- * if *transpose=False*, or
- *
- * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
- *
- * if *transpose=True*.
- *
- * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * syrk(A, alpha=1., transpose=False)
- * = [[14., 32.],
- * [32., 77.]]
- * syrk(A, alpha=1., transpose=True)
- * = [[17., 22., 27.],
- * [22., 29., 36.],
- * [27., 36., 45.]]
- *
- * // Batch matrix multiply
- * A = [[[1., 1.]], [[0.1, 0.1]]]
- * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L484
- * @param A Tensor of input matrices - * @param transpose Use transpose of input matrix. - * @param alpha Scalar factor to be applied to the result. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def linalg_syrk (A : org.apache.mxnet.NDArray, transpose : Option[Boolean] = None, alpha : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs multiplication with a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trmm*:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* = *alpha* \* *B* \* *op*\ (*A*)
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- *
- * Examples::
- *
- * // Single triangular matrix multiply
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- *
- * // Batch triangular matrix multiply
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
- * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L316
- * @param A Tensor of lower triangular matrices - * @param B Tensor of matrices - * @param transpose Use transposed of the triangular matrix - * @param rightside Multiply triangular matrix from the right to non-triangular one. - * @param alpha Scalar factor to be applied to the result. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def linalg_trmm (A : org.apache.mxnet.NDArray, B : org.apache.mxnet.NDArray, transpose : Option[Boolean] = None, rightside : Option[Boolean] = None, alpha : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Solves matrix equation involving a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trsm*, solving for *out* in:
- *
- * *op*\ (*A*) \* *out* = *alpha* \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* \* *op*\ (*A*) = *alpha* \* *B*
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix solve
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- *
- * // Batch matrix solve
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
- * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
- * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L379
- * @param A Tensor of lower triangular matrices - * @param B Tensor of matrices - * @param transpose Use transposed of the triangular matrix - * @param rightside Multiply triangular matrix from the right to non-triangular one. - * @param alpha Scalar factor to be applied to the result. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def linalg_trsm (A : org.apache.mxnet.NDArray, B : org.apache.mxnet.NDArray, transpose : Option[Boolean] = None, rightside : Option[Boolean] = None, alpha : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise Natural logarithmic value of the input.
- *
- * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
- *
- * The storage type of ``log`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def log (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise Base-10 logarithmic value of the input.
- *
- * ``10**log10(x) = x``
- *
- * The storage type of ``log10`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def log10 (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise ``log(1 + x)`` value of the input.
- *
- * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
- * :math:`1+x\approx 1`
- *
- * The storage type of ``log1p`` output depends upon the input storage type:
- *
- * - log1p(default) = default
- * - log1p(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def log1p (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise Base-2 logarithmic value of the input.
- *
- * ``2**log2(x) = x``
- *
- * The storage type of ``log2`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def log2 (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the log softmax of the input.
- * This is equivalent to computing softmax followed by log.
- *
- * Examples::
- *
- * >>> x = mx.nd.array([1, 2, .1])
- * >>> mx.nd.log_softmax(x).asnumpy()
- * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
- *
- * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
- * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
- * array([[-0.34115392, -0.69314718, -1.24115396],
- * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
- * @param data The input array. - * @param axis The axis along which to compute softmax. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def log_softmax (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of logical NOT (!) function
- *
- * Example:
- * logical_not([-2., 0., 1.]) = [0., 1., 0.]
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def logical_not (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = make_loss(cross_entropy)
- *
- * We will need to use ``make_loss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * The storage type of ``make_loss`` output depends upon the input storage type:
- *
- * - make_loss(default) = default
- * - make_loss(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def make_loss (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def max (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def max_axis (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the mean of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def mean (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def min (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def min_axis (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Updater function for multi-precision sgd optimizer
- * @param weight Weight - * @param grad Gradient - * @param mom Momentum - * @param weight32 Weight32 - * @param lr Learning rate - * @param momentum The decay rate of momentum estimates at each epoch. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and both weight and momentum have the same stype - * @return org.apache.mxnet.NDArray - */ -@Experimental -def mp_sgd_mom_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, mom : org.apache.mxnet.NDArray, weight32 : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Updater function for multi-precision sgd optimizer
- * @param weight Weight - * @param grad gradient - * @param weight32 Weight32 - * @param lr Learning rate - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def mp_sgd_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, weight32 : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def nanprod (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def nansum (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Numerical negative of the argument, element-wise.
- *
- * The storage type of ``negative`` output depends upon the input storage type:
- *
- * - negative(default) = default
- * - negative(row_sparse) = row_sparse
- * - negative(csr) = csr
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def negative (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the norm on an NDArray.
- *
- * This operator computes the norm on an NDArray with the specified axis, depending
- * on the value of the ord parameter. By default, it computes the L2 norm on the entire
- * array.
- *
- * Examples::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * norm(x) = [5.47722578]
- *
- * rsp = x.cast_storage('row_sparse')
- *
- * norm(rsp) = [5.47722578]
- *
- * csr = x.cast_storage('csr')
- *
- * norm(csr) = [5.47722578]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
- * @param data The input - * @param ord Order of the norm. Currently ord=2 is supported. - * @param axis The axis or axes along which to perform the reduction. - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - If `axis` is int, a reduction is performed on a particular axis. - If `axis` is a 2-tuple, it specifies the axes that hold 2-D matrices, - and the matrix norms of these matrices are computed. - * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def norm (data : org.apache.mxnet.NDArray, ord : Option[Int] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @param loc Mean of the distribution. - * @param scale Standard deviation of the distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def normal (loc : Option[org.apache.mxnet.Base.MXFloat] = None, scale : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns a one-hot array.
- *
- * The locations represented by `indices` take value `on_value`, while all
- * other locations take value `off_value`.
- *
- * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
- * in an output array of shape ``(i0, i1, d)`` with::
- *
- * output[i,j,:] = off_value
- * output[i,j,indices[i,j]] = on_value
- *
- * Examples::
- *
- * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
- * [ 1. 0. 0.]
- * [ 0. 0. 1.]
- * [ 1. 0. 0.]]
- *
- * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
- * dtype='int32') = [[1 8 1]
- * [8 1 1]
- * [1 1 8]
- * [8 1 1]]
- *
- * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 0. 1.]
- * [ 1. 0. 0.]]]
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L490
- * @param indices array of locations where to set on_value - * @param depth Depth of the one hot dimension. - * @param on_value The value assigned to the locations represented by indices. - * @param off_value The value assigned to the locations not represented by indices. - * @param dtype DType of the output - * @return org.apache.mxnet.NDArray - */ -@Experimental -def one_hot (indices : org.apache.mxnet.NDArray, depth : Int, on_value : Option[Double] = None, off_value : Option[Double] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return an array of ones with the same shape and type
- * as the input array.
- *
- * Examples::
- *
- * x = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * ones_like(x) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- * @param data The input - * @return org.apache.mxnet.NDArray - */ -@Experimental -def ones_like (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @param data An n-dimensional input array. - * @param mode Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges. - * @param pad_width Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ... , before_N, after_N)``. It should be of length ``2*N`` where ``N`` is the number of dimensions of the array.This is equivalent to pad_width in numpy.pad, but flattened. - * @param constant_value The value used for padding when `mode` is "constant". - * @return org.apache.mxnet.NDArray - */ -@Experimental -def pad (data : org.apache.mxnet.NDArray, mode : String, pad_width : org.apache.mxnet.Shape, constant_value : Option[Double] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Picks elements from an input array according to the input indices along the given axis.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last element along an axis (the `clip` mode).
- *
- * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // picks elements with specified indices along axis 0
- * pick(x, y=[0,1], 0) = [ 1., 4.]
- *
- * // picks elements with specified indices along axis 1
- * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
- *
- * y = [[ 1.],
- * [ 0.],
- * [ 2.]]
- *
- * // picks elements with specified indices along axis 1 and dims are maintained
- * pick(x,y, 1, keepdims=True) = [[ 2.],
- * [ 3.],
- * [ 6.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
- * @param data The input array - * @param index The index array - * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` - * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def pick (data : org.apache.mxnet.NDArray, index : org.apache.mxnet.NDArray, axis : Option[Int] = None, keepdims : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the product of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def prod (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts each element of the input array from degrees to radians.
- *
- * .. math::
- * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
- *
- * The storage type of ``radians`` output depends upon the input storage type:
- *
- * - radians(default) = default
- * - radians(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def radians (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from an exponential distribution.
- *
- * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
- *
- * Example::
- *
- * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
- * [ 0.04146638, 0.31715935]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L115
- * @param lam Lambda parameter (rate) of the exponential distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def random_exponential (lam : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a gamma distribution.
- *
- * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
- *
- * Example::
- *
- * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
- * [ 3.91697288, 3.65933681]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L100
- * @param alpha Alpha parameter (shape) of the gamma distribution. - * @param beta Beta parameter (scale) of the gamma distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def random_gamma (alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a generalized negative binomial distribution.
- *
- * Samples are distributed according to a generalized negative binomial distribution parametrized by
- * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
- * number of unsuccessful experiments (generalized to real numbers).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
- * [ 6., 4.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L168
- * @param mu Mean of the negative binomial distribution. - * @param alpha Alpha (dispersion) parameter of the negative binomial distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def random_generalized_negative_binomial (mu : Option[org.apache.mxnet.Base.MXFloat] = None, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a negative binomial distribution.
- *
- * Samples are distributed according to a negative binomial distribution parametrized by
- * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
- * [ 2., 5.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L149
- * @param k Limit of unsuccessful experiments. - * @param p Failure probability in each experiment. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def random_negative_binomial (k : Option[Int] = None, p : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @param loc Mean of the distribution. - * @param scale Standard deviation of the distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def random_normal (loc : Option[org.apache.mxnet.Base.MXFloat] = None, scale : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a Poisson distribution.
- *
- * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
- * [ 4., 6.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L132
- * @param lam Lambda parameter (rate) of the Poisson distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def random_poisson (lam : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @param low Lower bound of the distribution. - * @param high Upper bound of the distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def random_uniform (low : Option[org.apache.mxnet.Base.MXFloat] = None, high : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
- *
- * Examples::
- *
- * A = [[3,6,6],[4,5,1]]
- * ravel(A, shape=(7,6)) = [22,41,37]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L41
- * @param data Batch of multi-indices - * @param shape Shape of the array into which the multi-indices apply. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def ravel_multi_index (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse cube-root value of the input.
- *
- * .. math::
- * rcbrt(x) = 1/\sqrt[3]{x}
- *
- * Example::
- *
- * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def rcbrt (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the reciprocal of the argument, element-wise.
- *
- * Calculates 1/x.
- *
- * Example::
- *
- * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def reciprocal (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes rectified linear.
- *
- * .. math::
- * max(features, 0)
- *
- * The storage type of ``relu`` output depends upon the input storage type:
- *
- * - relu(default) = default
- * - relu(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def relu (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Repeats elements of an array.
- *
- * By default, ``repeat`` flattens the input array into 1-D and then repeats the
- * elements::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
- *
- * The parameter ``axis`` specifies the axis along which to perform repeat::
- *
- * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
- * [ 1., 2.],
- * [ 3., 4.],
- * [ 3., 4.]]
- *
- * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L690
- * @param data Input data array - * @param repeats The number of repetitions for each element. - * @param axis The axis along which to repeat values. The negative numbers are interpreted counting from the backward. By default, use the flattened input array, and return a flat output array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def repeat (data : org.apache.mxnet.NDArray, repeats : Int, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @param data Input data to reshape. - * @param shape The target shape - * @param reverse If true then the special values are inferred from right to left - * @param target_shape (Deprecated! Use ``shape`` instead.) Target new shape. One and only one dim can be 0, in which case it will be inferred from the rest of dims - * @param keep_highest (Deprecated! Use ``shape`` instead.) Whether keep the highest dim unchanged.If set to true, then the first dim in target_shape is ignored,and always fixed as input - * @return org.apache.mxnet.NDArray - */ -@Experimental -def reshape (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, reverse : Option[Boolean] = None, target_shape : Option[org.apache.mxnet.Shape] = None, keep_highest : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reshape lhs to have the same shape as rhs.
- * @param lhs First input. - * @param rhs Second input. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def reshape_like (lhs : org.apache.mxnet.NDArray, rhs : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @param data Input data array - * @param axis The axis which to reverse elements. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def reverse (data : org.apache.mxnet.NDArray, axis : org.apache.mxnet.Shape, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * .. note::
- * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
- * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
- *
- * Example::
- *
- * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
- *
- * The storage type of ``rint`` output depends upon the input storage type:
- *
- * - rint(default) = default
- * - rint(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def rint (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for `RMSProp` optimizer.
- *
- * `RMSprop` is a variant of stochastic gradient descent where the gradients are
- * divided by a cache which grows with the sum of squares of recent gradients?
- *
- * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
- * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
- * each parameter monotonically over the course of training.
- * While this is analytically motivated for convex optimizations, it may not be ideal
- * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
- * learning rates to rebound as the denominator decays over time.
- *
- * Define the Root Mean Square (RMS) error criterion of the gradient as
- * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
- * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
- *
- * The :math:`E[g^2]_t` is given by:
- *
- * .. math::
- * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
- *
- * The RMSProp code follows the version in
- * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
- * Tieleman & Hinton, 2012.
- *
- * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
- * :math:`\eta` to be 0.001.
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L553
- * @param weight Weight - * @param grad Gradient - * @param n n - * @param lr Learning rate - * @param gamma1 The decay rate of momentum estimates. - * @param epsilon A small constant for numerical stability. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param clip_weights Clip weights to the range of [-clip_weights, clip_weights] If clip_weights <= 0, weight clipping is turned off. weights = max(min(weights, clip_weights), -clip_weights). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def rmsprop_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, n : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, gamma1 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, clip_weights : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for RMSPropAlex optimizer.
- *
- * `RMSPropAlex` is non-centered version of `RMSProp`.
- *
- * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
- * :math:`E[g]_t` is the decaying average over past gradient.
- *
- * .. math::
- * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
- * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
- * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t + \Delta_t
- *
- * The RMSPropAlex code follows the version in
- * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
- *
- * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
- * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L592
- * @param weight Weight - * @param grad Gradient - * @param n n - * @param g g - * @param delta delta - * @param lr Learning rate - * @param gamma1 Decay rate. - * @param gamma2 Decay rate. - * @param epsilon A small constant for numerical stability. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param clip_weights Clip weights to the range of [-clip_weights, clip_weights] If clip_weights <= 0, weight clipping is turned off. weights = max(min(weights, clip_weights), -clip_weights). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def rmspropalex_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, n : org.apache.mxnet.NDArray, g : org.apache.mxnet.NDArray, delta : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, gamma1 : Option[org.apache.mxnet.Base.MXFloat] = None, gamma2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, clip_weights : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * Example::
- *
- * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
- *
- * The storage type of ``round`` output depends upon the input storage type:
- *
- * - round(default) = default
- * - round(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def round (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse square-root value of the input.
- *
- * .. math::
- * rsqrt(x) = 1/\sqrt{x}
- *
- * Example::
- *
- * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
- *
- * The storage type of ``rsqrt`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def rsqrt (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * exponential distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_exponential(lam) = [ 0.51837951, 0.09994757]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
- * [ 0.09994757, 0.50447971]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L284
- * @param lam Lambda (rate) parameters of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sample_exponential (lam : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * alpha = [ 0.0, 2.5 ]
- * beta = [ 1.0, 0.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
- * [ 2.25797319, 1.70734084]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L282
- * @param alpha Alpha (shape) parameters of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param beta Beta (scale) parameters of the distributions. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sample_gamma (alpha : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, beta : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * mu = [ 2.0, 2.5 ]
- * alpha = [ 1.0, 0.1 ]
- *
- * // Draw a single sample for each distribution
- * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
- * [ 3., 1.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L293
- * @param mu Means of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param alpha Alpha (dispersion) parameters of the distributions. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sample_generalized_negative_binomial (mu : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, alpha : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple multinomial distributions.
- *
- * *data* is an *n* dimensional array whose last dimension has length *k*, where
- * *k* is the number of possible outcomes of each multinomial distribution. This
- * operator will draw *shape* samples from each distribution. If shape is empty
- * one sample will be drawn from each distribution.
- *
- * If *get_prob* is true, a second array containing log likelihood of the drawn
- * samples will also be returned. This is usually used for reinforcement learning
- * where you can provide reward as head gradient for this array to estimate
- * gradient.
- *
- * Note that the input distribution must be normalized, i.e. *data* must sum to
- * 1 along its last axis.
- *
- * Examples::
- *
- * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
- *
- * // Draw a single sample for each distribution
- * sample_multinomial(probs) = [3, 0]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_multinomial(probs, shape=(2)) = [[4, 2],
- * [0, 0]]
- *
- * // requests log likelihood
- * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
- * @param data Distribution probabilities. Must sum to one on the last axis. - * @param shape Shape to be sampled from each random distribution. - * @param get_prob Whether to also return the log probability of sampled result. This is usually used for differentiating through stochastic variables, e.g. in reinforcement learning. - * @param dtype DType of the output in case this can't be inferred. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sample_multinomial (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, get_prob : Option[Boolean] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * k = [ 20, 49 ]
- * p = [ 0.4 , 0.77 ]
- *
- * // Draw a single sample for each distribution
- * sample_negative_binomial(k, p) = [ 15., 16.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
- * [ 16., 12.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L289
- * @param k Limits of unsuccessful experiments. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param p Failure probabilities in each experiment. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sample_negative_binomial (k : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, p : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * mu = [ 0.0, 2.5 ]
- * sigma = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
- * [ 0.95934606, 4.48287058]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L279
- * @param mu Means of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param sigma Standard deviations of the distributions. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sample_normal (mu : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, sigma : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * Poisson distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_poisson(lam) = [ 0., 13.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
- * [ 13., 8.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L286
- * @param lam Lambda (rate) parameters of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sample_poisson (lam : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * uniform distributions on the intervals given by *[low,high)*.
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * low = [ 0.0, 2.5 ]
- * high = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
- * [ 3.18687344, 3.68352246]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L277
- * @param low Lower bounds of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param high Upper bounds of the distributions. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sample_uniform (low : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, high : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Scatters data into a new tensor according to indices.
- *
- * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
- *
- * all other entries in output are 0.
- *
- * .. warning::
- *
- * If the indices have duplicates, the result will be non-deterministic and
- * the gradient of `scatter_nd` will not be correct!!
- *
- *
- * Examples::
- *
- * data = [2, 3, 0]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * shape = (2, 2)
- * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
- * @param data data - * @param indices indices - * @param shape Shape of output. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def scatter_nd (data : org.apache.mxnet.NDArray, indices : org.apache.mxnet.NDArray, shape : org.apache.mxnet.Shape, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
- *
- * Momentum update has better convergence rates on neural networks. Mathematically it looks
- * like below:
- *
- * .. math::
- *
- * v_1 = \alpha * \nabla J(W_0)\\
- * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
- * W_t = W_{t-1} + v_t
- *
- * It updates the weights using::
- *
- * v = momentum * v - learning_rate * gradient
- * weight += v
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
- * type is the same as momentum's storage type,
- * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
- *
- * for row in gradient.indices:
- * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
- * weight[row] += v[row]
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L372
- * @param weight Weight - * @param grad Gradient - * @param mom Momentum - * @param lr Learning rate - * @param momentum The decay rate of momentum estimates at each epoch. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and both weight and momentum have the same stype - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sgd_mom_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, mom : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for Stochastic Gradient Descent (SDG) optimizer.
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * (gradient + wd * weight)
- *
- * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
- * only the row slices whose indices appear in grad.indices are updated::
- *
- * for row in gradient.indices:
- * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L331
- * @param weight Weight - * @param grad Gradient - * @param lr Learning rate - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sgd_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Randomly shuffle the elements.
- *
- * This shuffles the array along the first axis.
- * The order of the elements in each subarray does not change.
- * For example, if a 2D array is given, the order of the rows randomly changes,
- * but the order of the elements in each row does not change.
- * @param data Data to be shuffled. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def shuffle (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes sigmoid of x element-wise.
- *
- * .. math::
- * y = 1 / (1 + exp(-x))
- *
- * The storage type of ``sigmoid`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sigmoid (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise sign of the input.
- *
- * Example::
- *
- * sign([-2, 0, 3]) = [-1, 0, 1]
- *
- * The storage type of ``sign`` output depends upon the input storage type:
- *
- * - sign(default) = default
- * - sign(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sign (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for SignSGD optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * sign(gradient)
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L57
- * @param weight Weight - * @param grad Gradient - * @param lr Learning rate - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def signsgd_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * SIGN momentUM (Signum) optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
- * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
- *
- * It updates the weights using::
- * state = momentum * state + (1-momentum) * gradient
- * weight = weight - learning_rate * sign(state)
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L86
- * @param weight Weight - * @param grad Gradient - * @param mom Momentum - * @param lr Learning rate - * @param momentum The decay rate of momentum estimates at each epoch. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param wd_lh The amount of weight decay that does not go into gradient/momentum calculationsotherwise do weight decay algorithmically only. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def signum_update (weight : org.apache.mxnet.NDArray, grad : org.apache.mxnet.NDArray, mom : org.apache.mxnet.NDArray, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, wd_lh : Option[org.apache.mxnet.Base.MXFloat] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the element-wise sine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
- *
- * The storage type of ``sin`` output depends upon the input storage type:
- *
- * - sin(default) = default
- * - sin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sin (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hyperbolic sine of the input array, computed element-wise.
- *
- * .. math::
- * sinh(x) = 0.5\times(exp(x) - exp(-x))
- *
- * The storage type of ``sinh`` output depends upon the input storage type:
- *
- * - sinh(default) = default
- * - sinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sinh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @param data Source input - * @param begin starting indices for the slice operation, supports negative indices. - * @param end ending indices for the slice operation, supports negative indices. - * @param step step for the slice operation, supports negative values. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def slice (data : org.apache.mxnet.NDArray, begin : org.apache.mxnet.Shape, end : org.apache.mxnet.Shape, step : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices along a given axis.
- *
- * Returns an array slice along a given `axis` starting from the `begin` index
- * to the `end` index.
- *
- * Examples::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
- * [ 5., 6.],
- * [ 9., 10.]]
- *
- * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
- * [ 6., 7.],
- * [ 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L499
- * @param data Source input - * @param axis Axis along which to be sliced, supports negative indexes. - * @param begin The beginning index along the axis to be sliced, supports negative indexes. - * @param end The ending index along the axis to be sliced, supports negative indexes. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def slice_axis (data : org.apache.mxnet.NDArray, axis : Int, begin : Int, end : Int, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices a region of the array like the shape of another array.
- *
- * This function is similar to ``slice``, however, the `begin` are always `0`s
- * and `end` of specific axes are inferred from the second input `shape_like`.
- *
- * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
- * a ``slice_like`` operator with default empty `axes`, it performs the
- * following operation:
- *
- * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
- *
- * When `axes` is not empty, it is used to speficy which axes are being sliced.
- *
- * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
- * will perform the following operation:
- *
- * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
- *
- * Note that it is allowed to have first and second input with different dimensions,
- * however, you have to make sure the `axes` are specified and not exceeding the
- * dimension limits.
- *
- * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
- * ``shape=(1,2,3)``, it is not allowed to use:
- *
- * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
- * is 3.
- *
- * The following is allowed in this situation:
- *
- * `` out = slice_like(a, b, axes=(0, 2))``
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * y = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * slice_like(x, y) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
- * [ 5., 6., 7., 8.]]
- * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]
- * [ 9., 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L568
- * @param data Source input - * @param shape_like Shape like input - * @param axes List of axes on which input data will be sliced according to the corresponding size of the second input. By default will slice on all axes. Negative axes are supported. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def slice_like (data : org.apache.mxnet.NDArray, shape_like : org.apache.mxnet.NDArray, axes : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Calculate Smooth L1 Loss(lhs, scalar) by summing
- *
- * .. math::
- *
- * f(x) =
- * \begin{cases}
- * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
- * |x|-0.5/\sigma^2,& \text{otherwise}
- * \end{cases}
- *
- * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
- *
- * Example::
- *
- * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
- * @param data source input - * @param scalar scalar input - * @return org.apache.mxnet.NDArray - */ -@Experimental -def smooth_l1 (data : org.apache.mxnet.NDArray, scalar : org.apache.mxnet.Base.MXFloat, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies the softmax function.
- *
- * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
- *
- * .. math::
- * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
- *
- * for :math:`j = 1, ..., K`
- *
- * Example::
- *
- * x = [[ 1. 1. 1.]
- * [ 1. 1. 1.]]
- *
- * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
- * [ 0.5 0.5 0.5]]
- *
- * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
- * [ 0.33333334, 0.33333334, 0.33333334]]
- *
- *
- *
- * Defined in src/operator/nn/softmax.cc:L95
- * @param data The input array. - * @param axis The axis along which to compute softmax. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def softmax (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Calculate cross entropy of softmax output and one-hot label.
- *
- * - This operator computes the cross entropy in two steps:
- * - Applies softmax function on the input array.
- * - Computes and returns the cross entropy loss between the softmax output and the labels.
- *
- * - The softmax function and cross entropy loss is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * Example::
- *
- * x = [[1, 2, 3],
- * [11, 7, 5]]
- *
- * label = [2, 0]
- *
- * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
- * [0.97962922, 0.01794253, 0.00242826]]
- *
- * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
- *
- *
- *
- * Defined in src/operator/loss_binary_op.cc:L59
- * @param data Input data - * @param label Input label - * @return org.apache.mxnet.NDArray - */ -@Experimental -def softmax_cross_entropy (data : org.apache.mxnet.NDArray, label : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes softsign of x element-wise.
- *
- * .. math::
- * y = x / (1 + abs(x))
- *
- * The storage type of ``softsign`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def softsign (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns a sorted copy of an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 1, 4],
- * [ 3, 1]]
- *
- * // sorts along the last axis
- * sort(x) = [[ 1., 4.],
- * [ 1., 3.]]
- *
- * // flattens and then sorts
- * sort(x) = [ 1., 1., 3., 4.]
- *
- * // sorts along the first axis
- * sort(x, axis=0) = [[ 1., 1.],
- * [ 3., 4.]]
- *
- * // in a descend order
- * sort(x, is_ascend=0) = [[ 4., 1.],
- * [ 3., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L126
- * @param data The input array - * @param axis Axis along which to choose sort the input tensor. If not given, the flattened array is used. Default is -1. - * @param is_ascend Whether to sort in ascending or descending order. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sort (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, is_ascend : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @param data The input - * @param num_outputs Number of splits. Note that this should evenly divide the length of the `axis`. - * @param axis Axis along which to split. - * @param squeeze_axis If true, Removes the axis with length 1 from the shapes of the output arrays. **Note** that setting `squeeze_axis` to ``true`` removes axis with length 1 only along the `axis` which it is split. Also `squeeze_axis` can be set to ``true`` only if ``input.shape[axis] == num_outputs``. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def split (data : org.apache.mxnet.NDArray, num_outputs : Int, axis : Option[Int] = None, squeeze_axis : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise square-root value of the input.
- *
- * .. math::
- * \textrm{sqrt}(x) = \sqrt{x}
- *
- * Example::
- *
- * sqrt([4, 9, 16]) = [2, 3, 4]
- *
- * The storage type of ``sqrt`` output depends upon the input storage type:
- *
- * - sqrt(default) = default
- * - sqrt(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sqrt (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise squared value of the input.
- *
- * .. math::
- * square(x) = x^2
- *
- * Example::
- *
- * square([2, 3, 4]) = [4, 9, 16]
- *
- * The storage type of ``square`` output depends upon the input storage type:
- *
- * - square(default) = default
- * - square(row_sparse) = row_sparse
- * - square(csr) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def square (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Remove single-dimensional entries from the shape of an array.
- * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
- * See the following note for exception.
- *
- * Examples::
- *
- * data = [[[0], [1], [2]]]
- * squeeze(data) = [0, 1, 2]
- * squeeze(data, axis=0) = [[0], [1], [2]]
- * squeeze(data, axis=2) = [[0, 1, 2]]
- * squeeze(data, axis=(0, 2)) = [0, 1, 2]
- *
- * .. Note::
- * The output of this operator will keep at least one dimension not removed. For example,
- * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
- * @param data data to squeeze - * @param axis Selects a subset of the single-dimensional entries in the shape. If an axis is selected with shape entry greater than one, an error is raised. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def squeeze (data : Array[org.apache.mxnet.NDArray], axis : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Join a sequence of arrays along a new axis.
- *
- * The axis parameter specifies the index of the new axis in the dimensions of the
- * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
- * will be the last dimension.
- *
- * Examples::
- *
- * x = [1, 2]
- * y = [3, 4]
- *
- * stack(x, y) = [[1, 2],
- * [3, 4]]
- * stack(x, y, axis=1) = [[1, 3],
- * [2, 4]]
- * @param data List of arrays to stack - * @param axis The axis in the result array along which the input arrays are stacked. - * @param num_args Number of inputs to be stacked. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def stack (data : Array[org.apache.mxnet.NDArray], axis : Option[Int] = None, num_args : Int, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def stop_gradient (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sum (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def sum_axis (data : org.apache.mxnet.NDArray, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @param data Input array. - * @param dim1 the first axis to be swapped. - * @param dim2 the second axis to be swapped. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def swapaxes (data : org.apache.mxnet.NDArray, dim1 : Option[Int] = None, dim2 : Option[Int] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Takes elements from an input array along the given axis.
- *
- * This function slices the input array along a particular axis with the provided indices.
- *
- * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
- * will have shape ``(i0, i1, d1, d2)``, computed by::
- *
- * output[i,j,:,:] = input[indices[i,j],:,:]
- *
- * .. note::
- * - `axis`- Only slicing along axis 0 is supported for now.
- * - `mode`- Only `clip` mode is supported for now.
- *
- * Examples::
- * x = [4. 5. 6.]
- *
- * // Trivial case, take the second element along the first axis.
- * take(x, [1]) = [ 5. ]
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
- * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 3., 4.],
- * [ 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L389
- * @param a The input array. - * @param indices The indices of the values to be extracted. - * @param axis The axis of input array to be taken. - * @param mode Specify how out-of-bound indices bahave. "clip" means clip to the range. So, if all indices mentioned are too large, they are replaced by the index that addresses the last element along an axis. "wrap" means to wrap around. "raise" means to raise an error. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def take (a : org.apache.mxnet.NDArray, indices : org.apache.mxnet.NDArray, axis : Option[Int] = None, mode : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the element-wise tangent of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
- *
- * The storage type of ``tan`` output depends upon the input storage type:
- *
- * - tan(default) = default
- * - tan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def tan (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hyperbolic tangent of the input array, computed element-wise.
- *
- * .. math::
- * tanh(x) = sinh(x) / cosh(x)
- *
- * The storage type of ``tanh`` output depends upon the input storage type:
- *
- * - tanh(default) = default
- * - tanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def tanh (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Repeats the whole array multiple times.
- *
- * If ``reps`` has length *d*, and input array has dimension of *n*. There are
- * three cases:
- *
- * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]
- *
- * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
- * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
- *
- *
- * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
- * [ 3., 4., 3., 4.]]
- *
- * - **n - * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
- *
- * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]],
- *
- * [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L751
- * @param data Input data array - * @param reps The number of times for repeating the tensor a. Each dim size of reps must be a positive integer. If reps has length d, the result will have dimension of max(d, a.ndim); If a.ndim < d, a is promoted to be d-dimensional by prepending new axes. If a.ndim > d, reps is promoted to a.ndim by pre-pending 1's to it. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def tile (data : org.apache.mxnet.NDArray, reps : org.apache.mxnet.Shape, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the top *k* elements in an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // returns an index of the largest element on last axis
- * topk(x) = [[ 2.],
- * [ 1.]]
- *
- * // returns the value of top-2 largest elements on last axis
- * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
- * [ 0.3, 0.2]]
- *
- * // returns the value of top-2 smallest elements on last axis
- * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
- * [ 0.1 , 0.2]]
- *
- * // returns the value of top-2 largest elements on axis 0
- * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
- * [ 0.1, 0.2, 0.2]]
- *
- * // flattens and then returns list of both values and indices
- * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L63
- * @param data The input array - * @param axis Axis along which to choose the top k indices. If not given, the flattened array is used. Default is -1. - * @param k Number of top elements to select, should be always smaller than or equal to the element number in the given axis. A global sort is performed if set k < 1. - * @param ret_typ The return type. - "value" means to return the top k values, "indices" means to return the indices of the top k values, "mask" means to return a mask array containing 0 and 1. 1 means the top k values. "both" means to return a list of both values and indices of top k elements. - * @param is_ascend Whether to choose k largest or k smallest elements. Top K largest elements will be chosen if set to false. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def topk (data : org.apache.mxnet.NDArray, axis : Option[Int] = None, k : Option[Int] = None, ret_typ : Option[String] = None, is_ascend : Option[Boolean] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Permutes the dimensions of an array.
- *
- * Examples::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * transpose(x) = [[ 1., 3.],
- * [ 2., 4.]]
- *
- * x = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 5., 6.],
- * [ 7., 8.]]]
- *
- * transpose(x) = [[[ 1., 5.],
- * [ 3., 7.]],
- *
- * [[ 2., 6.],
- * [ 4., 8.]]]
- *
- * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
- * [ 5., 6.]],
- *
- * [[ 3., 4.],
- * [ 7., 8.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L310
- * @param data Source input - * @param axes Target axis order. By default the axes will be inverted. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def transpose (data : org.apache.mxnet.NDArray, axes : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return the element-wise truncated value of the input.
- *
- * The truncated value of the scalar x is the nearest integer i which is closer to
- * zero than x is. In short, the fractional part of the signed number x is discarded.
- *
- * Example::
- *
- * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
- *
- * The storage type of ``trunc`` output depends upon the input storage type:
- *
- * - trunc(default) = default
- * - trunc(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
- * @param data The input array. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def trunc (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @param low Lower bound of the distribution. - * @param high Upper bound of the distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.NDArray - */ -@Experimental -def uniform (low : Option[org.apache.mxnet.Base.MXFloat] = None, high : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
- *
- * Examples::
- *
- * A = [22,41,37]
- * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L65
- * @param data Array of flat indices - * @param shape Shape of the array into which the multi-indices apply. - * @return org.apache.mxnet.NDArray - */ -@Experimental -def unravel_index (data : org.apache.mxnet.NDArray, shape : Option[org.apache.mxnet.Shape] = None, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return the elements, either from x or y, depending on the condition.
- *
- * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
- * depending on the elements from condition are true or false. x and y must have the same shape.
- * If condition has the same shape as x, each element in the output array is from x if the
- * corresponding element in the condition is true, and from y if false.
- *
- * If condition does not have the same shape as x, it must be a 1D array whose size is
- * the same as x's first dimension size. Each row of the output array is from x's row
- * if the corresponding element from condition is true, and from y's row if false.
- *
- * Note that all non-zero values are interpreted as ``True`` in condition.
- *
- * Examples::
- *
- * x = [[1, 2], [3, 4]]
- * y = [[5, 6], [7, 8]]
- * cond = [[0, 1], [-1, 0]]
- *
- * where(cond, x, y) = [[5, 2], [3, 8]]
- *
- * csr_cond = cast_storage(cond, 'csr')
- *
- * where(csr_cond, x, y) = [[5, 2], [3, 8]]
- *
- *
- *
- * Defined in src/operator/tensor/control_flow_op.cc:L57
- * @param condition condition array - * @param x - * @param y - * @return org.apache.mxnet.NDArray - */ -@Experimental -def where (condition : org.apache.mxnet.NDArray, x : org.apache.mxnet.NDArray, y : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return an array of zeros with the same shape, type and storage type
- * as the input array.
- *
- * The storage type of ``zeros_like`` output depends on the storage type of the input
- *
- * - zeros_like(row_sparse) = row_sparse
- * - zeros_like(csr) = csr
- * - zeros_like(default) = default
- *
- * Examples::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * zeros_like(x) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- * @param data The input - * @return org.apache.mxnet.NDArray - */ -@Experimental -def zeros_like (data : org.apache.mxnet.NDArray, out : Option[NDArray] = None) : org.apache.mxnet.NDArrayFuncReturn -} \ No newline at end of file diff --git a/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayBase.scala b/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayBase.scala deleted file mode 100644 index b646e9962813..000000000000 --- a/scala-package/core/src/main/scala/org/apache/mxnet/NDArrayBase.scala +++ /dev/null @@ -1,11488 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// scalastyle:off -package org.apache.mxnet -import org.apache.mxnet.annotation.Experimental -abstract class NDArrayBase { - /** - * Applies an activation function element-wise to the input.
- *
- * The following activation functions are supported:
- *
- * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
- * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
- * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
- * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
- * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
- *
- *
- *
- * Defined in src/operator/nn/activation.cc:L161
- * @return org.apache.mxnet.NDArray - */ -def Activation(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies an activation function element-wise to the input.
- *
- * The following activation functions are supported:
- *
- * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
- * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
- * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
- * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
- * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
- *
- *
- *
- * Defined in src/operator/nn/activation.cc:L161
- * @return org.apache.mxnet.NDArray - */ -def Activation(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Batch normalization.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
- * two outputs are blocked.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
- * axis to be the last item in the input shape.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/nn/batch_norm.cc:L575
- * @return org.apache.mxnet.NDArray - */ -def BatchNorm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Batch normalization.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
- * two outputs are blocked.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
- * axis to be the last item in the input shape.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/nn/batch_norm.cc:L575
- * @return org.apache.mxnet.NDArray - */ -def BatchNorm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Batch normalization.
- *
- * This operator is DEPRECATED. Perform BatchNorm on the input.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_var`` as well, which are needed for the backward pass.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/batch_norm_v1.cc:L92
- * @return org.apache.mxnet.NDArray - */ -def BatchNorm_v1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Batch normalization.
- *
- * This operator is DEPRECATED. Perform BatchNorm on the input.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_var`` as well, which are needed for the backward pass.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/batch_norm_v1.cc:L92
- * @return org.apache.mxnet.NDArray - */ -def BatchNorm_v1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies bilinear sampling to input feature map.
- *
- * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
- * except that the operator has the backward pass.
- *
- * Given :math:`data` and :math:`grid`, then the output is computed by
- *
- * .. math::
- * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
- * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
- * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
- *
- * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
- * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
- *
- * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
- *
- * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
- * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
- * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
- *
- * Example 1::
- *
- * ## Zoom out data two times
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * affine_matrix = array([[2, 0, 0],
- * [0, 2, 0]])
- *
- * affine_matrix = reshape(affine_matrix, shape=(1, 6))
- *
- * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
- *
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 0, 0, 0, 0],
- * [ 0, 3.5, 6.5, 0],
- * [ 0, 1.25, 2.5, 0],
- * [ 0, 0, 0, 0]]]
- *
- *
- * Example 2::
- *
- * ## shift data horizontally by -1 pixel
- *
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * warp_maxtrix = array([[[[1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1]],
- * [[0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0]]]])
- *
- * grid = GridGenerator(data=warp_matrix, transform_type='warp')
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 4, 3, 6, 0],
- * [ 8, 8, 9, 0],
- * [ 4, 1, 5, 0],
- * [ 0, 1, 3, 0]]]
- *
- *
- * Defined in src/operator/bilinear_sampler.cc:L245
- * @return org.apache.mxnet.NDArray - */ -def BilinearSampler(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies bilinear sampling to input feature map.
- *
- * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
- * except that the operator has the backward pass.
- *
- * Given :math:`data` and :math:`grid`, then the output is computed by
- *
- * .. math::
- * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
- * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
- * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
- *
- * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
- * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
- *
- * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
- *
- * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
- * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
- * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
- *
- * Example 1::
- *
- * ## Zoom out data two times
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * affine_matrix = array([[2, 0, 0],
- * [0, 2, 0]])
- *
- * affine_matrix = reshape(affine_matrix, shape=(1, 6))
- *
- * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
- *
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 0, 0, 0, 0],
- * [ 0, 3.5, 6.5, 0],
- * [ 0, 1.25, 2.5, 0],
- * [ 0, 0, 0, 0]]]
- *
- *
- * Example 2::
- *
- * ## shift data horizontally by -1 pixel
- *
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * warp_maxtrix = array([[[[1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1]],
- * [[0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0]]]])
- *
- * grid = GridGenerator(data=warp_matrix, transform_type='warp')
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 4, 3, 6, 0],
- * [ 8, 8, 9, 0],
- * [ 4, 1, 5, 0],
- * [ 0, 1, 3, 0]]]
- *
- *
- * Defined in src/operator/bilinear_sampler.cc:L245
- * @return org.apache.mxnet.NDArray - */ -def BilinearSampler(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @return org.apache.mxnet.NDArray - */ -def BlockGrad(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @return org.apache.mxnet.NDArray - */ -def BlockGrad(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @return org.apache.mxnet.NDArray - */ -def Cast(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @return org.apache.mxnet.NDArray - */ -def Cast(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @return org.apache.mxnet.NDArray - */ -def Concat(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @return org.apache.mxnet.NDArray - */ -def Concat(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Compute *N*-D convolution on *(N+2)*-D input.
- *
- * In the 2-D convolution, given input data with shape *(batch_size,
- * channel, height, width)*, the output is computed by
- *
- * .. math::
- *
- * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
- * weight[i,j,:,:]
- *
- * where :math:`\star` is the 2-D cross-correlation operator.
- *
- * For general 2-D convolution, the shapes are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*.
- *
- * Define::
- *
- * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
- *
- * then we have::
- *
- * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
- * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
- * width)*. We can choose other layouts such as *NHWC*.
- *
- * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
- * evenly into *g* parts along the channel axis, and also evenly split ``weight``
- * along the first dimension. Next compute the convolution on the *i*-th part of
- * the data with the *i*-th weight part. The output is obtained by concatenating all
- * the *g* results.
- *
- * 1-D convolution does not have *height* dimension but only *width* in space.
- *
- * - **data**: *(batch_size, channel, width)*
- * - **weight**: *(num_filter, channel, kernel[0])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * 3-D convolution adds an additional *depth* dimension besides *height* and
- * *width*. The shapes are
- *
- * - **data**: *(batch_size, channel, depth, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
- *
- * Both ``weight`` and ``bias`` are learnable parameters.
- *
- * There are other options to tune the performance.
- *
- * - **cudnn_tune**: enable this option leads to higher startup time but may give
- * faster speed. Options are
- *
- * - **off**: no tuning
- * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
- * exceed workspace limit.
- * - **fastest**: pick the fastest algorithm and ignore workspace limit.
- * - **None** (default): the behavior is determined by environment variable
- * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
- * (default), 2 for fastest.
- *
- * - **workspace**: A large number leads to more (GPU) memory usage but may improve
- * the performance.
- *
- *
- *
- * Defined in src/operator/nn/convolution.cc:L470
- * @return org.apache.mxnet.NDArray - */ -def Convolution(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Compute *N*-D convolution on *(N+2)*-D input.
- *
- * In the 2-D convolution, given input data with shape *(batch_size,
- * channel, height, width)*, the output is computed by
- *
- * .. math::
- *
- * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
- * weight[i,j,:,:]
- *
- * where :math:`\star` is the 2-D cross-correlation operator.
- *
- * For general 2-D convolution, the shapes are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*.
- *
- * Define::
- *
- * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
- *
- * then we have::
- *
- * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
- * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
- * width)*. We can choose other layouts such as *NHWC*.
- *
- * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
- * evenly into *g* parts along the channel axis, and also evenly split ``weight``
- * along the first dimension. Next compute the convolution on the *i*-th part of
- * the data with the *i*-th weight part. The output is obtained by concatenating all
- * the *g* results.
- *
- * 1-D convolution does not have *height* dimension but only *width* in space.
- *
- * - **data**: *(batch_size, channel, width)*
- * - **weight**: *(num_filter, channel, kernel[0])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * 3-D convolution adds an additional *depth* dimension besides *height* and
- * *width*. The shapes are
- *
- * - **data**: *(batch_size, channel, depth, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
- *
- * Both ``weight`` and ``bias`` are learnable parameters.
- *
- * There are other options to tune the performance.
- *
- * - **cudnn_tune**: enable this option leads to higher startup time but may give
- * faster speed. Options are
- *
- * - **off**: no tuning
- * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
- * exceed workspace limit.
- * - **fastest**: pick the fastest algorithm and ignore workspace limit.
- * - **None** (default): the behavior is determined by environment variable
- * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
- * (default), 2 for fastest.
- *
- * - **workspace**: A large number leads to more (GPU) memory usage but may improve
- * the performance.
- *
- *
- *
- * Defined in src/operator/nn/convolution.cc:L470
- * @return org.apache.mxnet.NDArray - */ -def Convolution(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * This operator is DEPRECATED. Apply convolution to input then add a bias.
- * @return org.apache.mxnet.NDArray - */ -def Convolution_v1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * This operator is DEPRECATED. Apply convolution to input then add a bias.
- * @return org.apache.mxnet.NDArray - */ -def Convolution_v1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies correlation to inputs.
- *
- * The correlation layer performs multiplicative patch comparisons between two feature maps.
- *
- * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
- * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
- *
- * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
- * :math:`x_{2}` in the second map is then defined as:
- *
- * .. math::
- *
- * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
- *
- * for a square patch of size :math:`K:=2k+1`.
- *
- * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
- * data. For this reason, it has no training weights.
- *
- * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
- *
- * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
- * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
- * centered around :math:`x_{1}`.
- *
- * The final output is defined by the following expression:
- *
- * .. math::
- * out[n, q, i, j] = c(x_{i, j}, x_{q})
- *
- * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
- *
- *
- * Defined in src/operator/correlation.cc:L198
- * @return org.apache.mxnet.NDArray - */ -def Correlation(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies correlation to inputs.
- *
- * The correlation layer performs multiplicative patch comparisons between two feature maps.
- *
- * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
- * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
- *
- * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
- * :math:`x_{2}` in the second map is then defined as:
- *
- * .. math::
- *
- * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
- *
- * for a square patch of size :math:`K:=2k+1`.
- *
- * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
- * data. For this reason, it has no training weights.
- *
- * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
- *
- * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
- * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
- * centered around :math:`x_{1}`.
- *
- * The final output is defined by the following expression:
- *
- * .. math::
- * out[n, q, i, j] = c(x_{i, j}, x_{q})
- *
- * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
- *
- *
- * Defined in src/operator/correlation.cc:L198
- * @return org.apache.mxnet.NDArray - */ -def Correlation(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - *
- *
- * .. note:: `Crop` is deprecated. Use `slice` instead.
- *
- * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
- * with width and height of the second input symbol, i.e., with one input, we need h_w to
- * specify the crop height and width, otherwise the second input symbol's size will be used
- *
- *
- * Defined in src/operator/crop.cc:L50
- * @return org.apache.mxnet.NDArray - */ -def Crop(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - *
- *
- * .. note:: `Crop` is deprecated. Use `slice` instead.
- *
- * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
- * with width and height of the second input symbol, i.e., with one input, we need h_w to
- * specify the crop height and width, otherwise the second input symbol's size will be used
- *
- *
- * Defined in src/operator/crop.cc:L50
- * @return org.apache.mxnet.NDArray - */ -def Crop(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Apply a custom operator implemented in a frontend language (like Python).
- *
- * Custom operators should override required methods like `forward` and `backward`.
- * The custom operator must be registered before it can be used.
- * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
- *
- *
- *
- * Defined in src/operator/custom/custom.cc:L547
- * @return org.apache.mxnet.NDArray - */ -def Custom(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Apply a custom operator implemented in a frontend language (like Python).
- *
- * Custom operators should override required methods like `forward` and `backward`.
- * The custom operator must be registered before it can be used.
- * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
- *
- *
- *
- * Defined in src/operator/custom/custom.cc:L547
- * @return org.apache.mxnet.NDArray - */ -def Custom(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
- * @return org.apache.mxnet.NDArray - */ -def Deconvolution(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
- * @return org.apache.mxnet.NDArray - */ -def Deconvolution(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies dropout operation to input array.
- *
- * - During training, each element of the input is set to zero with probability p.
- * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
- * sum of the input unchanged.
- *
- * - During testing, this operator does not change the input if mode is 'training'.
- * If mode is 'always', the same computaion as during training will be applied.
- *
- * Example::
- *
- * random.seed(998)
- * input_array = array([[3., 0.5, -0.5, 2., 7.],
- * [2., -0.4, 7., 3., 0.2]])
- * a = symbol.Variable('a')
- * dropout = symbol.Dropout(a, p = 0.2)
- * executor = dropout.simple_bind(a = input_array.shape)
- *
- * ## If training
- * executor.forward(is_train = True, a = input_array)
- * executor.outputs
- * [[ 3.75 0.625 -0. 2.5 8.75 ]
- * [ 2.5 -0.5 8.75 3.75 0. ]]
- *
- * ## If testing
- * executor.forward(is_train = False, a = input_array)
- * executor.outputs
- * [[ 3. 0.5 -0.5 2. 7. ]
- * [ 2. -0.4 7. 3. 0.2 ]]
- *
- *
- * Defined in src/operator/nn/dropout.cc:L76
- * @return org.apache.mxnet.NDArray - */ -def Dropout(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies dropout operation to input array.
- *
- * - During training, each element of the input is set to zero with probability p.
- * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
- * sum of the input unchanged.
- *
- * - During testing, this operator does not change the input if mode is 'training'.
- * If mode is 'always', the same computaion as during training will be applied.
- *
- * Example::
- *
- * random.seed(998)
- * input_array = array([[3., 0.5, -0.5, 2., 7.],
- * [2., -0.4, 7., 3., 0.2]])
- * a = symbol.Variable('a')
- * dropout = symbol.Dropout(a, p = 0.2)
- * executor = dropout.simple_bind(a = input_array.shape)
- *
- * ## If training
- * executor.forward(is_train = True, a = input_array)
- * executor.outputs
- * [[ 3.75 0.625 -0. 2.5 8.75 ]
- * [ 2.5 -0.5 8.75 3.75 0. ]]
- *
- * ## If testing
- * executor.forward(is_train = False, a = input_array)
- * executor.outputs
- * [[ 3. 0.5 -0.5 2. 7. ]
- * [ 2. -0.4 7. 3. 0.2 ]]
- *
- *
- * Defined in src/operator/nn/dropout.cc:L76
- * @return org.apache.mxnet.NDArray - */ -def Dropout(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @return org.apache.mxnet.NDArray - */ -def ElementWiseSum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @return org.apache.mxnet.NDArray - */ -def ElementWiseSum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Maps integer indices to vector representations (embeddings).
- *
- * This operator maps words to real-valued vectors in a high-dimensional space,
- * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
- * For example, it has been noted that in the learned embedding spaces, similar words tend
- * to be close to each other and dissimilar words far apart.
- *
- * For an input array of shape (d1, ..., dK),
- * the shape of an output array is (d1, ..., dK, output_dim).
- * All the input values should be integers in the range [0, input_dim).
- *
- * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
- * (ip0, op0).
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last vector in an embedding matrix.
- *
- * Examples::
- *
- * input_dim = 4
- * output_dim = 5
- *
- * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
- * y = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.],
- * [ 10., 11., 12., 13., 14.],
- * [ 15., 16., 17., 18., 19.]]
- *
- * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
- * x = [[ 1., 3.],
- * [ 0., 2.]]
- *
- * // Mapped input x to its vector representation y.
- * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
- * [ 15., 16., 17., 18., 19.]],
- *
- * [[ 0., 1., 2., 3., 4.],
- * [ 10., 11., 12., 13., 14.]]]
- *
- *
- * The storage type of weight can be either row_sparse or default, while
- * the storage type of weight's grad depends on the value of "sparse_grad".
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L232
- * @return org.apache.mxnet.NDArray - */ -def Embedding(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Maps integer indices to vector representations (embeddings).
- *
- * This operator maps words to real-valued vectors in a high-dimensional space,
- * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
- * For example, it has been noted that in the learned embedding spaces, similar words tend
- * to be close to each other and dissimilar words far apart.
- *
- * For an input array of shape (d1, ..., dK),
- * the shape of an output array is (d1, ..., dK, output_dim).
- * All the input values should be integers in the range [0, input_dim).
- *
- * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
- * (ip0, op0).
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last vector in an embedding matrix.
- *
- * Examples::
- *
- * input_dim = 4
- * output_dim = 5
- *
- * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
- * y = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.],
- * [ 10., 11., 12., 13., 14.],
- * [ 15., 16., 17., 18., 19.]]
- *
- * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
- * x = [[ 1., 3.],
- * [ 0., 2.]]
- *
- * // Mapped input x to its vector representation y.
- * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
- * [ 15., 16., 17., 18., 19.]],
- *
- * [[ 0., 1., 2., 3., 4.],
- * [ 10., 11., 12., 13., 14.]]]
- *
- *
- * The storage type of weight can be either row_sparse or default, while
- * the storage type of weight's grad depends on the value of "sparse_grad".
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L232
- * @return org.apache.mxnet.NDArray - */ -def Embedding(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @return org.apache.mxnet.NDArray - */ -def Flatten(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @return org.apache.mxnet.NDArray - */ -def Flatten(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies a linear transformation: :math:`Y = XW^T + b`.
- *
- * If ``flatten`` is set to be true, then the shapes are:
- *
- * - **data**: `(batch_size, x1, x2, ..., xn)`
- * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(batch_size, num_hidden)`
- *
- * If ``flatten`` is set to be false, then the shapes are:
- *
- * - **data**: `(x1, x2, ..., xn, input_dim)`
- * - **weight**: `(num_hidden, input_dim)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(x1, x2, ..., xn, num_hidden)`
- *
- * The learnable parameters include both ``weight`` and ``bias``.
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * Note that the operator also supports forward computation with `row_sparse` weight and bias,
- * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
- * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
- *
- *
- *
- * Defined in src/operator/nn/fully_connected.cc:L254
- * @return org.apache.mxnet.NDArray - */ -def FullyConnected(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies a linear transformation: :math:`Y = XW^T + b`.
- *
- * If ``flatten`` is set to be true, then the shapes are:
- *
- * - **data**: `(batch_size, x1, x2, ..., xn)`
- * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(batch_size, num_hidden)`
- *
- * If ``flatten`` is set to be false, then the shapes are:
- *
- * - **data**: `(x1, x2, ..., xn, input_dim)`
- * - **weight**: `(num_hidden, input_dim)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(x1, x2, ..., xn, num_hidden)`
- *
- * The learnable parameters include both ``weight`` and ``bias``.
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * Note that the operator also supports forward computation with `row_sparse` weight and bias,
- * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
- * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
- *
- *
- *
- * Defined in src/operator/nn/fully_connected.cc:L254
- * @return org.apache.mxnet.NDArray - */ -def FullyConnected(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Generates 2D sampling grid for bilinear sampling.
- * @return org.apache.mxnet.NDArray - */ -def GridGenerator(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Generates 2D sampling grid for bilinear sampling.
- * @return org.apache.mxnet.NDArray - */ -def GridGenerator(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Apply a sparse regularization to the output a sigmoid activation function.
- * @return org.apache.mxnet.NDArray - */ -def IdentityAttachKLSparseReg(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Apply a sparse regularization to the output a sigmoid activation function.
- * @return org.apache.mxnet.NDArray - */ -def IdentityAttachKLSparseReg(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies instance normalization to the n-dimensional input array.
- *
- * This operator takes an n-dimensional input array where (n>2) and normalizes
- * the input using the following formula:
- *
- * .. math::
- *
- * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
- *
- * This layer is similar to batch normalization layer (`BatchNorm`)
- * with two differences: first, the normalization is
- * carried out per example (instance), not over a batch. Second, the
- * same normalization is applied both at test and train time. This
- * operation is also known as `contrast normalization`.
- *
- * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
- * `gamma` and `beta` parameters must be vectors of shape [channel].
- *
- * This implementation is based on paper:
- *
- * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
- * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
- *
- * Examples::
- *
- * // Input of shape (2,1,2)
- * x = [[[ 1.1, 2.2]],
- * [[ 3.3, 4.4]]]
- *
- * // gamma parameter of length 1
- * gamma = [1.5]
- *
- * // beta parameter of length 1
- * beta = [0.5]
- *
- * // Instance normalization is calculated with the above formula
- * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
- * [[-0.99752653, 1.99752724]]]
- *
- *
- *
- * Defined in src/operator/instance_norm.cc:L95
- * @return org.apache.mxnet.NDArray - */ -def InstanceNorm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies instance normalization to the n-dimensional input array.
- *
- * This operator takes an n-dimensional input array where (n>2) and normalizes
- * the input using the following formula:
- *
- * .. math::
- *
- * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
- *
- * This layer is similar to batch normalization layer (`BatchNorm`)
- * with two differences: first, the normalization is
- * carried out per example (instance), not over a batch. Second, the
- * same normalization is applied both at test and train time. This
- * operation is also known as `contrast normalization`.
- *
- * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
- * `gamma` and `beta` parameters must be vectors of shape [channel].
- *
- * This implementation is based on paper:
- *
- * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
- * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
- *
- * Examples::
- *
- * // Input of shape (2,1,2)
- * x = [[[ 1.1, 2.2]],
- * [[ 3.3, 4.4]]]
- *
- * // gamma parameter of length 1
- * gamma = [1.5]
- *
- * // beta parameter of length 1
- * beta = [0.5]
- *
- * // Instance normalization is calculated with the above formula
- * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
- * [[-0.99752653, 1.99752724]]]
- *
- *
- *
- * Defined in src/operator/instance_norm.cc:L95
- * @return org.apache.mxnet.NDArray - */ -def InstanceNorm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Normalize the input array using the L2 norm.
- *
- * For 1-D NDArray, it computes::
- *
- * out = data / sqrt(sum(data ** 2) + eps)
- *
- * For N-D NDArray, if the input array has shape (N, N, ..., N),
- *
- * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
- * array by its L2 norm.::
- *
- * for i in 0...N
- * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
- *
- * for i in 0...N
- * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
- * in the array by its L2 norm.::
- *
- * for dim in 2...N
- * for i in 0...N
- * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
- * -dim-
- *
- * Example::
- *
- * x = [[[1,2],
- * [3,4]],
- * [[2,2],
- * [5,6]]]
- *
- * L2Normalization(x, mode='instance')
- * =[[[ 0.18257418 0.36514837]
- * [ 0.54772252 0.73029673]]
- * [[ 0.24077171 0.24077171]
- * [ 0.60192931 0.72231513]]]
- *
- * L2Normalization(x, mode='channel')
- * =[[[ 0.31622776 0.44721359]
- * [ 0.94868326 0.89442718]]
- * [[ 0.37139067 0.31622776]
- * [ 0.92847669 0.94868326]]]
- *
- * L2Normalization(x, mode='spatial')
- * =[[[ 0.44721359 0.89442718]
- * [ 0.60000002 0.80000001]]
- * [[ 0.70710677 0.70710677]
- * [ 0.6401844 0.76822126]]]
- *
- *
- *
- * Defined in src/operator/l2_normalization.cc:L98
- * @return org.apache.mxnet.NDArray - */ -def L2Normalization(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Normalize the input array using the L2 norm.
- *
- * For 1-D NDArray, it computes::
- *
- * out = data / sqrt(sum(data ** 2) + eps)
- *
- * For N-D NDArray, if the input array has shape (N, N, ..., N),
- *
- * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
- * array by its L2 norm.::
- *
- * for i in 0...N
- * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
- *
- * for i in 0...N
- * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
- * in the array by its L2 norm.::
- *
- * for dim in 2...N
- * for i in 0...N
- * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
- * -dim-
- *
- * Example::
- *
- * x = [[[1,2],
- * [3,4]],
- * [[2,2],
- * [5,6]]]
- *
- * L2Normalization(x, mode='instance')
- * =[[[ 0.18257418 0.36514837]
- * [ 0.54772252 0.73029673]]
- * [[ 0.24077171 0.24077171]
- * [ 0.60192931 0.72231513]]]
- *
- * L2Normalization(x, mode='channel')
- * =[[[ 0.31622776 0.44721359]
- * [ 0.94868326 0.89442718]]
- * [[ 0.37139067 0.31622776]
- * [ 0.92847669 0.94868326]]]
- *
- * L2Normalization(x, mode='spatial')
- * =[[[ 0.44721359 0.89442718]
- * [ 0.60000002 0.80000001]]
- * [[ 0.70710677 0.70710677]
- * [ 0.6401844 0.76822126]]]
- *
- *
- *
- * Defined in src/operator/l2_normalization.cc:L98
- * @return org.apache.mxnet.NDArray - */ -def L2Normalization(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies local response normalization to the input.
- *
- * The local response normalization layer performs "lateral inhibition" by normalizing
- * over local input regions.
- *
- * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
- * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
- * activity :math:`b_{x,y}^{i}` is given by the expression:
- *
- * .. math::
- * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
- *
- * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
- * number of kernels in the layer.
- *
- *
- *
- * Defined in src/operator/nn/lrn.cc:L175
- * @return org.apache.mxnet.NDArray - */ -def LRN(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies local response normalization to the input.
- *
- * The local response normalization layer performs "lateral inhibition" by normalizing
- * over local input regions.
- *
- * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
- * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
- * activity :math:`b_{x,y}^{i}` is given by the expression:
- *
- * .. math::
- * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
- *
- * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
- * number of kernels in the layer.
- *
- *
- *
- * Defined in src/operator/nn/lrn.cc:L175
- * @return org.apache.mxnet.NDArray - */ -def LRN(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Layer normalization.
- *
- * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis and then
- * compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
- *
- * Both ``gamma`` and ``beta`` are learnable parameters.
- *
- * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_std``. Note that no gradient will be passed through these two outputs.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is -1, which sets the channel
- * axis to be the last item in the input shape.
- *
- *
- *
- * Defined in src/operator/nn/layer_norm.cc:L94
- * @return org.apache.mxnet.NDArray - */ -def LayerNorm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Layer normalization.
- *
- * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis and then
- * compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
- *
- * Both ``gamma`` and ``beta`` are learnable parameters.
- *
- * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_std``. Note that no gradient will be passed through these two outputs.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is -1, which sets the channel
- * axis to be the last item in the input shape.
- *
- *
- *
- * Defined in src/operator/nn/layer_norm.cc:L94
- * @return org.apache.mxnet.NDArray - */ -def LayerNorm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies Leaky rectified linear unit activation element-wise to the input.
- *
- * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
- * when the input is negative and has a slope of one when input is positive.
- *
- * The following modified ReLU Activation functions are supported:
- *
- * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
- * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
- * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
- * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
- * *[lower_bound, upper_bound)* for training, while fixed to be
- * *(lower_bound+upper_bound)/2* for inference.
- *
- *
- *
- * Defined in src/operator/leaky_relu.cc:L63
- * @return org.apache.mxnet.NDArray - */ -def LeakyReLU(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies Leaky rectified linear unit activation element-wise to the input.
- *
- * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
- * when the input is negative and has a slope of one when input is positive.
- *
- * The following modified ReLU Activation functions are supported:
- *
- * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
- * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
- * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
- * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
- * *[lower_bound, upper_bound)* for training, while fixed to be
- * *(lower_bound+upper_bound)/2* for inference.
- *
- *
- *
- * Defined in src/operator/leaky_relu.cc:L63
- * @return org.apache.mxnet.NDArray - */ -def LeakyReLU(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes and optimizes for squared loss during backward propagation.
- * Just outputs ``data`` during forward propagation.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the squared loss estimated over :math:`n` samples is defined as
- *
- * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
- *
- * .. note::
- * Use the LinearRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LinearRegressionOutput(default, default) = default
- * - LinearRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L92
- * @return org.apache.mxnet.NDArray - */ -def LinearRegressionOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes and optimizes for squared loss during backward propagation.
- * Just outputs ``data`` during forward propagation.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the squared loss estimated over :math:`n` samples is defined as
- *
- * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
- *
- * .. note::
- * Use the LinearRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LinearRegressionOutput(default, default) = default
- * - LinearRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L92
- * @return org.apache.mxnet.NDArray - */ -def LinearRegressionOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies a logistic function to the input.
- *
- * The logistic function, also known as the sigmoid function, is computed as
- * :math:`\frac{1}{1+exp(-\textbf{x})}`.
- *
- * Commonly, the sigmoid is used to squash the real-valued output of a linear model
- * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
- * It is suitable for binary classification or probability prediction tasks.
- *
- * .. note::
- * Use the LogisticRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LogisticRegressionOutput(default, default) = default
- * - LogisticRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L148
- * @return org.apache.mxnet.NDArray - */ -def LogisticRegressionOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies a logistic function to the input.
- *
- * The logistic function, also known as the sigmoid function, is computed as
- * :math:`\frac{1}{1+exp(-\textbf{x})}`.
- *
- * Commonly, the sigmoid is used to squash the real-valued output of a linear model
- * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
- * It is suitable for binary classification or probability prediction tasks.
- *
- * .. note::
- * Use the LogisticRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LogisticRegressionOutput(default, default) = default
- * - LogisticRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L148
- * @return org.apache.mxnet.NDArray - */ -def LogisticRegressionOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes mean absolute error of the input.
- *
- * MAE is a risk metric corresponding to the expected value of the absolute error.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
- *
- * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
- *
- * .. note::
- * Use the MAERegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - MAERegressionOutput(default, default) = default
- * - MAERegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L120
- * @return org.apache.mxnet.NDArray - */ -def MAERegressionOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes mean absolute error of the input.
- *
- * MAE is a risk metric corresponding to the expected value of the absolute error.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
- *
- * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
- *
- * .. note::
- * Use the MAERegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - MAERegressionOutput(default, default) = default
- * - MAERegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L120
- * @return org.apache.mxnet.NDArray - */ -def MAERegressionOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = MakeLoss(cross_entropy)
- *
- * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * In addition, we can give a scale to the loss by setting ``grad_scale``,
- * so that the gradient of the loss will be rescaled in the backpropagation.
- *
- * .. note:: This operator should be used as a Symbol instead of NDArray.
- *
- *
- *
- * Defined in src/operator/make_loss.cc:L71
- * @return org.apache.mxnet.NDArray - */ -def MakeLoss(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = MakeLoss(cross_entropy)
- *
- * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * In addition, we can give a scale to the loss by setting ``grad_scale``,
- * so that the gradient of the loss will be rescaled in the backpropagation.
- *
- * .. note:: This operator should be used as a Symbol instead of NDArray.
- *
- *
- *
- * Defined in src/operator/make_loss.cc:L71
- * @return org.apache.mxnet.NDArray - */ -def MakeLoss(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @return org.apache.mxnet.NDArray - */ -def Pad(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @return org.apache.mxnet.NDArray - */ -def Pad(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs pooling on the input.
- *
- * The shapes for 1-D pooling are
- *
- * - **data**: *(batch_size, channel, width)*,
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * The shapes for 2-D pooling are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- * - **lp**: Lp pooling
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- * Notes on Lp pooling:
- *
- * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
- * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
- * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
- *
- * For each window ``X``, the mathematical expression for Lp pooling is:
- *
- * ..math::
- * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
- *
- *
- *
- * Defined in src/operator/nn/pooling.cc:L367
- * @return org.apache.mxnet.NDArray - */ -def Pooling(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs pooling on the input.
- *
- * The shapes for 1-D pooling are
- *
- * - **data**: *(batch_size, channel, width)*,
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * The shapes for 2-D pooling are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- * - **lp**: Lp pooling
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- * Notes on Lp pooling:
- *
- * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
- * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
- * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
- *
- * For each window ``X``, the mathematical expression for Lp pooling is:
- *
- * ..math::
- * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
- *
- *
- *
- * Defined in src/operator/nn/pooling.cc:L367
- * @return org.apache.mxnet.NDArray - */ -def Pooling(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * This operator is DEPRECATED.
- * Perform pooling on the input.
- *
- * The shapes for 2-D pooling is
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- *
- * 1-D pooling is special case of 2-D pooling with *weight=1* and
- * *kernel[1]=1*.
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- *
- *
- * Defined in src/operator/pooling_v1.cc:L104
- * @return org.apache.mxnet.NDArray - */ -def Pooling_v1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * This operator is DEPRECATED.
- * Perform pooling on the input.
- *
- * The shapes for 2-D pooling is
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- *
- * 1-D pooling is special case of 2-D pooling with *weight=1* and
- * *kernel[1]=1*.
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- *
- *
- * Defined in src/operator/pooling_v1.cc:L104
- * @return org.apache.mxnet.NDArray - */ -def Pooling_v1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
- * implemented, with both multi-layer and bidirectional support.
- *
- * **Vanilla RNN**
- *
- * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
- * ReLU and Tanh.
- *
- * With ReLU activation function:
- *
- * .. math::
- * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * With Tanh activtion function:
- *
- * .. math::
- * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * Reference paper: Finding structure in time - Elman, 1988.
- * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
- *
- * **LSTM**
- *
- * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
- *
- * .. math::
- * \begin{array}{ll}
- * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
- * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
- * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
- * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
- * c_t = f_t * c_{(t-1)} + i_t * g_t \\
- * h_t = o_t * \tanh(c_t)
- * \end{array}
- *
- * **GRU**
- *
- * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
- *
- * The definition of GRU here is slightly different from paper but compatible with CUDNN.
- *
- * .. math::
- * \begin{array}{ll}
- * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
- * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
- * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
- * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
- * \end{array}
- * @return org.apache.mxnet.NDArray - */ -def RNN(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
- * implemented, with both multi-layer and bidirectional support.
- *
- * **Vanilla RNN**
- *
- * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
- * ReLU and Tanh.
- *
- * With ReLU activation function:
- *
- * .. math::
- * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * With Tanh activtion function:
- *
- * .. math::
- * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * Reference paper: Finding structure in time - Elman, 1988.
- * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
- *
- * **LSTM**
- *
- * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
- *
- * .. math::
- * \begin{array}{ll}
- * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
- * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
- * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
- * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
- * c_t = f_t * c_{(t-1)} + i_t * g_t \\
- * h_t = o_t * \tanh(c_t)
- * \end{array}
- *
- * **GRU**
- *
- * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
- *
- * The definition of GRU here is slightly different from paper but compatible with CUDNN.
- *
- * .. math::
- * \begin{array}{ll}
- * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
- * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
- * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
- * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
- * \end{array}
- * @return org.apache.mxnet.NDArray - */ -def RNN(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs region of interest(ROI) pooling on the input array.
- *
- * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
- * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
- * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
- * layer mostly used in training a `Fast R-CNN` network for object detection.
- *
- * This operator takes a 4D feature map as an input array and region proposals as `rois`,
- * then it pools over sub-regions of input and produces a fixed-sized output array
- * regardless of the ROI size.
- *
- * To crop the feature map accordingly, you can resize the bounding box coordinates
- * by changing the parameters `rois` and `spatial_scale`.
- *
- * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
- * indicated by a `pooled_size` parameter. batch_size will change to the number of region
- * bounding boxes after `ROIPooling`.
- *
- * The size of each region of interest doesn't have to be perfectly divisible by
- * the number of pooling sections(`pooled_size`).
- *
- * Example::
- *
- * x = [[[[ 0., 1., 2., 3., 4., 5.],
- * [ 6., 7., 8., 9., 10., 11.],
- * [ 12., 13., 14., 15., 16., 17.],
- * [ 18., 19., 20., 21., 22., 23.],
- * [ 24., 25., 26., 27., 28., 29.],
- * [ 30., 31., 32., 33., 34., 35.],
- * [ 36., 37., 38., 39., 40., 41.],
- * [ 42., 43., 44., 45., 46., 47.]]]]
- *
- * // region of interest i.e. bounding box coordinates.
- * y = [[0,0,0,4,4]]
- *
- * // returns array of shape (2,2) according to the given roi with max pooling.
- * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
- * [ 26., 28.]]]]
- *
- * // region of interest is changed due to the change in `spacial_scale` parameter.
- * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
- * [ 19., 21.]]]]
- *
- *
- *
- * Defined in src/operator/roi_pooling.cc:L295
- * @return org.apache.mxnet.NDArray - */ -def ROIPooling(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs region of interest(ROI) pooling on the input array.
- *
- * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
- * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
- * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
- * layer mostly used in training a `Fast R-CNN` network for object detection.
- *
- * This operator takes a 4D feature map as an input array and region proposals as `rois`,
- * then it pools over sub-regions of input and produces a fixed-sized output array
- * regardless of the ROI size.
- *
- * To crop the feature map accordingly, you can resize the bounding box coordinates
- * by changing the parameters `rois` and `spatial_scale`.
- *
- * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
- * indicated by a `pooled_size` parameter. batch_size will change to the number of region
- * bounding boxes after `ROIPooling`.
- *
- * The size of each region of interest doesn't have to be perfectly divisible by
- * the number of pooling sections(`pooled_size`).
- *
- * Example::
- *
- * x = [[[[ 0., 1., 2., 3., 4., 5.],
- * [ 6., 7., 8., 9., 10., 11.],
- * [ 12., 13., 14., 15., 16., 17.],
- * [ 18., 19., 20., 21., 22., 23.],
- * [ 24., 25., 26., 27., 28., 29.],
- * [ 30., 31., 32., 33., 34., 35.],
- * [ 36., 37., 38., 39., 40., 41.],
- * [ 42., 43., 44., 45., 46., 47.]]]]
- *
- * // region of interest i.e. bounding box coordinates.
- * y = [[0,0,0,4,4]]
- *
- * // returns array of shape (2,2) according to the given roi with max pooling.
- * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
- * [ 26., 28.]]]]
- *
- * // region of interest is changed due to the change in `spacial_scale` parameter.
- * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
- * [ 19., 21.]]]]
- *
- *
- *
- * Defined in src/operator/roi_pooling.cc:L295
- * @return org.apache.mxnet.NDArray - */ -def ROIPooling(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @return org.apache.mxnet.NDArray - */ -def Reshape(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @return org.apache.mxnet.NDArray - */ -def Reshape(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes support vector machine based transformation of the input.
- *
- * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
- * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
- * @return org.apache.mxnet.NDArray - */ -def SVMOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes support vector machine based transformation of the input.
- *
- * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
- * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
- * @return org.apache.mxnet.NDArray - */ -def SVMOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Takes the last element of a sequence.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
- * of the form [batch_size, other_feature_dims].
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
- * an input array of positive ints of dimension [batch_size]. To use this parameter,
- * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
- * to have the max sequence length.
- *
- * .. note:: Alternatively, you can also use `take` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]],
- *
- * [[ 10., 11., 12.],
- * [ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]]
- *
- * // returns last sequence when sequence_length parameter is not used
- * SequenceLast(x) = [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 13., 14., 15.],
- * [ 25., 26., 27.]]
- *
- *
- *
- * Defined in src/operator/sequence_last.cc:L92
- * @return org.apache.mxnet.NDArray - */ -def SequenceLast(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Takes the last element of a sequence.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
- * of the form [batch_size, other_feature_dims].
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
- * an input array of positive ints of dimension [batch_size]. To use this parameter,
- * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
- * to have the max sequence length.
- *
- * .. note:: Alternatively, you can also use `take` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]],
- *
- * [[ 10., 11., 12.],
- * [ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]]
- *
- * // returns last sequence when sequence_length parameter is not used
- * SequenceLast(x) = [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 13., 14., 15.],
- * [ 25., 26., 27.]]
- *
- *
- *
- * Defined in src/operator/sequence_last.cc:L92
- * @return org.apache.mxnet.NDArray - */ -def SequenceLast(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Sets all elements outside the sequence to a constant value.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
- * should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length and
- * this operator works as the `identity` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // works as identity operator when sequence_length parameter is not used
- * SequenceMask(x) = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [1,1] means 1 of each batch will be kept
- * // and other rows are masked with default mask value = 0
- * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]]]
- *
- * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
- * // and other rows are masked with value = 1
- * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 1., 1.],
- * [ 16., 17., 18.]]]
- *
- *
- *
- * Defined in src/operator/sequence_mask.cc:L114
- * @return org.apache.mxnet.NDArray - */ -def SequenceMask(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Sets all elements outside the sequence to a constant value.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
- * should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length and
- * this operator works as the `identity` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // works as identity operator when sequence_length parameter is not used
- * SequenceMask(x) = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [1,1] means 1 of each batch will be kept
- * // and other rows are masked with default mask value = 0
- * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]]]
- *
- * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
- * // and other rows are masked with value = 1
- * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 1., 1.],
- * [ 16., 17., 18.]]]
- *
- *
- *
- * Defined in src/operator/sequence_mask.cc:L114
- * @return org.apache.mxnet.NDArray - */ -def SequenceMask(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reverses the elements of each sequence.
- *
- * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
- * and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences.
- * `sequence_length` should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // returns reverse sequence when sequence_length parameter is not used
- * SequenceReverse(x) = [[[ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]]]
- *
- * // sequence_length [2,2] means 2 rows of
- * // both batch B1 and B2 will be reversed.
- * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
- * // will be reversed.
- * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 16., 17., 18.]],
- *
- * [[ 1., 2., 3.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14, 15.],
- * [ 4., 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/sequence_reverse.cc:L113
- * @return org.apache.mxnet.NDArray - */ -def SequenceReverse(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reverses the elements of each sequence.
- *
- * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
- * and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences.
- * `sequence_length` should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // returns reverse sequence when sequence_length parameter is not used
- * SequenceReverse(x) = [[[ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]]]
- *
- * // sequence_length [2,2] means 2 rows of
- * // both batch B1 and B2 will be reversed.
- * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
- * // will be reversed.
- * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 16., 17., 18.]],
- *
- * [[ 1., 2., 3.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14, 15.],
- * [ 4., 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/sequence_reverse.cc:L113
- * @return org.apache.mxnet.NDArray - */ -def SequenceReverse(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @return org.apache.mxnet.NDArray - */ -def SliceChannel(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @return org.apache.mxnet.NDArray - */ -def SliceChannel(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Please use `SoftmaxOutput`.
- *
- * .. note::
- *
- * This operator has been renamed to `SoftmaxOutput`, which
- * computes the gradient of cross-entropy loss w.r.t softmax output.
- * To just compute softmax output, use the `softmax` operator.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L138
- * @return org.apache.mxnet.NDArray - */ -def Softmax(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Please use `SoftmaxOutput`.
- *
- * .. note::
- *
- * This operator has been renamed to `SoftmaxOutput`, which
- * computes the gradient of cross-entropy loss w.r.t softmax output.
- * To just compute softmax output, use the `softmax` operator.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L138
- * @return org.apache.mxnet.NDArray - */ -def Softmax(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies softmax activation to input. This is intended for internal layers.
- *
- * .. note::
- *
- * This operator has been deprecated, please use `softmax`.
- *
- * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
- * This is the default mode.
- *
- * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
- * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
- * has at least 3 dimensions.
- * This can be used for `fully convolutional network`, `image segmentation`, etc.
- *
- * Example::
- *
- * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
- * >>> [2., -.4, 7., 3., 0.2]])
- * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
- * >>> print softmax_act.asnumpy()
- * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
- * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
- *
- *
- *
- * Defined in src/operator/nn/softmax_activation.cc:L59
- * @return org.apache.mxnet.NDArray - */ -def SoftmaxActivation(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies softmax activation to input. This is intended for internal layers.
- *
- * .. note::
- *
- * This operator has been deprecated, please use `softmax`.
- *
- * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
- * This is the default mode.
- *
- * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
- * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
- * has at least 3 dimensions.
- * This can be used for `fully convolutional network`, `image segmentation`, etc.
- *
- * Example::
- *
- * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
- * >>> [2., -.4, 7., 3., 0.2]])
- * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
- * >>> print softmax_act.asnumpy()
- * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
- * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
- *
- *
- *
- * Defined in src/operator/nn/softmax_activation.cc:L59
- * @return org.apache.mxnet.NDArray - */ -def SoftmaxActivation(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the gradient of cross entropy loss with respect to softmax output.
- *
- * - This operator computes the gradient in two steps.
- * The cross entropy loss does not actually need to be computed.
- *
- * - Applies softmax function on the input array.
- * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
- *
- * - The softmax function, cross entropy loss and gradient is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * - The gradient of cross entropy loss w.r.t softmax output:
- *
- * .. math:: \text{gradient} = \text{output} - \text{label}
- *
- * - During forward propagation, the softmax function is computed for each instance in the input array.
- *
- * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
- * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
- * and `multi_output` to specify the way to compute softmax:
- *
- * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
- * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
- * each row in the reshaped array, and afterwards reshape it back to the original shape
- * :math:`(d_1, d_2, ..., d_n)`.
- * - If `preserve_shape` is ``true``, the softmax function will be computed along
- * the last axis (`axis` = ``-1``).
- * - If `multi_output` is ``true``, the softmax function will be computed along
- * the second axis (`axis` = ``1``).
- *
- * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
- * The provided label can be a one-hot label array or a probability label array.
- *
- * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
- * with a particular label to be ignored during backward propagation. **This has no effect when
- * softmax `output` has same shape as `label`**.
- *
- * Example::
- *
- * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
- * label = [1,0,2,3]
- * ignore_label = 1
- * SoftmaxOutput(data=data, label = label,\
- * multi_output=true, use_ignore=true,\
- * ignore_label=ignore_label)
- * ## forward softmax output
- * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]]
- * ## backward gradient output
- * [[ 0. 0. 0. 0. ]
- * [-0.75 0.25 0.25 0.25]
- * [ 0.25 0.25 -0.75 0.25]
- * [ 0.25 0.25 0.25 -0.75]]
- * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
- *
- * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
- * give each loss function different weights.
- *
- * - This operator also supports various ways to normalize the gradient by `normalization`,
- * The `normalization` is applied if softmax output has different shape than the labels.
- * The `normalization` mode can be set to the followings:
- *
- * - ``'null'``: do nothing.
- * - ``'batch'``: divide the gradient by the batch size.
- * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L123
- * @return org.apache.mxnet.NDArray - */ -def SoftmaxOutput(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the gradient of cross entropy loss with respect to softmax output.
- *
- * - This operator computes the gradient in two steps.
- * The cross entropy loss does not actually need to be computed.
- *
- * - Applies softmax function on the input array.
- * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
- *
- * - The softmax function, cross entropy loss and gradient is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * - The gradient of cross entropy loss w.r.t softmax output:
- *
- * .. math:: \text{gradient} = \text{output} - \text{label}
- *
- * - During forward propagation, the softmax function is computed for each instance in the input array.
- *
- * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
- * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
- * and `multi_output` to specify the way to compute softmax:
- *
- * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
- * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
- * each row in the reshaped array, and afterwards reshape it back to the original shape
- * :math:`(d_1, d_2, ..., d_n)`.
- * - If `preserve_shape` is ``true``, the softmax function will be computed along
- * the last axis (`axis` = ``-1``).
- * - If `multi_output` is ``true``, the softmax function will be computed along
- * the second axis (`axis` = ``1``).
- *
- * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
- * The provided label can be a one-hot label array or a probability label array.
- *
- * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
- * with a particular label to be ignored during backward propagation. **This has no effect when
- * softmax `output` has same shape as `label`**.
- *
- * Example::
- *
- * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
- * label = [1,0,2,3]
- * ignore_label = 1
- * SoftmaxOutput(data=data, label = label,\
- * multi_output=true, use_ignore=true,\
- * ignore_label=ignore_label)
- * ## forward softmax output
- * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]]
- * ## backward gradient output
- * [[ 0. 0. 0. 0. ]
- * [-0.75 0.25 0.25 0.25]
- * [ 0.25 0.25 -0.75 0.25]
- * [ 0.25 0.25 0.25 -0.75]]
- * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
- *
- * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
- * give each loss function different weights.
- *
- * - This operator also supports various ways to normalize the gradient by `normalization`,
- * The `normalization` is applied if softmax output has different shape than the labels.
- * The `normalization` mode can be set to the followings:
- *
- * - ``'null'``: do nothing.
- * - ``'batch'``: divide the gradient by the batch size.
- * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L123
- * @return org.apache.mxnet.NDArray - */ -def SoftmaxOutput(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies a spatial transformer to input feature map.
- * @return org.apache.mxnet.NDArray - */ -def SpatialTransformer(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies a spatial transformer to input feature map.
- * @return org.apache.mxnet.NDArray - */ -def SpatialTransformer(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @return org.apache.mxnet.NDArray - */ -def SwapAxis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @return org.apache.mxnet.NDArray - */ -def SwapAxis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs nearest neighbor/bilinear up sampling to inputs.
- * @return org.apache.mxnet.NDArray - */ -def UpSampling(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs nearest neighbor/bilinear up sampling to inputs.
- * @return org.apache.mxnet.NDArray - */ -def UpSampling(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise absolute value of the input.
- *
- * Example::
- *
- * abs([-2, 0, 3]) = [2, 0, 3]
- *
- * The storage type of ``abs`` output depends upon the input storage type:
- *
- * - abs(default) = default
- * - abs(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
- * @return org.apache.mxnet.NDArray - */ -def abs(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise absolute value of the input.
- *
- * Example::
- *
- * abs([-2, 0, 3]) = [2, 0, 3]
- *
- * The storage type of ``abs`` output depends upon the input storage type:
- *
- * - abs(default) = default
- * - abs(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
- * @return org.apache.mxnet.NDArray - */ -def abs(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for Adam optimizer. Adam is seen as a generalization
- * of AdaGrad.
- *
- * Adam update consists of the following steps, where g represents gradient and m, v
- * are 1st and 2nd order moment estimates (mean and variance).
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
- *
- * It updates the weights using::
- *
- * m = beta1*m + (1-beta1)*grad
- * v = beta2*v + (1-beta2)*(grad**2)
- * w += - learning_rate * m / (sqrt(v) + epsilon)
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
- * type of weight is the same as those of m and v,
- * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
- *
- * for row in grad.indices:
- * m[row] = beta1*m[row] + (1-beta1)*grad[row]
- * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
- * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L495
- * @return org.apache.mxnet.NDArray - */ -def adam_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for Adam optimizer. Adam is seen as a generalization
- * of AdaGrad.
- *
- * Adam update consists of the following steps, where g represents gradient and m, v
- * are 1st and 2nd order moment estimates (mean and variance).
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
- *
- * It updates the weights using::
- *
- * m = beta1*m + (1-beta1)*grad
- * v = beta2*v + (1-beta2)*(grad**2)
- * w += - learning_rate * m / (sqrt(v) + epsilon)
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
- * type of weight is the same as those of m and v,
- * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
- *
- * for row in grad.indices:
- * m[row] = beta1*m[row] + (1-beta1)*grad[row]
- * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
- * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L495
- * @return org.apache.mxnet.NDArray - */ -def adam_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @return org.apache.mxnet.NDArray - */ -def add_n(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @return org.apache.mxnet.NDArray - */ -def add_n(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse cosine of the input array.
- *
- * The input should be in range `[-1, 1]`.
- * The output is in the closed interval :math:`[0, \pi]`
- *
- * .. math::
- * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
- *
- * The storage type of ``arccos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
- * @return org.apache.mxnet.NDArray - */ -def arccos(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse cosine of the input array.
- *
- * The input should be in range `[-1, 1]`.
- * The output is in the closed interval :math:`[0, \pi]`
- *
- * .. math::
- * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
- *
- * The storage type of ``arccos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
- * @return org.apache.mxnet.NDArray - */ -def arccos(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the element-wise inverse hyperbolic cosine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arccosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
- * @return org.apache.mxnet.NDArray - */ -def arccosh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the element-wise inverse hyperbolic cosine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arccosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
- * @return org.apache.mxnet.NDArray - */ -def arccosh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse sine of the input array.
- *
- * The input should be in the range `[-1, 1]`.
- * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
- *
- * .. math::
- * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
- *
- * The storage type of ``arcsin`` output depends upon the input storage type:
- *
- * - arcsin(default) = default
- * - arcsin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
- * @return org.apache.mxnet.NDArray - */ -def arcsin(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse sine of the input array.
- *
- * The input should be in the range `[-1, 1]`.
- * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
- *
- * .. math::
- * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
- *
- * The storage type of ``arcsin`` output depends upon the input storage type:
- *
- * - arcsin(default) = default
- * - arcsin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
- * @return org.apache.mxnet.NDArray - */ -def arcsin(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the element-wise inverse hyperbolic sine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arcsinh`` output depends upon the input storage type:
- *
- * - arcsinh(default) = default
- * - arcsinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
- * @return org.apache.mxnet.NDArray - */ -def arcsinh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the element-wise inverse hyperbolic sine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arcsinh`` output depends upon the input storage type:
- *
- * - arcsinh(default) = default
- * - arcsinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
- * @return org.apache.mxnet.NDArray - */ -def arcsinh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse tangent of the input array.
- *
- * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
- *
- * .. math::
- * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
- *
- * The storage type of ``arctan`` output depends upon the input storage type:
- *
- * - arctan(default) = default
- * - arctan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
- * @return org.apache.mxnet.NDArray - */ -def arctan(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse tangent of the input array.
- *
- * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
- *
- * .. math::
- * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
- *
- * The storage type of ``arctan`` output depends upon the input storage type:
- *
- * - arctan(default) = default
- * - arctan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
- * @return org.apache.mxnet.NDArray - */ -def arctan(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the element-wise inverse hyperbolic tangent of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arctanh`` output depends upon the input storage type:
- *
- * - arctanh(default) = default
- * - arctanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
- * @return org.apache.mxnet.NDArray - */ -def arctanh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the element-wise inverse hyperbolic tangent of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arctanh`` output depends upon the input storage type:
- *
- * - arctanh(default) = default
- * - arctanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
- * @return org.apache.mxnet.NDArray - */ -def arctanh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns indices of the maximum values along an axis.
- *
- * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmax along axis 0
- * argmax(x, axis=0) = [ 1., 1., 1.]
- *
- * // argmax along axis 1
- * argmax(x, axis=1) = [ 2., 2.]
- *
- * // argmax along axis 1 keeping same dims as an input array
- * argmax(x, axis=1, keepdims=True) = [[ 2.],
- * [ 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
- * @return org.apache.mxnet.NDArray - */ -def argmax(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns indices of the maximum values along an axis.
- *
- * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmax along axis 0
- * argmax(x, axis=0) = [ 1., 1., 1.]
- *
- * // argmax along axis 1
- * argmax(x, axis=1) = [ 2., 2.]
- *
- * // argmax along axis 1 keeping same dims as an input array
- * argmax(x, axis=1, keepdims=True) = [[ 2.],
- * [ 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
- * @return org.apache.mxnet.NDArray - */ -def argmax(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns argmax indices of each channel from the input array.
- *
- * The result will be an NDArray of shape (num_channel,).
- *
- * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * argmax_channel(x) = [ 2., 2.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
- * @return org.apache.mxnet.NDArray - */ -def argmax_channel(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns argmax indices of each channel from the input array.
- *
- * The result will be an NDArray of shape (num_channel,).
- *
- * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * argmax_channel(x) = [ 2., 2.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
- * @return org.apache.mxnet.NDArray - */ -def argmax_channel(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns indices of the minimum values along an axis.
- *
- * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmin along axis 0
- * argmin(x, axis=0) = [ 0., 0., 0.]
- *
- * // argmin along axis 1
- * argmin(x, axis=1) = [ 0., 0.]
- *
- * // argmin along axis 1 keeping same dims as an input array
- * argmin(x, axis=1, keepdims=True) = [[ 0.],
- * [ 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
- * @return org.apache.mxnet.NDArray - */ -def argmin(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns indices of the minimum values along an axis.
- *
- * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmin along axis 0
- * argmin(x, axis=0) = [ 0., 0., 0.]
- *
- * // argmin along axis 1
- * argmin(x, axis=1) = [ 0., 0.]
- *
- * // argmin along axis 1 keeping same dims as an input array
- * argmin(x, axis=1, keepdims=True) = [[ 0.],
- * [ 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
- * @return org.apache.mxnet.NDArray - */ -def argmin(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the indices that would sort an input array along the given axis.
- *
- * This function performs sorting along the given axis and returns an array of indices having same shape
- * as an input array that index data in sorted order.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // sort along axis -1
- * argsort(x) = [[ 1., 0., 2.],
- * [ 0., 2., 1.]]
- *
- * // sort along axis 0
- * argsort(x, axis=0) = [[ 1., 0., 1.]
- * [ 0., 1., 0.]]
- *
- * // flatten and then sort
- * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L176
- * @return org.apache.mxnet.NDArray - */ -def argsort(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the indices that would sort an input array along the given axis.
- *
- * This function performs sorting along the given axis and returns an array of indices having same shape
- * as an input array that index data in sorted order.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // sort along axis -1
- * argsort(x) = [[ 1., 0., 2.],
- * [ 0., 2., 1.]]
- *
- * // sort along axis 0
- * argsort(x, axis=0) = [[ 1., 0., 1.]
- * [ 0., 1., 0.]]
- *
- * // flatten and then sort
- * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L176
- * @return org.apache.mxnet.NDArray - */ -def argsort(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Batchwise dot product.
- *
- * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
- * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
- *
- * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
- * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
- * which is computed by::
- *
- * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L117
- * @return org.apache.mxnet.NDArray - */ -def batch_dot(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Batchwise dot product.
- *
- * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
- * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
- *
- * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
- * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
- * which is computed by::
- *
- * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L117
- * @return org.apache.mxnet.NDArray - */ -def batch_dot(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Takes elements from a data batch.
- *
- * .. note::
- * `batch_take` is deprecated. Use `pick` instead.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // takes elements with specified indices
- * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L444
- * @return org.apache.mxnet.NDArray - */ -def batch_take(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Takes elements from a data batch.
- *
- * .. note::
- * `batch_take` is deprecated. Use `pick` instead.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // takes elements with specified indices
- * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L444
- * @return org.apache.mxnet.NDArray - */ -def batch_take(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @return org.apache.mxnet.NDArray - */ -def broadcast_add(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @return org.apache.mxnet.NDArray - */ -def broadcast_add(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @return org.apache.mxnet.NDArray - */ -def broadcast_axes(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @return org.apache.mxnet.NDArray - */ -def broadcast_axes(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @return org.apache.mxnet.NDArray - */ -def broadcast_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @return org.apache.mxnet.NDArray - */ -def broadcast_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise division of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 6., 6., 6.],
- * [ 6., 6., 6.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_div(x, y) = [[ 3., 3., 3.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_div(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
- * @return org.apache.mxnet.NDArray - */ -def broadcast_div(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise division of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 6., 6., 6.],
- * [ 6., 6., 6.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_div(x, y) = [[ 3., 3., 3.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_div(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
- * @return org.apache.mxnet.NDArray - */ -def broadcast_div(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
- * @return org.apache.mxnet.NDArray - */ -def broadcast_equal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
- * @return org.apache.mxnet.NDArray - */ -def broadcast_equal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
- * @return org.apache.mxnet.NDArray - */ -def broadcast_greater(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
- * @return org.apache.mxnet.NDArray - */ -def broadcast_greater(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
- * @return org.apache.mxnet.NDArray - */ -def broadcast_greater_equal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
- * @return org.apache.mxnet.NDArray - */ -def broadcast_greater_equal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hypotenuse of a right angled triangle, given its "legs"
- * with broadcasting.
- *
- * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
- *
- * Example::
- *
- * x = [[ 3., 3., 3.]]
- *
- * y = [[ 4.],
- * [ 4.]]
- *
- * broadcast_hypot(x, y) = [[ 5., 5., 5.],
- * [ 5., 5., 5.]]
- *
- * z = [[ 0.],
- * [ 4.]]
- *
- * broadcast_hypot(x, z) = [[ 3., 3., 3.],
- * [ 5., 5., 5.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
- * @return org.apache.mxnet.NDArray - */ -def broadcast_hypot(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hypotenuse of a right angled triangle, given its "legs"
- * with broadcasting.
- *
- * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
- *
- * Example::
- *
- * x = [[ 3., 3., 3.]]
- *
- * y = [[ 4.],
- * [ 4.]]
- *
- * broadcast_hypot(x, y) = [[ 5., 5., 5.],
- * [ 5., 5., 5.]]
- *
- * z = [[ 0.],
- * [ 4.]]
- *
- * broadcast_hypot(x, z) = [[ 3., 3., 3.],
- * [ 5., 5., 5.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
- * @return org.apache.mxnet.NDArray - */ -def broadcast_hypot(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser(x, y) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
- * @return org.apache.mxnet.NDArray - */ -def broadcast_lesser(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser(x, y) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
- * @return org.apache.mxnet.NDArray - */ -def broadcast_lesser(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
- * @return org.apache.mxnet.NDArray - */ -def broadcast_lesser_equal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
- * @return org.apache.mxnet.NDArray - */ -def broadcast_lesser_equal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **logical and** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
- * @return org.apache.mxnet.NDArray - */ -def broadcast_logical_and(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **logical and** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
- * @return org.apache.mxnet.NDArray - */ -def broadcast_logical_and(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **logical or** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
- * @return org.apache.mxnet.NDArray - */ -def broadcast_logical_or(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **logical or** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
- * @return org.apache.mxnet.NDArray - */ -def broadcast_logical_or(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **logical xor** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
- * @return org.apache.mxnet.NDArray - */ -def broadcast_logical_xor(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **logical xor** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
- * @return org.apache.mxnet.NDArray - */ -def broadcast_logical_xor(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise maximum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise maxima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
- * @return org.apache.mxnet.NDArray - */ -def broadcast_maximum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise maximum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise maxima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
- * @return org.apache.mxnet.NDArray - */ -def broadcast_maximum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise minimum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise minima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
- * @return org.apache.mxnet.NDArray - */ -def broadcast_minimum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise minimum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise minima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
- * @return org.apache.mxnet.NDArray - */ -def broadcast_minimum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @return org.apache.mxnet.NDArray - */ -def broadcast_minus(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @return org.apache.mxnet.NDArray - */ -def broadcast_minus(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise modulo of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 8., 8., 8.],
- * [ 8., 8., 8.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_mod(x, y) = [[ 0., 0., 0.],
- * [ 2., 2., 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
- * @return org.apache.mxnet.NDArray - */ -def broadcast_mod(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise modulo of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 8., 8., 8.],
- * [ 8., 8., 8.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_mod(x, y) = [[ 0., 0., 0.],
- * [ 2., 2., 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
- * @return org.apache.mxnet.NDArray - */ -def broadcast_mod(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise product of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_mul(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- * Supported sparse operations:
- *
- * broadcast_mul(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
- * @return org.apache.mxnet.NDArray - */ -def broadcast_mul(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise product of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_mul(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- * Supported sparse operations:
- *
- * broadcast_mul(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
- * @return org.apache.mxnet.NDArray - */ -def broadcast_mul(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
- * @return org.apache.mxnet.NDArray - */ -def broadcast_not_equal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
- * @return org.apache.mxnet.NDArray - */ -def broadcast_not_equal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @return org.apache.mxnet.NDArray - */ -def broadcast_plus(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @return org.apache.mxnet.NDArray - */ -def broadcast_plus(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_power(x, y) = [[ 2., 2., 2.],
- * [ 4., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
- * @return org.apache.mxnet.NDArray - */ -def broadcast_power(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_power(x, y) = [[ 2., 2., 2.],
- * [ 4., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
- * @return org.apache.mxnet.NDArray - */ -def broadcast_power(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @return org.apache.mxnet.NDArray - */ -def broadcast_sub(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @return org.apache.mxnet.NDArray - */ -def broadcast_sub(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Broadcasts the input array to a new shape.
- *
- * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
- * with arrays of different shapes efficiently without creating multiple copies of arrays.
- * Also see, `Broadcasting `_ for more explanation.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * For example::
- *
- * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
- * [ 1., 2., 3.]])
- *
- * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
- * So with `shape=(2,0)`, we will obtain the same result as in the above example.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
- * @return org.apache.mxnet.NDArray - */ -def broadcast_to(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Broadcasts the input array to a new shape.
- *
- * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
- * with arrays of different shapes efficiently without creating multiple copies of arrays.
- * Also see, `Broadcasting `_ for more explanation.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * For example::
- *
- * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
- * [ 1., 2., 3.]])
- *
- * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
- * So with `shape=(2,0)`, we will obtain the same result as in the above example.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
- * @return org.apache.mxnet.NDArray - */ -def broadcast_to(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @return org.apache.mxnet.NDArray - */ -def cast(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @return org.apache.mxnet.NDArray - */ -def cast(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Casts tensor storage type to the new type.
- *
- * When an NDArray with default storage type is cast to csr or row_sparse storage,
- * the result is compact, which means:
- *
- * - for csr, zero values will not be retained
- * - for row_sparse, row slices of all zeros will not be retained
- *
- * The storage type of ``cast_storage`` output depends on stype parameter:
- *
- * - cast_storage(csr, 'default') = default
- * - cast_storage(row_sparse, 'default') = default
- * - cast_storage(default, 'csr') = csr
- * - cast_storage(default, 'row_sparse') = row_sparse
- * - cast_storage(csr, 'csr') = csr
- * - cast_storage(row_sparse, 'row_sparse') = row_sparse
- *
- * Example::
- *
- * dense = [[ 0., 1., 0.],
- * [ 2., 0., 3.],
- * [ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * # cast to row_sparse storage type
- * rsp = cast_storage(dense, 'row_sparse')
- * rsp.indices = [0, 1]
- * rsp.values = [[ 0., 1., 0.],
- * [ 2., 0., 3.]]
- *
- * # cast to csr storage type
- * csr = cast_storage(dense, 'csr')
- * csr.indices = [1, 0, 2]
- * csr.values = [ 1., 2., 3.]
- * csr.indptr = [0, 1, 3, 3, 3]
- *
- *
- *
- * Defined in src/operator/tensor/cast_storage.cc:L71
- * @return org.apache.mxnet.NDArray - */ -def cast_storage(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Casts tensor storage type to the new type.
- *
- * When an NDArray with default storage type is cast to csr or row_sparse storage,
- * the result is compact, which means:
- *
- * - for csr, zero values will not be retained
- * - for row_sparse, row slices of all zeros will not be retained
- *
- * The storage type of ``cast_storage`` output depends on stype parameter:
- *
- * - cast_storage(csr, 'default') = default
- * - cast_storage(row_sparse, 'default') = default
- * - cast_storage(default, 'csr') = csr
- * - cast_storage(default, 'row_sparse') = row_sparse
- * - cast_storage(csr, 'csr') = csr
- * - cast_storage(row_sparse, 'row_sparse') = row_sparse
- *
- * Example::
- *
- * dense = [[ 0., 1., 0.],
- * [ 2., 0., 3.],
- * [ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * # cast to row_sparse storage type
- * rsp = cast_storage(dense, 'row_sparse')
- * rsp.indices = [0, 1]
- * rsp.values = [[ 0., 1., 0.],
- * [ 2., 0., 3.]]
- *
- * # cast to csr storage type
- * csr = cast_storage(dense, 'csr')
- * csr.indices = [1, 0, 2]
- * csr.values = [ 1., 2., 3.]
- * csr.indptr = [0, 1, 3, 3, 3]
- *
- *
- *
- * Defined in src/operator/tensor/cast_storage.cc:L71
- * @return org.apache.mxnet.NDArray - */ -def cast_storage(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise cube-root value of the input.
- *
- * .. math::
- * cbrt(x) = \sqrt[3]{x}
- *
- * Example::
- *
- * cbrt([1, 8, -125]) = [1, 2, -5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
- * @return org.apache.mxnet.NDArray - */ -def cbrt(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise cube-root value of the input.
- *
- * .. math::
- * cbrt(x) = \sqrt[3]{x}
- *
- * Example::
- *
- * cbrt([1, 8, -125]) = [1, 2, -5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
- * @return org.apache.mxnet.NDArray - */ -def cbrt(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise ceiling of the input.
- *
- * The ceil of the scalar x is the smallest integer i, such that i >= x.
- *
- * Example::
- *
- * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
- *
- * The storage type of ``ceil`` output depends upon the input storage type:
- *
- * - ceil(default) = default
- * - ceil(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
- * @return org.apache.mxnet.NDArray - */ -def ceil(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise ceiling of the input.
- *
- * The ceil of the scalar x is the smallest integer i, such that i >= x.
- *
- * Example::
- *
- * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
- *
- * The storage type of ``ceil`` output depends upon the input storage type:
- *
- * - ceil(default) = default
- * - ceil(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
- * @return org.apache.mxnet.NDArray - */ -def ceil(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
- * @return org.apache.mxnet.NDArray - */ -def choose_element_0index(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
- * @return org.apache.mxnet.NDArray - */ -def choose_element_0index(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Clips (limits) the values in an array.
- *
- * Given an interval, values outside the interval are clipped to the interval edges.
- * Clipping ``x`` between `a_min` and `a_x` would be::
- *
- * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
- *
- * Example::
- *
- * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- *
- * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
- *
- * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
- * parameter values:
- *
- * - clip(default) = default
- * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
- * - clip(csr, a_min <= 0, a_max >= 0) = csr
- * - clip(row_sparse, a_min < 0, a_max < 0) = default
- * - clip(row_sparse, a_min > 0, a_max > 0) = default
- * - clip(csr, a_min < 0, a_max < 0) = csr
- * - clip(csr, a_min > 0, a_max > 0) = csr
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L617
- * @return org.apache.mxnet.NDArray - */ -def clip(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Clips (limits) the values in an array.
- *
- * Given an interval, values outside the interval are clipped to the interval edges.
- * Clipping ``x`` between `a_min` and `a_x` would be::
- *
- * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
- *
- * Example::
- *
- * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- *
- * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
- *
- * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
- * parameter values:
- *
- * - clip(default) = default
- * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
- * - clip(csr, a_min <= 0, a_max >= 0) = csr
- * - clip(row_sparse, a_min < 0, a_max < 0) = default
- * - clip(row_sparse, a_min > 0, a_max > 0) = default
- * - clip(csr, a_min < 0, a_max < 0) = csr
- * - clip(csr, a_min > 0, a_max > 0) = csr
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L617
- * @return org.apache.mxnet.NDArray - */ -def clip(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @return org.apache.mxnet.NDArray - */ -def concat(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @return org.apache.mxnet.NDArray - */ -def concat(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the element-wise cosine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
- *
- * The storage type of ``cos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
- * @return org.apache.mxnet.NDArray - */ -def cos(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the element-wise cosine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
- *
- * The storage type of ``cos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
- * @return org.apache.mxnet.NDArray - */ -def cos(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hyperbolic cosine of the input array, computed element-wise.
- *
- * .. math::
- * cosh(x) = 0.5\times(exp(x) + exp(-x))
- *
- * The storage type of ``cosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
- * @return org.apache.mxnet.NDArray - */ -def cosh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hyperbolic cosine of the input array, computed element-wise.
- *
- * .. math::
- * cosh(x) = 0.5\times(exp(x) + exp(-x))
- *
- * The storage type of ``cosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
- * @return org.apache.mxnet.NDArray - */ -def cosh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @return org.apache.mxnet.NDArray - */ -def crop(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @return org.apache.mxnet.NDArray - */ -def crop(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts each element of the input array from radians to degrees.
- *
- * .. math::
- * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
- *
- * The storage type of ``degrees`` output depends upon the input storage type:
- *
- * - degrees(default) = default
- * - degrees(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
- * @return org.apache.mxnet.NDArray - */ -def degrees(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts each element of the input array from radians to degrees.
- *
- * .. math::
- * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
- *
- * The storage type of ``degrees`` output depends upon the input storage type:
- *
- * - degrees(default) = default
- * - degrees(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
- * @return org.apache.mxnet.NDArray - */ -def degrees(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Dot product of two arrays.
- *
- * ``dot``'s behavior depends on the input array dimensions:
- *
- * - 1-D arrays: inner product of vectors
- * - 2-D arrays: matrix multiplication
- * - N-D arrays: a sum product over the last axis of the first input and the first
- * axis of the second input
- *
- * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
- * result array will have shape `(n,m,r,s)`. It is computed by::
- *
- * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
- *
- * Example::
- *
- * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
- * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
- * dot(x,y)[0,0,1,1] = 0
- * sum(x[0,0,:]*y[:,1,1]) = 0
- *
- * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
- * forward_stype option for output storage type. Implemented sparse operations include:
- *
- * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
- * - dot(csr, default, transpose_a=True) = default
- * - dot(csr, default, transpose_a=True) = row_sparse
- * - dot(csr, default) = default
- * - dot(csr, row_sparse) = default
- * - dot(default, csr) = csr (CPU only)
- * - dot(default, csr, forward_stype='default') = default
- * - dot(default, csr, transpose_b=True, forward_stype='default') = default
- *
- * If the combination of input storage types and forward_stype does not match any of the
- * above patterns, ``dot`` will fallback and generate output with default storage.
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L69
- * @return org.apache.mxnet.NDArray - */ -def dot(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Dot product of two arrays.
- *
- * ``dot``'s behavior depends on the input array dimensions:
- *
- * - 1-D arrays: inner product of vectors
- * - 2-D arrays: matrix multiplication
- * - N-D arrays: a sum product over the last axis of the first input and the first
- * axis of the second input
- *
- * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
- * result array will have shape `(n,m,r,s)`. It is computed by::
- *
- * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
- *
- * Example::
- *
- * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
- * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
- * dot(x,y)[0,0,1,1] = 0
- * sum(x[0,0,:]*y[:,1,1]) = 0
- *
- * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
- * forward_stype option for output storage type. Implemented sparse operations include:
- *
- * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
- * - dot(csr, default, transpose_a=True) = default
- * - dot(csr, default, transpose_a=True) = row_sparse
- * - dot(csr, default) = default
- * - dot(csr, row_sparse) = default
- * - dot(default, csr) = csr (CPU only)
- * - dot(default, csr, forward_stype='default') = default
- * - dot(default, csr, transpose_b=True, forward_stype='default') = default
- *
- * If the combination of input storage types and forward_stype does not match any of the
- * above patterns, ``dot`` will fallback and generate output with default storage.
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L69
- * @return org.apache.mxnet.NDArray - */ -def dot(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Adds arguments element-wise.
- *
- * The storage type of ``elemwise_add`` output depends on storage types of inputs
- *
- * - elemwise_add(row_sparse, row_sparse) = row_sparse
- * - elemwise_add(csr, csr) = csr
- * - elemwise_add(default, csr) = default
- * - elemwise_add(csr, default) = default
- * - elemwise_add(default, rsp) = default
- * - elemwise_add(rsp, default) = default
- * - otherwise, ``elemwise_add`` generates output with default storage
- * @return org.apache.mxnet.NDArray - */ -def elemwise_add(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Adds arguments element-wise.
- *
- * The storage type of ``elemwise_add`` output depends on storage types of inputs
- *
- * - elemwise_add(row_sparse, row_sparse) = row_sparse
- * - elemwise_add(csr, csr) = csr
- * - elemwise_add(default, csr) = default
- * - elemwise_add(csr, default) = default
- * - elemwise_add(default, rsp) = default
- * - elemwise_add(rsp, default) = default
- * - otherwise, ``elemwise_add`` generates output with default storage
- * @return org.apache.mxnet.NDArray - */ -def elemwise_add(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Divides arguments element-wise.
- *
- * The storage type of ``elemwise_div`` output is always dense
- * @return org.apache.mxnet.NDArray - */ -def elemwise_div(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Divides arguments element-wise.
- *
- * The storage type of ``elemwise_div`` output is always dense
- * @return org.apache.mxnet.NDArray - */ -def elemwise_div(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Multiplies arguments element-wise.
- *
- * The storage type of ``elemwise_mul`` output depends on storage types of inputs
- *
- * - elemwise_mul(default, default) = default
- * - elemwise_mul(row_sparse, row_sparse) = row_sparse
- * - elemwise_mul(default, row_sparse) = row_sparse
- * - elemwise_mul(row_sparse, default) = row_sparse
- * - elemwise_mul(csr, csr) = csr
- * - otherwise, ``elemwise_mul`` generates output with default storage
- * @return org.apache.mxnet.NDArray - */ -def elemwise_mul(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Multiplies arguments element-wise.
- *
- * The storage type of ``elemwise_mul`` output depends on storage types of inputs
- *
- * - elemwise_mul(default, default) = default
- * - elemwise_mul(row_sparse, row_sparse) = row_sparse
- * - elemwise_mul(default, row_sparse) = row_sparse
- * - elemwise_mul(row_sparse, default) = row_sparse
- * - elemwise_mul(csr, csr) = csr
- * - otherwise, ``elemwise_mul`` generates output with default storage
- * @return org.apache.mxnet.NDArray - */ -def elemwise_mul(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Subtracts arguments element-wise.
- *
- * The storage type of ``elemwise_sub`` output depends on storage types of inputs
- *
- * - elemwise_sub(row_sparse, row_sparse) = row_sparse
- * - elemwise_sub(csr, csr) = csr
- * - elemwise_sub(default, csr) = default
- * - elemwise_sub(csr, default) = default
- * - elemwise_sub(default, rsp) = default
- * - elemwise_sub(rsp, default) = default
- * - otherwise, ``elemwise_sub`` generates output with default storage
- * @return org.apache.mxnet.NDArray - */ -def elemwise_sub(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Subtracts arguments element-wise.
- *
- * The storage type of ``elemwise_sub`` output depends on storage types of inputs
- *
- * - elemwise_sub(row_sparse, row_sparse) = row_sparse
- * - elemwise_sub(csr, csr) = csr
- * - elemwise_sub(default, csr) = default
- * - elemwise_sub(csr, default) = default
- * - elemwise_sub(default, rsp) = default
- * - elemwise_sub(rsp, default) = default
- * - otherwise, ``elemwise_sub`` generates output with default storage
- * @return org.apache.mxnet.NDArray - */ -def elemwise_sub(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise exponential value of the input.
- *
- * .. math::
- * exp(x) = e^x \approx 2.718^x
- *
- * Example::
- *
- * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
- *
- * The storage type of ``exp`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
- * @return org.apache.mxnet.NDArray - */ -def exp(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise exponential value of the input.
- *
- * .. math::
- * exp(x) = e^x \approx 2.718^x
- *
- * Example::
- *
- * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
- *
- * The storage type of ``exp`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
- * @return org.apache.mxnet.NDArray - */ -def exp(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Inserts a new axis of size 1 into the array shape
- *
- * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
- * will return a new array with shape ``(2,1,3,4)``.
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L346
- * @return org.apache.mxnet.NDArray - */ -def expand_dims(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Inserts a new axis of size 1 into the array shape
- *
- * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
- * will return a new array with shape ``(2,1,3,4)``.
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L346
- * @return org.apache.mxnet.NDArray - */ -def expand_dims(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns ``exp(x) - 1`` computed element-wise on the input.
- *
- * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
- *
- * The storage type of ``expm1`` output depends upon the input storage type:
- *
- * - expm1(default) = default
- * - expm1(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
- * @return org.apache.mxnet.NDArray - */ -def expm1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns ``exp(x) - 1`` computed element-wise on the input.
- *
- * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
- *
- * The storage type of ``expm1`` output depends upon the input storage type:
- *
- * - expm1(default) = default
- * - expm1(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
- * @return org.apache.mxnet.NDArray - */ -def expm1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
- * @return org.apache.mxnet.NDArray - */ -def fill_element_0index(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
- * @return org.apache.mxnet.NDArray - */ -def fill_element_0index(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise rounded value to the nearest \
- * integer towards zero of the input.
- *
- * Example::
- *
- * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
- *
- * The storage type of ``fix`` output depends upon the input storage type:
- *
- * - fix(default) = default
- * - fix(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
- * @return org.apache.mxnet.NDArray - */ -def fix(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise rounded value to the nearest \
- * integer towards zero of the input.
- *
- * Example::
- *
- * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
- *
- * The storage type of ``fix`` output depends upon the input storage type:
- *
- * - fix(default) = default
- * - fix(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
- * @return org.apache.mxnet.NDArray - */ -def fix(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @return org.apache.mxnet.NDArray - */ -def flatten(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @return org.apache.mxnet.NDArray - */ -def flatten(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @return org.apache.mxnet.NDArray - */ -def flip(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @return org.apache.mxnet.NDArray - */ -def flip(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise floor of the input.
- *
- * The floor of the scalar x is the largest integer i, such that i <= x.
- *
- * Example::
- *
- * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
- *
- * The storage type of ``floor`` output depends upon the input storage type:
- *
- * - floor(default) = default
- * - floor(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
- * @return org.apache.mxnet.NDArray - */ -def floor(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise floor of the input.
- *
- * The floor of the scalar x is the largest integer i, such that i <= x.
- *
- * Example::
- *
- * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
- *
- * The storage type of ``floor`` output depends upon the input storage type:
- *
- * - floor(default) = default
- * - floor(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
- * @return org.apache.mxnet.NDArray - */ -def floor(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * The FTML optimizer described in
- * *FTML - Follow the Moving Leader in Deep Learning*,
- * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
- * \sigma_t = d_t - \beta_1 d_{t-1}
- * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
- * W_t = - \frac{ z_t }{ d_t }
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L447
- * @return org.apache.mxnet.NDArray - */ -def ftml_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * The FTML optimizer described in
- * *FTML - Follow the Moving Leader in Deep Learning*,
- * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
- * \sigma_t = d_t - \beta_1 d_{t-1}
- * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
- * W_t = - \frac{ z_t }{ d_t }
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L447
- * @return org.apache.mxnet.NDArray - */ -def ftml_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for Ftrl optimizer.
- * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
- * http://dl.acm.org/citation.cfm?id=2488200.
- *
- * It updates the weights using::
- *
- * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
- * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
- * n += rescaled_grad**2
- * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
- *
- * If w, z and n are all of ``row_sparse`` storage type,
- * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
- *
- * for row in grad.indices:
- * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
- * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
- * n[row] += rescaled_grad[row]**2
- * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L632
- * @return org.apache.mxnet.NDArray - */ -def ftrl_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for Ftrl optimizer.
- * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
- * http://dl.acm.org/citation.cfm?id=2488200.
- *
- * It updates the weights using::
- *
- * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
- * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
- * n += rescaled_grad**2
- * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
- *
- * If w, z and n are all of ``row_sparse`` storage type,
- * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
- *
- * for row in grad.indices:
- * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
- * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
- * n[row] += rescaled_grad[row]**2
- * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L632
- * @return org.apache.mxnet.NDArray - */ -def ftrl_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the gamma function (extension of the factorial function \
- * to the reals), computed element-wise on the input array.
- *
- * The storage type of ``gamma`` output is always dense
- * @return org.apache.mxnet.NDArray - */ -def gamma(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the gamma function (extension of the factorial function \
- * to the reals), computed element-wise on the input array.
- *
- * The storage type of ``gamma`` output is always dense
- * @return org.apache.mxnet.NDArray - */ -def gamma(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise log of the absolute value of the gamma function \
- * of the input.
- *
- * The storage type of ``gammaln`` output is always dense
- * @return org.apache.mxnet.NDArray - */ -def gammaln(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise log of the absolute value of the gamma function \
- * of the input.
- *
- * The storage type of ``gammaln`` output is always dense
- * @return org.apache.mxnet.NDArray - */ -def gammaln(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Gather elements or slices from `data` and store to a tensor whose
- * shape is defined by `indices`.
- *
- * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}]
- *
- * Examples::
- *
- * data = [[0, 1], [2, 3]]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * gather_nd(data, indices) = [2, 3, 0]
- * @return org.apache.mxnet.NDArray - */ -def gather_nd(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Gather elements or slices from `data` and store to a tensor whose
- * shape is defined by `indices`.
- *
- * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}]
- *
- * Examples::
- *
- * data = [[0, 1], [2, 3]]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * gather_nd(data, indices) = [2, 3, 0]
- * @return org.apache.mxnet.NDArray - */ -def gather_nd(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes hard sigmoid of x element-wise.
- *
- * .. math::
- * y = max(0, min(1, alpha * x + beta))
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
- * @return org.apache.mxnet.NDArray - */ -def hard_sigmoid(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes hard sigmoid of x element-wise.
- *
- * .. math::
- * y = max(0, min(1, alpha * x + beta))
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
- * @return org.apache.mxnet.NDArray - */ -def hard_sigmoid(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns a copy of the input.
- *
- * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
- * @return org.apache.mxnet.NDArray - */ -def identity(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns a copy of the input.
- *
- * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
- * @return org.apache.mxnet.NDArray - */ -def identity(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the Khatri-Rao product of the input matrices.
- *
- * Given a collection of :math:`n` input matrices,
- *
- * .. math::
- * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
- *
- * the (column-wise) Khatri-Rao product is defined as the matrix,
- *
- * .. math::
- * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
- *
- * where the :math:`k` th column is equal to the column-wise outer product
- * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
- * column of the ith matrix.
- *
- * Example::
- *
- * >>> A = mx.nd.array([[1, -1],
- * >>> [2, -3]])
- * >>> B = mx.nd.array([[1, 4],
- * >>> [2, 5],
- * >>> [3, 6]])
- * >>> C = mx.nd.khatri_rao(A, B)
- * >>> print(C.asnumpy())
- * [[ 1. -4.]
- * [ 2. -5.]
- * [ 3. -6.]
- * [ 2. -12.]
- * [ 4. -15.]
- * [ 6. -18.]]
- *
- *
- *
- * Defined in src/operator/contrib/krprod.cc:L108
- * @return org.apache.mxnet.NDArray - */ -def khatri_rao(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the Khatri-Rao product of the input matrices.
- *
- * Given a collection of :math:`n` input matrices,
- *
- * .. math::
- * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
- *
- * the (column-wise) Khatri-Rao product is defined as the matrix,
- *
- * .. math::
- * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
- *
- * where the :math:`k` th column is equal to the column-wise outer product
- * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
- * column of the ith matrix.
- *
- * Example::
- *
- * >>> A = mx.nd.array([[1, -1],
- * >>> [2, -3]])
- * >>> B = mx.nd.array([[1, 4],
- * >>> [2, 5],
- * >>> [3, 6]])
- * >>> C = mx.nd.khatri_rao(A, B)
- * >>> print(C.asnumpy())
- * [[ 1. -4.]
- * [ 2. -5.]
- * [ 3. -6.]
- * [ 2. -12.]
- * [ 4. -15.]
- * [ 6. -18.]]
- *
- *
- *
- * Defined in src/operator/contrib/krprod.cc:L108
- * @return org.apache.mxnet.NDArray - */ -def khatri_rao(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * LQ factorization for general matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
- * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
- * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
- * that:
- *
- * *A* = *L* \* *Q*
- *
- * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
- * and *Q* is row-orthonormal, meaning that
- *
- * *Q* \* *Q*\ :sup:`T`
- *
- * is equal to the identity matrix of shape *(x, x)*.
- *
- * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single LQ factorization
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * Q, L = gelqf(A)
- * Q = [[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]]
- * L = [[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]]
- *
- * // Batch LQ factorization
- * A = [[[1., 2., 3.], [4., 5., 6.]],
- * [[7., 8., 9.], [10., 11., 12.]]]
- * Q, L = gelqf(A)
- * Q = [[[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]],
- * [[-0.50257071, -0.57436653, -0.64616234],
- * [0.7620735, 0.05862104, -0.64483142]]]
- * L = [[[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]],
- * [[-13.92838828, 0.],
- * [-19.09768702, 0.52758934]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L552
- * @return org.apache.mxnet.NDArray - */ -def linalg_gelqf(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * LQ factorization for general matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
- * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
- * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
- * that:
- *
- * *A* = *L* \* *Q*
- *
- * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
- * and *Q* is row-orthonormal, meaning that
- *
- * *Q* \* *Q*\ :sup:`T`
- *
- * is equal to the identity matrix of shape *(x, x)*.
- *
- * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single LQ factorization
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * Q, L = gelqf(A)
- * Q = [[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]]
- * L = [[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]]
- *
- * // Batch LQ factorization
- * A = [[[1., 2., 3.], [4., 5., 6.]],
- * [[7., 8., 9.], [10., 11., 12.]]]
- * Q, L = gelqf(A)
- * Q = [[[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]],
- * [[-0.50257071, -0.57436653, -0.64616234],
- * [0.7620735, 0.05862104, -0.64483142]]]
- * L = [[[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]],
- * [[-13.92838828, 0.],
- * [-19.09768702, 0.52758934]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L552
- * @return org.apache.mxnet.NDArray - */ -def linalg_gelqf(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs general matrix multiplication and accumulation.
- * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
- *
- * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
- * matrix transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = swapaxes(C, dim1=1, dim2=3)
- * C = gemm(A1, B1, C)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply-add
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
- * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
- *
- * // Batch matrix multiply-add
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * C = [[[10.0]], [[0.01]]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
- * = [[[104.0]], [[0.14]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L81
- * @return org.apache.mxnet.NDArray - */ -def linalg_gemm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs general matrix multiplication and accumulation.
- * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
- *
- * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
- * matrix transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = swapaxes(C, dim1=1, dim2=3)
- * C = gemm(A1, B1, C)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply-add
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
- * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
- *
- * // Batch matrix multiply-add
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * C = [[[10.0]], [[0.01]]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
- * = [[[104.0]], [[0.14]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L81
- * @return org.apache.mxnet.NDArray - */ -def linalg_gemm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs general matrix multiplication.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
- *
- * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
- * transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = gemm2(A1, B1)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
- *
- * // Batch matrix multiply
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[[4.0]], [[0.04 ]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L151
- * @return org.apache.mxnet.NDArray - */ -def linalg_gemm2(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs general matrix multiplication.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
- *
- * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
- * transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = gemm2(A1, B1)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
- *
- * // Batch matrix multiply
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[[4.0]], [[0.04 ]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L151
- * @return org.apache.mxnet.NDArray - */ -def linalg_gemm2(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs Cholesky factorization of a symmetric positive-definite matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
- * computed. *L* is lower triangular (entries of upper triangle are all zero), has
- * positive diagonal entries, and:
- *
- * *A* = *L* \* *L*\ :sup:`T`
- *
- * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix factorization
- * A = [[4.0, 1.0], [1.0, 4.25]]
- * potrf(A) = [[2.0, 0], [0.5, 2.0]]
- *
- * // Batch matrix factorization
- * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
- * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L201
- * @return org.apache.mxnet.NDArray - */ -def linalg_potrf(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs Cholesky factorization of a symmetric positive-definite matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
- * computed. *L* is lower triangular (entries of upper triangle are all zero), has
- * positive diagonal entries, and:
- *
- * *A* = *L* \* *L*\ :sup:`T`
- *
- * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix factorization
- * A = [[4.0, 1.0], [1.0, 4.25]]
- * potrf(A) = [[2.0, 0], [0.5, 2.0]]
- *
- * // Batch matrix factorization
- * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
- * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L201
- * @return org.apache.mxnet.NDArray - */ -def linalg_potrf(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs matrix inversion from a Cholesky factorization.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
- * with positive diagonal. We compute:
- *
- * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
- *
- * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
- * *B* (obtained by *potrf*), then
- *
- * *out* = *B*\ :sup:`-1`
- *
- * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
- * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
- * (*trsm*). The latter is numerically much safer, and also cheaper.
- *
- * Examples::
- *
- * // Single matrix inverse
- * A = [[2.0, 0], [0.5, 2.0]]
- * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
- *
- * // Batch matrix inverse
- * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
- * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L259
- * @return org.apache.mxnet.NDArray - */ -def linalg_potri(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs matrix inversion from a Cholesky factorization.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
- * with positive diagonal. We compute:
- *
- * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
- *
- * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
- * *B* (obtained by *potrf*), then
- *
- * *out* = *B*\ :sup:`-1`
- *
- * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
- * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
- * (*trsm*). The latter is numerically much safer, and also cheaper.
- *
- * Examples::
- *
- * // Single matrix inverse
- * A = [[2.0, 0], [0.5, 2.0]]
- * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
- *
- * // Batch matrix inverse
- * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
- * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L259
- * @return org.apache.mxnet.NDArray - */ -def linalg_potri(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of the logarithms of the diagonal elements of a square matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
- * logarithms of the diagonal elements, the result has shape (1,).
- *
- * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix reduction
- * A = [[1.0, 1.0], [1.0, 7.0]]
- * sumlogdiag(A) = [1.9459]
- *
- * // Batch matrix reduction
- * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
- * sumlogdiag(A) = [1.9459, 3.9318]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L428
- * @return org.apache.mxnet.NDArray - */ -def linalg_sumlogdiag(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of the logarithms of the diagonal elements of a square matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
- * logarithms of the diagonal elements, the result has shape (1,).
- *
- * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix reduction
- * A = [[1.0, 1.0], [1.0, 7.0]]
- * sumlogdiag(A) = [1.9459]
- *
- * // Batch matrix reduction
- * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
- * sumlogdiag(A) = [1.9459, 3.9318]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L428
- * @return org.apache.mxnet.NDArray - */ -def linalg_sumlogdiag(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Multiplication of matrix with its transpose.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the operator performs the BLAS3 function *syrk*:
- *
- * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
- *
- * if *transpose=False*, or
- *
- * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
- *
- * if *transpose=True*.
- *
- * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * syrk(A, alpha=1., transpose=False)
- * = [[14., 32.],
- * [32., 77.]]
- * syrk(A, alpha=1., transpose=True)
- * = [[17., 22., 27.],
- * [22., 29., 36.],
- * [27., 36., 45.]]
- *
- * // Batch matrix multiply
- * A = [[[1., 1.]], [[0.1, 0.1]]]
- * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L484
- * @return org.apache.mxnet.NDArray - */ -def linalg_syrk(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Multiplication of matrix with its transpose.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the operator performs the BLAS3 function *syrk*:
- *
- * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
- *
- * if *transpose=False*, or
- *
- * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
- *
- * if *transpose=True*.
- *
- * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * syrk(A, alpha=1., transpose=False)
- * = [[14., 32.],
- * [32., 77.]]
- * syrk(A, alpha=1., transpose=True)
- * = [[17., 22., 27.],
- * [22., 29., 36.],
- * [27., 36., 45.]]
- *
- * // Batch matrix multiply
- * A = [[[1., 1.]], [[0.1, 0.1]]]
- * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L484
- * @return org.apache.mxnet.NDArray - */ -def linalg_syrk(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs multiplication with a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trmm*:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* = *alpha* \* *B* \* *op*\ (*A*)
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- *
- * Examples::
- *
- * // Single triangular matrix multiply
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- *
- * // Batch triangular matrix multiply
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
- * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L316
- * @return org.apache.mxnet.NDArray - */ -def linalg_trmm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Performs multiplication with a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trmm*:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* = *alpha* \* *B* \* *op*\ (*A*)
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- *
- * Examples::
- *
- * // Single triangular matrix multiply
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- *
- * // Batch triangular matrix multiply
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
- * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L316
- * @return org.apache.mxnet.NDArray - */ -def linalg_trmm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Solves matrix equation involving a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trsm*, solving for *out* in:
- *
- * *op*\ (*A*) \* *out* = *alpha* \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* \* *op*\ (*A*) = *alpha* \* *B*
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix solve
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- *
- * // Batch matrix solve
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
- * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
- * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L379
- * @return org.apache.mxnet.NDArray - */ -def linalg_trsm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Solves matrix equation involving a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trsm*, solving for *out* in:
- *
- * *op*\ (*A*) \* *out* = *alpha* \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* \* *op*\ (*A*) = *alpha* \* *B*
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix solve
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- *
- * // Batch matrix solve
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
- * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
- * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L379
- * @return org.apache.mxnet.NDArray - */ -def linalg_trsm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise Natural logarithmic value of the input.
- *
- * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
- *
- * The storage type of ``log`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
- * @return org.apache.mxnet.NDArray - */ -def log(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise Natural logarithmic value of the input.
- *
- * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
- *
- * The storage type of ``log`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
- * @return org.apache.mxnet.NDArray - */ -def log(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise Base-10 logarithmic value of the input.
- *
- * ``10**log10(x) = x``
- *
- * The storage type of ``log10`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
- * @return org.apache.mxnet.NDArray - */ -def log10(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise Base-10 logarithmic value of the input.
- *
- * ``10**log10(x) = x``
- *
- * The storage type of ``log10`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
- * @return org.apache.mxnet.NDArray - */ -def log10(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise ``log(1 + x)`` value of the input.
- *
- * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
- * :math:`1+x\approx 1`
- *
- * The storage type of ``log1p`` output depends upon the input storage type:
- *
- * - log1p(default) = default
- * - log1p(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
- * @return org.apache.mxnet.NDArray - */ -def log1p(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise ``log(1 + x)`` value of the input.
- *
- * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
- * :math:`1+x\approx 1`
- *
- * The storage type of ``log1p`` output depends upon the input storage type:
- *
- * - log1p(default) = default
- * - log1p(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
- * @return org.apache.mxnet.NDArray - */ -def log1p(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise Base-2 logarithmic value of the input.
- *
- * ``2**log2(x) = x``
- *
- * The storage type of ``log2`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
- * @return org.apache.mxnet.NDArray - */ -def log2(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise Base-2 logarithmic value of the input.
- *
- * ``2**log2(x) = x``
- *
- * The storage type of ``log2`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
- * @return org.apache.mxnet.NDArray - */ -def log2(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the log softmax of the input.
- * This is equivalent to computing softmax followed by log.
- *
- * Examples::
- *
- * >>> x = mx.nd.array([1, 2, .1])
- * >>> mx.nd.log_softmax(x).asnumpy()
- * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
- *
- * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
- * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
- * array([[-0.34115392, -0.69314718, -1.24115396],
- * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
- * @return org.apache.mxnet.NDArray - */ -def log_softmax(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the log softmax of the input.
- * This is equivalent to computing softmax followed by log.
- *
- * Examples::
- *
- * >>> x = mx.nd.array([1, 2, .1])
- * >>> mx.nd.log_softmax(x).asnumpy()
- * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
- *
- * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
- * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
- * array([[-0.34115392, -0.69314718, -1.24115396],
- * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
- * @return org.apache.mxnet.NDArray - */ -def log_softmax(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of logical NOT (!) function
- *
- * Example:
- * logical_not([-2., 0., 1.]) = [0., 1., 0.]
- * @return org.apache.mxnet.NDArray - */ -def logical_not(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the result of logical NOT (!) function
- *
- * Example:
- * logical_not([-2., 0., 1.]) = [0., 1., 0.]
- * @return org.apache.mxnet.NDArray - */ -def logical_not(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = make_loss(cross_entropy)
- *
- * We will need to use ``make_loss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * The storage type of ``make_loss`` output depends upon the input storage type:
- *
- * - make_loss(default) = default
- * - make_loss(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
- * @return org.apache.mxnet.NDArray - */ -def make_loss(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = make_loss(cross_entropy)
- *
- * We will need to use ``make_loss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * The storage type of ``make_loss`` output depends upon the input storage type:
- *
- * - make_loss(default) = default
- * - make_loss(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
- * @return org.apache.mxnet.NDArray - */ -def make_loss(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @return org.apache.mxnet.NDArray - */ -def max(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @return org.apache.mxnet.NDArray - */ -def max(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @return org.apache.mxnet.NDArray - */ -def max_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @return org.apache.mxnet.NDArray - */ -def max_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the mean of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
- * @return org.apache.mxnet.NDArray - */ -def mean(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the mean of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
- * @return org.apache.mxnet.NDArray - */ -def mean(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @return org.apache.mxnet.NDArray - */ -def min(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @return org.apache.mxnet.NDArray - */ -def min(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @return org.apache.mxnet.NDArray - */ -def min_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @return org.apache.mxnet.NDArray - */ -def min_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Updater function for multi-precision sgd optimizer
- * @return org.apache.mxnet.NDArray - */ -def mp_sgd_mom_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Updater function for multi-precision sgd optimizer
- * @return org.apache.mxnet.NDArray - */ -def mp_sgd_mom_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Updater function for multi-precision sgd optimizer
- * @return org.apache.mxnet.NDArray - */ -def mp_sgd_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Updater function for multi-precision sgd optimizer
- * @return org.apache.mxnet.NDArray - */ -def mp_sgd_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
- * @return org.apache.mxnet.NDArray - */ -def nanprod(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
- * @return org.apache.mxnet.NDArray - */ -def nanprod(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
- * @return org.apache.mxnet.NDArray - */ -def nansum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
- * @return org.apache.mxnet.NDArray - */ -def nansum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Numerical negative of the argument, element-wise.
- *
- * The storage type of ``negative`` output depends upon the input storage type:
- *
- * - negative(default) = default
- * - negative(row_sparse) = row_sparse
- * - negative(csr) = csr
- * @return org.apache.mxnet.NDArray - */ -def negative(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Numerical negative of the argument, element-wise.
- *
- * The storage type of ``negative`` output depends upon the input storage type:
- *
- * - negative(default) = default
- * - negative(row_sparse) = row_sparse
- * - negative(csr) = csr
- * @return org.apache.mxnet.NDArray - */ -def negative(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the norm on an NDArray.
- *
- * This operator computes the norm on an NDArray with the specified axis, depending
- * on the value of the ord parameter. By default, it computes the L2 norm on the entire
- * array.
- *
- * Examples::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * norm(x) = [5.47722578]
- *
- * rsp = x.cast_storage('row_sparse')
- *
- * norm(rsp) = [5.47722578]
- *
- * csr = x.cast_storage('csr')
- *
- * norm(csr) = [5.47722578]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
- * @return org.apache.mxnet.NDArray - */ -def norm(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the norm on an NDArray.
- *
- * This operator computes the norm on an NDArray with the specified axis, depending
- * on the value of the ord parameter. By default, it computes the L2 norm on the entire
- * array.
- *
- * Examples::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * norm(x) = [5.47722578]
- *
- * rsp = x.cast_storage('row_sparse')
- *
- * norm(rsp) = [5.47722578]
- *
- * csr = x.cast_storage('csr')
- *
- * norm(csr) = [5.47722578]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
- * @return org.apache.mxnet.NDArray - */ -def norm(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @return org.apache.mxnet.NDArray - */ -def normal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @return org.apache.mxnet.NDArray - */ -def normal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns a one-hot array.
- *
- * The locations represented by `indices` take value `on_value`, while all
- * other locations take value `off_value`.
- *
- * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
- * in an output array of shape ``(i0, i1, d)`` with::
- *
- * output[i,j,:] = off_value
- * output[i,j,indices[i,j]] = on_value
- *
- * Examples::
- *
- * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
- * [ 1. 0. 0.]
- * [ 0. 0. 1.]
- * [ 1. 0. 0.]]
- *
- * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
- * dtype='int32') = [[1 8 1]
- * [8 1 1]
- * [1 1 8]
- * [8 1 1]]
- *
- * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 0. 1.]
- * [ 1. 0. 0.]]]
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L490
- * @return org.apache.mxnet.NDArray - */ -def one_hot(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns a one-hot array.
- *
- * The locations represented by `indices` take value `on_value`, while all
- * other locations take value `off_value`.
- *
- * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
- * in an output array of shape ``(i0, i1, d)`` with::
- *
- * output[i,j,:] = off_value
- * output[i,j,indices[i,j]] = on_value
- *
- * Examples::
- *
- * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
- * [ 1. 0. 0.]
- * [ 0. 0. 1.]
- * [ 1. 0. 0.]]
- *
- * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
- * dtype='int32') = [[1 8 1]
- * [8 1 1]
- * [1 1 8]
- * [8 1 1]]
- *
- * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 0. 1.]
- * [ 1. 0. 0.]]]
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L490
- * @return org.apache.mxnet.NDArray - */ -def one_hot(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return an array of ones with the same shape and type
- * as the input array.
- *
- * Examples::
- *
- * x = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * ones_like(x) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- * @return org.apache.mxnet.NDArray - */ -def ones_like(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return an array of ones with the same shape and type
- * as the input array.
- *
- * Examples::
- *
- * x = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * ones_like(x) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- * @return org.apache.mxnet.NDArray - */ -def ones_like(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @return org.apache.mxnet.NDArray - */ -def pad(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @return org.apache.mxnet.NDArray - */ -def pad(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Picks elements from an input array according to the input indices along the given axis.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last element along an axis (the `clip` mode).
- *
- * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // picks elements with specified indices along axis 0
- * pick(x, y=[0,1], 0) = [ 1., 4.]
- *
- * // picks elements with specified indices along axis 1
- * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
- *
- * y = [[ 1.],
- * [ 0.],
- * [ 2.]]
- *
- * // picks elements with specified indices along axis 1 and dims are maintained
- * pick(x,y, 1, keepdims=True) = [[ 2.],
- * [ 3.],
- * [ 6.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
- * @return org.apache.mxnet.NDArray - */ -def pick(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Picks elements from an input array according to the input indices along the given axis.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last element along an axis (the `clip` mode).
- *
- * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // picks elements with specified indices along axis 0
- * pick(x, y=[0,1], 0) = [ 1., 4.]
- *
- * // picks elements with specified indices along axis 1
- * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
- *
- * y = [[ 1.],
- * [ 0.],
- * [ 2.]]
- *
- * // picks elements with specified indices along axis 1 and dims are maintained
- * pick(x,y, 1, keepdims=True) = [[ 2.],
- * [ 3.],
- * [ 6.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
- * @return org.apache.mxnet.NDArray - */ -def pick(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the product of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
- * @return org.apache.mxnet.NDArray - */ -def prod(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the product of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
- * @return org.apache.mxnet.NDArray - */ -def prod(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts each element of the input array from degrees to radians.
- *
- * .. math::
- * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
- *
- * The storage type of ``radians`` output depends upon the input storage type:
- *
- * - radians(default) = default
- * - radians(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
- * @return org.apache.mxnet.NDArray - */ -def radians(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts each element of the input array from degrees to radians.
- *
- * .. math::
- * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
- *
- * The storage type of ``radians`` output depends upon the input storage type:
- *
- * - radians(default) = default
- * - radians(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
- * @return org.apache.mxnet.NDArray - */ -def radians(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from an exponential distribution.
- *
- * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
- *
- * Example::
- *
- * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
- * [ 0.04146638, 0.31715935]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L115
- * @return org.apache.mxnet.NDArray - */ -def random_exponential(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from an exponential distribution.
- *
- * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
- *
- * Example::
- *
- * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
- * [ 0.04146638, 0.31715935]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L115
- * @return org.apache.mxnet.NDArray - */ -def random_exponential(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a gamma distribution.
- *
- * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
- *
- * Example::
- *
- * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
- * [ 3.91697288, 3.65933681]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L100
- * @return org.apache.mxnet.NDArray - */ -def random_gamma(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a gamma distribution.
- *
- * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
- *
- * Example::
- *
- * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
- * [ 3.91697288, 3.65933681]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L100
- * @return org.apache.mxnet.NDArray - */ -def random_gamma(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a generalized negative binomial distribution.
- *
- * Samples are distributed according to a generalized negative binomial distribution parametrized by
- * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
- * number of unsuccessful experiments (generalized to real numbers).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
- * [ 6., 4.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L168
- * @return org.apache.mxnet.NDArray - */ -def random_generalized_negative_binomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a generalized negative binomial distribution.
- *
- * Samples are distributed according to a generalized negative binomial distribution parametrized by
- * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
- * number of unsuccessful experiments (generalized to real numbers).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
- * [ 6., 4.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L168
- * @return org.apache.mxnet.NDArray - */ -def random_generalized_negative_binomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a negative binomial distribution.
- *
- * Samples are distributed according to a negative binomial distribution parametrized by
- * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
- * [ 2., 5.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L149
- * @return org.apache.mxnet.NDArray - */ -def random_negative_binomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a negative binomial distribution.
- *
- * Samples are distributed according to a negative binomial distribution parametrized by
- * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
- * [ 2., 5.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L149
- * @return org.apache.mxnet.NDArray - */ -def random_negative_binomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @return org.apache.mxnet.NDArray - */ -def random_normal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @return org.apache.mxnet.NDArray - */ -def random_normal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a Poisson distribution.
- *
- * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
- * [ 4., 6.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L132
- * @return org.apache.mxnet.NDArray - */ -def random_poisson(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a Poisson distribution.
- *
- * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
- * [ 4., 6.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L132
- * @return org.apache.mxnet.NDArray - */ -def random_poisson(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @return org.apache.mxnet.NDArray - */ -def random_uniform(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @return org.apache.mxnet.NDArray - */ -def random_uniform(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
- *
- * Examples::
- *
- * A = [[3,6,6],[4,5,1]]
- * ravel(A, shape=(7,6)) = [22,41,37]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L41
- * @return org.apache.mxnet.NDArray - */ -def ravel_multi_index(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
- *
- * Examples::
- *
- * A = [[3,6,6],[4,5,1]]
- * ravel(A, shape=(7,6)) = [22,41,37]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L41
- * @return org.apache.mxnet.NDArray - */ -def ravel_multi_index(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse cube-root value of the input.
- *
- * .. math::
- * rcbrt(x) = 1/\sqrt[3]{x}
- *
- * Example::
- *
- * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
- * @return org.apache.mxnet.NDArray - */ -def rcbrt(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse cube-root value of the input.
- *
- * .. math::
- * rcbrt(x) = 1/\sqrt[3]{x}
- *
- * Example::
- *
- * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
- * @return org.apache.mxnet.NDArray - */ -def rcbrt(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the reciprocal of the argument, element-wise.
- *
- * Calculates 1/x.
- *
- * Example::
- *
- * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
- * @return org.apache.mxnet.NDArray - */ -def reciprocal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the reciprocal of the argument, element-wise.
- *
- * Calculates 1/x.
- *
- * Example::
- *
- * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
- * @return org.apache.mxnet.NDArray - */ -def reciprocal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes rectified linear.
- *
- * .. math::
- * max(features, 0)
- *
- * The storage type of ``relu`` output depends upon the input storage type:
- *
- * - relu(default) = default
- * - relu(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
- * @return org.apache.mxnet.NDArray - */ -def relu(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes rectified linear.
- *
- * .. math::
- * max(features, 0)
- *
- * The storage type of ``relu`` output depends upon the input storage type:
- *
- * - relu(default) = default
- * - relu(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
- * @return org.apache.mxnet.NDArray - */ -def relu(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Repeats elements of an array.
- *
- * By default, ``repeat`` flattens the input array into 1-D and then repeats the
- * elements::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
- *
- * The parameter ``axis`` specifies the axis along which to perform repeat::
- *
- * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
- * [ 1., 2.],
- * [ 3., 4.],
- * [ 3., 4.]]
- *
- * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L690
- * @return org.apache.mxnet.NDArray - */ -def repeat(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Repeats elements of an array.
- *
- * By default, ``repeat`` flattens the input array into 1-D and then repeats the
- * elements::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
- *
- * The parameter ``axis`` specifies the axis along which to perform repeat::
- *
- * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
- * [ 1., 2.],
- * [ 3., 4.],
- * [ 3., 4.]]
- *
- * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L690
- * @return org.apache.mxnet.NDArray - */ -def repeat(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @return org.apache.mxnet.NDArray - */ -def reshape(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @return org.apache.mxnet.NDArray - */ -def reshape(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reshape lhs to have the same shape as rhs.
- * @return org.apache.mxnet.NDArray - */ -def reshape_like(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reshape lhs to have the same shape as rhs.
- * @return org.apache.mxnet.NDArray - */ -def reshape_like(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @return org.apache.mxnet.NDArray - */ -def reverse(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @return org.apache.mxnet.NDArray - */ -def reverse(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * .. note::
- * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
- * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
- *
- * Example::
- *
- * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
- *
- * The storage type of ``rint`` output depends upon the input storage type:
- *
- * - rint(default) = default
- * - rint(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
- * @return org.apache.mxnet.NDArray - */ -def rint(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * .. note::
- * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
- * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
- *
- * Example::
- *
- * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
- *
- * The storage type of ``rint`` output depends upon the input storage type:
- *
- * - rint(default) = default
- * - rint(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
- * @return org.apache.mxnet.NDArray - */ -def rint(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for `RMSProp` optimizer.
- *
- * `RMSprop` is a variant of stochastic gradient descent where the gradients are
- * divided by a cache which grows with the sum of squares of recent gradients?
- *
- * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
- * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
- * each parameter monotonically over the course of training.
- * While this is analytically motivated for convex optimizations, it may not be ideal
- * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
- * learning rates to rebound as the denominator decays over time.
- *
- * Define the Root Mean Square (RMS) error criterion of the gradient as
- * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
- * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
- *
- * The :math:`E[g^2]_t` is given by:
- *
- * .. math::
- * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
- *
- * The RMSProp code follows the version in
- * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
- * Tieleman & Hinton, 2012.
- *
- * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
- * :math:`\eta` to be 0.001.
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L553
- * @return org.apache.mxnet.NDArray - */ -def rmsprop_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for `RMSProp` optimizer.
- *
- * `RMSprop` is a variant of stochastic gradient descent where the gradients are
- * divided by a cache which grows with the sum of squares of recent gradients?
- *
- * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
- * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
- * each parameter monotonically over the course of training.
- * While this is analytically motivated for convex optimizations, it may not be ideal
- * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
- * learning rates to rebound as the denominator decays over time.
- *
- * Define the Root Mean Square (RMS) error criterion of the gradient as
- * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
- * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
- *
- * The :math:`E[g^2]_t` is given by:
- *
- * .. math::
- * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
- *
- * The RMSProp code follows the version in
- * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
- * Tieleman & Hinton, 2012.
- *
- * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
- * :math:`\eta` to be 0.001.
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L553
- * @return org.apache.mxnet.NDArray - */ -def rmsprop_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for RMSPropAlex optimizer.
- *
- * `RMSPropAlex` is non-centered version of `RMSProp`.
- *
- * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
- * :math:`E[g]_t` is the decaying average over past gradient.
- *
- * .. math::
- * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
- * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
- * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t + \Delta_t
- *
- * The RMSPropAlex code follows the version in
- * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
- *
- * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
- * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L592
- * @return org.apache.mxnet.NDArray - */ -def rmspropalex_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for RMSPropAlex optimizer.
- *
- * `RMSPropAlex` is non-centered version of `RMSProp`.
- *
- * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
- * :math:`E[g]_t` is the decaying average over past gradient.
- *
- * .. math::
- * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
- * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
- * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t + \Delta_t
- *
- * The RMSPropAlex code follows the version in
- * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
- *
- * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
- * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L592
- * @return org.apache.mxnet.NDArray - */ -def rmspropalex_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * Example::
- *
- * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
- *
- * The storage type of ``round`` output depends upon the input storage type:
- *
- * - round(default) = default
- * - round(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
- * @return org.apache.mxnet.NDArray - */ -def round(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * Example::
- *
- * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
- *
- * The storage type of ``round`` output depends upon the input storage type:
- *
- * - round(default) = default
- * - round(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
- * @return org.apache.mxnet.NDArray - */ -def round(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse square-root value of the input.
- *
- * .. math::
- * rsqrt(x) = 1/\sqrt{x}
- *
- * Example::
- *
- * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
- *
- * The storage type of ``rsqrt`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
- * @return org.apache.mxnet.NDArray - */ -def rsqrt(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise inverse square-root value of the input.
- *
- * .. math::
- * rsqrt(x) = 1/\sqrt{x}
- *
- * Example::
- *
- * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
- *
- * The storage type of ``rsqrt`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
- * @return org.apache.mxnet.NDArray - */ -def rsqrt(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * exponential distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_exponential(lam) = [ 0.51837951, 0.09994757]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
- * [ 0.09994757, 0.50447971]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L284
- * @return org.apache.mxnet.NDArray - */ -def sample_exponential(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * exponential distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_exponential(lam) = [ 0.51837951, 0.09994757]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
- * [ 0.09994757, 0.50447971]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L284
- * @return org.apache.mxnet.NDArray - */ -def sample_exponential(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * alpha = [ 0.0, 2.5 ]
- * beta = [ 1.0, 0.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
- * [ 2.25797319, 1.70734084]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L282
- * @return org.apache.mxnet.NDArray - */ -def sample_gamma(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * alpha = [ 0.0, 2.5 ]
- * beta = [ 1.0, 0.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
- * [ 2.25797319, 1.70734084]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L282
- * @return org.apache.mxnet.NDArray - */ -def sample_gamma(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * mu = [ 2.0, 2.5 ]
- * alpha = [ 1.0, 0.1 ]
- *
- * // Draw a single sample for each distribution
- * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
- * [ 3., 1.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L293
- * @return org.apache.mxnet.NDArray - */ -def sample_generalized_negative_binomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * mu = [ 2.0, 2.5 ]
- * alpha = [ 1.0, 0.1 ]
- *
- * // Draw a single sample for each distribution
- * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
- * [ 3., 1.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L293
- * @return org.apache.mxnet.NDArray - */ -def sample_generalized_negative_binomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple multinomial distributions.
- *
- * *data* is an *n* dimensional array whose last dimension has length *k*, where
- * *k* is the number of possible outcomes of each multinomial distribution. This
- * operator will draw *shape* samples from each distribution. If shape is empty
- * one sample will be drawn from each distribution.
- *
- * If *get_prob* is true, a second array containing log likelihood of the drawn
- * samples will also be returned. This is usually used for reinforcement learning
- * where you can provide reward as head gradient for this array to estimate
- * gradient.
- *
- * Note that the input distribution must be normalized, i.e. *data* must sum to
- * 1 along its last axis.
- *
- * Examples::
- *
- * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
- *
- * // Draw a single sample for each distribution
- * sample_multinomial(probs) = [3, 0]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_multinomial(probs, shape=(2)) = [[4, 2],
- * [0, 0]]
- *
- * // requests log likelihood
- * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
- * @return org.apache.mxnet.NDArray - */ -def sample_multinomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple multinomial distributions.
- *
- * *data* is an *n* dimensional array whose last dimension has length *k*, where
- * *k* is the number of possible outcomes of each multinomial distribution. This
- * operator will draw *shape* samples from each distribution. If shape is empty
- * one sample will be drawn from each distribution.
- *
- * If *get_prob* is true, a second array containing log likelihood of the drawn
- * samples will also be returned. This is usually used for reinforcement learning
- * where you can provide reward as head gradient for this array to estimate
- * gradient.
- *
- * Note that the input distribution must be normalized, i.e. *data* must sum to
- * 1 along its last axis.
- *
- * Examples::
- *
- * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
- *
- * // Draw a single sample for each distribution
- * sample_multinomial(probs) = [3, 0]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_multinomial(probs, shape=(2)) = [[4, 2],
- * [0, 0]]
- *
- * // requests log likelihood
- * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
- * @return org.apache.mxnet.NDArray - */ -def sample_multinomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * k = [ 20, 49 ]
- * p = [ 0.4 , 0.77 ]
- *
- * // Draw a single sample for each distribution
- * sample_negative_binomial(k, p) = [ 15., 16.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
- * [ 16., 12.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L289
- * @return org.apache.mxnet.NDArray - */ -def sample_negative_binomial(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * k = [ 20, 49 ]
- * p = [ 0.4 , 0.77 ]
- *
- * // Draw a single sample for each distribution
- * sample_negative_binomial(k, p) = [ 15., 16.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
- * [ 16., 12.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L289
- * @return org.apache.mxnet.NDArray - */ -def sample_negative_binomial(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * mu = [ 0.0, 2.5 ]
- * sigma = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
- * [ 0.95934606, 4.48287058]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L279
- * @return org.apache.mxnet.NDArray - */ -def sample_normal(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * mu = [ 0.0, 2.5 ]
- * sigma = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
- * [ 0.95934606, 4.48287058]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L279
- * @return org.apache.mxnet.NDArray - */ -def sample_normal(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * Poisson distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_poisson(lam) = [ 0., 13.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
- * [ 13., 8.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L286
- * @return org.apache.mxnet.NDArray - */ -def sample_poisson(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * Poisson distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_poisson(lam) = [ 0., 13.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
- * [ 13., 8.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L286
- * @return org.apache.mxnet.NDArray - */ -def sample_poisson(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * uniform distributions on the intervals given by *[low,high)*.
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * low = [ 0.0, 2.5 ]
- * high = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
- * [ 3.18687344, 3.68352246]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L277
- * @return org.apache.mxnet.NDArray - */ -def sample_uniform(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Concurrent sampling from multiple
- * uniform distributions on the intervals given by *[low,high)*.
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * low = [ 0.0, 2.5 ]
- * high = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
- * [ 3.18687344, 3.68352246]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L277
- * @return org.apache.mxnet.NDArray - */ -def sample_uniform(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Scatters data into a new tensor according to indices.
- *
- * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
- *
- * all other entries in output are 0.
- *
- * .. warning::
- *
- * If the indices have duplicates, the result will be non-deterministic and
- * the gradient of `scatter_nd` will not be correct!!
- *
- *
- * Examples::
- *
- * data = [2, 3, 0]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * shape = (2, 2)
- * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
- * @return org.apache.mxnet.NDArray - */ -def scatter_nd(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Scatters data into a new tensor according to indices.
- *
- * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
- *
- * all other entries in output are 0.
- *
- * .. warning::
- *
- * If the indices have duplicates, the result will be non-deterministic and
- * the gradient of `scatter_nd` will not be correct!!
- *
- *
- * Examples::
- *
- * data = [2, 3, 0]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * shape = (2, 2)
- * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
- * @return org.apache.mxnet.NDArray - */ -def scatter_nd(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
- *
- * Momentum update has better convergence rates on neural networks. Mathematically it looks
- * like below:
- *
- * .. math::
- *
- * v_1 = \alpha * \nabla J(W_0)\\
- * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
- * W_t = W_{t-1} + v_t
- *
- * It updates the weights using::
- *
- * v = momentum * v - learning_rate * gradient
- * weight += v
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
- * type is the same as momentum's storage type,
- * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
- *
- * for row in gradient.indices:
- * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
- * weight[row] += v[row]
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L372
- * @return org.apache.mxnet.NDArray - */ -def sgd_mom_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
- *
- * Momentum update has better convergence rates on neural networks. Mathematically it looks
- * like below:
- *
- * .. math::
- *
- * v_1 = \alpha * \nabla J(W_0)\\
- * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
- * W_t = W_{t-1} + v_t
- *
- * It updates the weights using::
- *
- * v = momentum * v - learning_rate * gradient
- * weight += v
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
- * type is the same as momentum's storage type,
- * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
- *
- * for row in gradient.indices:
- * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
- * weight[row] += v[row]
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L372
- * @return org.apache.mxnet.NDArray - */ -def sgd_mom_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for Stochastic Gradient Descent (SDG) optimizer.
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * (gradient + wd * weight)
- *
- * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
- * only the row slices whose indices appear in grad.indices are updated::
- *
- * for row in gradient.indices:
- * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L331
- * @return org.apache.mxnet.NDArray - */ -def sgd_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for Stochastic Gradient Descent (SDG) optimizer.
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * (gradient + wd * weight)
- *
- * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
- * only the row slices whose indices appear in grad.indices are updated::
- *
- * for row in gradient.indices:
- * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L331
- * @return org.apache.mxnet.NDArray - */ -def sgd_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Randomly shuffle the elements.
- *
- * This shuffles the array along the first axis.
- * The order of the elements in each subarray does not change.
- * For example, if a 2D array is given, the order of the rows randomly changes,
- * but the order of the elements in each row does not change.
- * @return org.apache.mxnet.NDArray - */ -def shuffle(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Randomly shuffle the elements.
- *
- * This shuffles the array along the first axis.
- * The order of the elements in each subarray does not change.
- * For example, if a 2D array is given, the order of the rows randomly changes,
- * but the order of the elements in each row does not change.
- * @return org.apache.mxnet.NDArray - */ -def shuffle(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes sigmoid of x element-wise.
- *
- * .. math::
- * y = 1 / (1 + exp(-x))
- *
- * The storage type of ``sigmoid`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
- * @return org.apache.mxnet.NDArray - */ -def sigmoid(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes sigmoid of x element-wise.
- *
- * .. math::
- * y = 1 / (1 + exp(-x))
- *
- * The storage type of ``sigmoid`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
- * @return org.apache.mxnet.NDArray - */ -def sigmoid(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise sign of the input.
- *
- * Example::
- *
- * sign([-2, 0, 3]) = [-1, 0, 1]
- *
- * The storage type of ``sign`` output depends upon the input storage type:
- *
- * - sign(default) = default
- * - sign(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
- * @return org.apache.mxnet.NDArray - */ -def sign(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise sign of the input.
- *
- * Example::
- *
- * sign([-2, 0, 3]) = [-1, 0, 1]
- *
- * The storage type of ``sign`` output depends upon the input storage type:
- *
- * - sign(default) = default
- * - sign(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
- * @return org.apache.mxnet.NDArray - */ -def sign(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for SignSGD optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * sign(gradient)
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L57
- * @return org.apache.mxnet.NDArray - */ -def signsgd_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Update function for SignSGD optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * sign(gradient)
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L57
- * @return org.apache.mxnet.NDArray - */ -def signsgd_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * SIGN momentUM (Signum) optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
- * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
- *
- * It updates the weights using::
- * state = momentum * state + (1-momentum) * gradient
- * weight = weight - learning_rate * sign(state)
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L86
- * @return org.apache.mxnet.NDArray - */ -def signum_update(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * SIGN momentUM (Signum) optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
- * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
- *
- * It updates the weights using::
- * state = momentum * state + (1-momentum) * gradient
- * weight = weight - learning_rate * sign(state)
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L86
- * @return org.apache.mxnet.NDArray - */ -def signum_update(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the element-wise sine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
- *
- * The storage type of ``sin`` output depends upon the input storage type:
- *
- * - sin(default) = default
- * - sin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
- * @return org.apache.mxnet.NDArray - */ -def sin(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the element-wise sine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
- *
- * The storage type of ``sin`` output depends upon the input storage type:
- *
- * - sin(default) = default
- * - sin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
- * @return org.apache.mxnet.NDArray - */ -def sin(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hyperbolic sine of the input array, computed element-wise.
- *
- * .. math::
- * sinh(x) = 0.5\times(exp(x) - exp(-x))
- *
- * The storage type of ``sinh`` output depends upon the input storage type:
- *
- * - sinh(default) = default
- * - sinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
- * @return org.apache.mxnet.NDArray - */ -def sinh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hyperbolic sine of the input array, computed element-wise.
- *
- * .. math::
- * sinh(x) = 0.5\times(exp(x) - exp(-x))
- *
- * The storage type of ``sinh`` output depends upon the input storage type:
- *
- * - sinh(default) = default
- * - sinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
- * @return org.apache.mxnet.NDArray - */ -def sinh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @return org.apache.mxnet.NDArray - */ -def slice(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @return org.apache.mxnet.NDArray - */ -def slice(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices along a given axis.
- *
- * Returns an array slice along a given `axis` starting from the `begin` index
- * to the `end` index.
- *
- * Examples::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
- * [ 5., 6.],
- * [ 9., 10.]]
- *
- * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
- * [ 6., 7.],
- * [ 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L499
- * @return org.apache.mxnet.NDArray - */ -def slice_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices along a given axis.
- *
- * Returns an array slice along a given `axis` starting from the `begin` index
- * to the `end` index.
- *
- * Examples::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
- * [ 5., 6.],
- * [ 9., 10.]]
- *
- * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
- * [ 6., 7.],
- * [ 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L499
- * @return org.apache.mxnet.NDArray - */ -def slice_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices a region of the array like the shape of another array.
- *
- * This function is similar to ``slice``, however, the `begin` are always `0`s
- * and `end` of specific axes are inferred from the second input `shape_like`.
- *
- * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
- * a ``slice_like`` operator with default empty `axes`, it performs the
- * following operation:
- *
- * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
- *
- * When `axes` is not empty, it is used to speficy which axes are being sliced.
- *
- * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
- * will perform the following operation:
- *
- * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
- *
- * Note that it is allowed to have first and second input with different dimensions,
- * however, you have to make sure the `axes` are specified and not exceeding the
- * dimension limits.
- *
- * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
- * ``shape=(1,2,3)``, it is not allowed to use:
- *
- * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
- * is 3.
- *
- * The following is allowed in this situation:
- *
- * `` out = slice_like(a, b, axes=(0, 2))``
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * y = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * slice_like(x, y) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
- * [ 5., 6., 7., 8.]]
- * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]
- * [ 9., 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L568
- * @return org.apache.mxnet.NDArray - */ -def slice_like(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Slices a region of the array like the shape of another array.
- *
- * This function is similar to ``slice``, however, the `begin` are always `0`s
- * and `end` of specific axes are inferred from the second input `shape_like`.
- *
- * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
- * a ``slice_like`` operator with default empty `axes`, it performs the
- * following operation:
- *
- * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
- *
- * When `axes` is not empty, it is used to speficy which axes are being sliced.
- *
- * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
- * will perform the following operation:
- *
- * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
- *
- * Note that it is allowed to have first and second input with different dimensions,
- * however, you have to make sure the `axes` are specified and not exceeding the
- * dimension limits.
- *
- * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
- * ``shape=(1,2,3)``, it is not allowed to use:
- *
- * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
- * is 3.
- *
- * The following is allowed in this situation:
- *
- * `` out = slice_like(a, b, axes=(0, 2))``
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * y = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * slice_like(x, y) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
- * [ 5., 6., 7., 8.]]
- * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]
- * [ 9., 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L568
- * @return org.apache.mxnet.NDArray - */ -def slice_like(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Calculate Smooth L1 Loss(lhs, scalar) by summing
- *
- * .. math::
- *
- * f(x) =
- * \begin{cases}
- * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
- * |x|-0.5/\sigma^2,& \text{otherwise}
- * \end{cases}
- *
- * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
- *
- * Example::
- *
- * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
- * @return org.apache.mxnet.NDArray - */ -def smooth_l1(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Calculate Smooth L1 Loss(lhs, scalar) by summing
- *
- * .. math::
- *
- * f(x) =
- * \begin{cases}
- * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
- * |x|-0.5/\sigma^2,& \text{otherwise}
- * \end{cases}
- *
- * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
- *
- * Example::
- *
- * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
- * @return org.apache.mxnet.NDArray - */ -def smooth_l1(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies the softmax function.
- *
- * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
- *
- * .. math::
- * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
- *
- * for :math:`j = 1, ..., K`
- *
- * Example::
- *
- * x = [[ 1. 1. 1.]
- * [ 1. 1. 1.]]
- *
- * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
- * [ 0.5 0.5 0.5]]
- *
- * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
- * [ 0.33333334, 0.33333334, 0.33333334]]
- *
- *
- *
- * Defined in src/operator/nn/softmax.cc:L95
- * @return org.apache.mxnet.NDArray - */ -def softmax(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Applies the softmax function.
- *
- * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
- *
- * .. math::
- * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
- *
- * for :math:`j = 1, ..., K`
- *
- * Example::
- *
- * x = [[ 1. 1. 1.]
- * [ 1. 1. 1.]]
- *
- * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
- * [ 0.5 0.5 0.5]]
- *
- * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
- * [ 0.33333334, 0.33333334, 0.33333334]]
- *
- *
- *
- * Defined in src/operator/nn/softmax.cc:L95
- * @return org.apache.mxnet.NDArray - */ -def softmax(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Calculate cross entropy of softmax output and one-hot label.
- *
- * - This operator computes the cross entropy in two steps:
- * - Applies softmax function on the input array.
- * - Computes and returns the cross entropy loss between the softmax output and the labels.
- *
- * - The softmax function and cross entropy loss is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * Example::
- *
- * x = [[1, 2, 3],
- * [11, 7, 5]]
- *
- * label = [2, 0]
- *
- * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
- * [0.97962922, 0.01794253, 0.00242826]]
- *
- * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
- *
- *
- *
- * Defined in src/operator/loss_binary_op.cc:L59
- * @return org.apache.mxnet.NDArray - */ -def softmax_cross_entropy(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Calculate cross entropy of softmax output and one-hot label.
- *
- * - This operator computes the cross entropy in two steps:
- * - Applies softmax function on the input array.
- * - Computes and returns the cross entropy loss between the softmax output and the labels.
- *
- * - The softmax function and cross entropy loss is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * Example::
- *
- * x = [[1, 2, 3],
- * [11, 7, 5]]
- *
- * label = [2, 0]
- *
- * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
- * [0.97962922, 0.01794253, 0.00242826]]
- *
- * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
- *
- *
- *
- * Defined in src/operator/loss_binary_op.cc:L59
- * @return org.apache.mxnet.NDArray - */ -def softmax_cross_entropy(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes softsign of x element-wise.
- *
- * .. math::
- * y = x / (1 + abs(x))
- *
- * The storage type of ``softsign`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
- * @return org.apache.mxnet.NDArray - */ -def softsign(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes softsign of x element-wise.
- *
- * .. math::
- * y = x / (1 + abs(x))
- *
- * The storage type of ``softsign`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
- * @return org.apache.mxnet.NDArray - */ -def softsign(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns a sorted copy of an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 1, 4],
- * [ 3, 1]]
- *
- * // sorts along the last axis
- * sort(x) = [[ 1., 4.],
- * [ 1., 3.]]
- *
- * // flattens and then sorts
- * sort(x) = [ 1., 1., 3., 4.]
- *
- * // sorts along the first axis
- * sort(x, axis=0) = [[ 1., 1.],
- * [ 3., 4.]]
- *
- * // in a descend order
- * sort(x, is_ascend=0) = [[ 4., 1.],
- * [ 3., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L126
- * @return org.apache.mxnet.NDArray - */ -def sort(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns a sorted copy of an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 1, 4],
- * [ 3, 1]]
- *
- * // sorts along the last axis
- * sort(x) = [[ 1., 4.],
- * [ 1., 3.]]
- *
- * // flattens and then sorts
- * sort(x) = [ 1., 1., 3., 4.]
- *
- * // sorts along the first axis
- * sort(x, axis=0) = [[ 1., 1.],
- * [ 3., 4.]]
- *
- * // in a descend order
- * sort(x, is_ascend=0) = [[ 4., 1.],
- * [ 3., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L126
- * @return org.apache.mxnet.NDArray - */ -def sort(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @return org.apache.mxnet.NDArray - */ -def split(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @return org.apache.mxnet.NDArray - */ -def split(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise square-root value of the input.
- *
- * .. math::
- * \textrm{sqrt}(x) = \sqrt{x}
- *
- * Example::
- *
- * sqrt([4, 9, 16]) = [2, 3, 4]
- *
- * The storage type of ``sqrt`` output depends upon the input storage type:
- *
- * - sqrt(default) = default
- * - sqrt(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
- * @return org.apache.mxnet.NDArray - */ -def sqrt(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise square-root value of the input.
- *
- * .. math::
- * \textrm{sqrt}(x) = \sqrt{x}
- *
- * Example::
- *
- * sqrt([4, 9, 16]) = [2, 3, 4]
- *
- * The storage type of ``sqrt`` output depends upon the input storage type:
- *
- * - sqrt(default) = default
- * - sqrt(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
- * @return org.apache.mxnet.NDArray - */ -def sqrt(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise squared value of the input.
- *
- * .. math::
- * square(x) = x^2
- *
- * Example::
- *
- * square([2, 3, 4]) = [4, 9, 16]
- *
- * The storage type of ``square`` output depends upon the input storage type:
- *
- * - square(default) = default
- * - square(row_sparse) = row_sparse
- * - square(csr) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
- * @return org.apache.mxnet.NDArray - */ -def square(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns element-wise squared value of the input.
- *
- * .. math::
- * square(x) = x^2
- *
- * Example::
- *
- * square([2, 3, 4]) = [4, 9, 16]
- *
- * The storage type of ``square`` output depends upon the input storage type:
- *
- * - square(default) = default
- * - square(row_sparse) = row_sparse
- * - square(csr) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
- * @return org.apache.mxnet.NDArray - */ -def square(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Remove single-dimensional entries from the shape of an array.
- * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
- * See the following note for exception.
- *
- * Examples::
- *
- * data = [[[0], [1], [2]]]
- * squeeze(data) = [0, 1, 2]
- * squeeze(data, axis=0) = [[0], [1], [2]]
- * squeeze(data, axis=2) = [[0, 1, 2]]
- * squeeze(data, axis=(0, 2)) = [0, 1, 2]
- *
- * .. Note::
- * The output of this operator will keep at least one dimension not removed. For example,
- * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
- * @return org.apache.mxnet.NDArray - */ -def squeeze(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Remove single-dimensional entries from the shape of an array.
- * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
- * See the following note for exception.
- *
- * Examples::
- *
- * data = [[[0], [1], [2]]]
- * squeeze(data) = [0, 1, 2]
- * squeeze(data, axis=0) = [[0], [1], [2]]
- * squeeze(data, axis=2) = [[0, 1, 2]]
- * squeeze(data, axis=(0, 2)) = [0, 1, 2]
- *
- * .. Note::
- * The output of this operator will keep at least one dimension not removed. For example,
- * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
- * @return org.apache.mxnet.NDArray - */ -def squeeze(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Join a sequence of arrays along a new axis.
- *
- * The axis parameter specifies the index of the new axis in the dimensions of the
- * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
- * will be the last dimension.
- *
- * Examples::
- *
- * x = [1, 2]
- * y = [3, 4]
- *
- * stack(x, y) = [[1, 2],
- * [3, 4]]
- * stack(x, y, axis=1) = [[1, 3],
- * [2, 4]]
- * @return org.apache.mxnet.NDArray - */ -def stack(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Join a sequence of arrays along a new axis.
- *
- * The axis parameter specifies the index of the new axis in the dimensions of the
- * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
- * will be the last dimension.
- *
- * Examples::
- *
- * x = [1, 2]
- * y = [3, 4]
- *
- * stack(x, y) = [[1, 2],
- * [3, 4]]
- * stack(x, y, axis=1) = [[1, 3],
- * [2, 4]]
- * @return org.apache.mxnet.NDArray - */ -def stack(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @return org.apache.mxnet.NDArray - */ -def stop_gradient(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @return org.apache.mxnet.NDArray - */ -def stop_gradient(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @return org.apache.mxnet.NDArray - */ -def sum(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @return org.apache.mxnet.NDArray - */ -def sum(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @return org.apache.mxnet.NDArray - */ -def sum_axis(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @return org.apache.mxnet.NDArray - */ -def sum_axis(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @return org.apache.mxnet.NDArray - */ -def swapaxes(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @return org.apache.mxnet.NDArray - */ -def swapaxes(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Takes elements from an input array along the given axis.
- *
- * This function slices the input array along a particular axis with the provided indices.
- *
- * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
- * will have shape ``(i0, i1, d1, d2)``, computed by::
- *
- * output[i,j,:,:] = input[indices[i,j],:,:]
- *
- * .. note::
- * - `axis`- Only slicing along axis 0 is supported for now.
- * - `mode`- Only `clip` mode is supported for now.
- *
- * Examples::
- * x = [4. 5. 6.]
- *
- * // Trivial case, take the second element along the first axis.
- * take(x, [1]) = [ 5. ]
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
- * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 3., 4.],
- * [ 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L389
- * @return org.apache.mxnet.NDArray - */ -def take(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Takes elements from an input array along the given axis.
- *
- * This function slices the input array along a particular axis with the provided indices.
- *
- * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
- * will have shape ``(i0, i1, d1, d2)``, computed by::
- *
- * output[i,j,:,:] = input[indices[i,j],:,:]
- *
- * .. note::
- * - `axis`- Only slicing along axis 0 is supported for now.
- * - `mode`- Only `clip` mode is supported for now.
- *
- * Examples::
- * x = [4. 5. 6.]
- *
- * // Trivial case, take the second element along the first axis.
- * take(x, [1]) = [ 5. ]
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
- * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 3., 4.],
- * [ 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L389
- * @return org.apache.mxnet.NDArray - */ -def take(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the element-wise tangent of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
- *
- * The storage type of ``tan`` output depends upon the input storage type:
- *
- * - tan(default) = default
- * - tan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
- * @return org.apache.mxnet.NDArray - */ -def tan(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Computes the element-wise tangent of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
- *
- * The storage type of ``tan`` output depends upon the input storage type:
- *
- * - tan(default) = default
- * - tan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
- * @return org.apache.mxnet.NDArray - */ -def tan(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hyperbolic tangent of the input array, computed element-wise.
- *
- * .. math::
- * tanh(x) = sinh(x) / cosh(x)
- *
- * The storage type of ``tanh`` output depends upon the input storage type:
- *
- * - tanh(default) = default
- * - tanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
- * @return org.apache.mxnet.NDArray - */ -def tanh(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the hyperbolic tangent of the input array, computed element-wise.
- *
- * .. math::
- * tanh(x) = sinh(x) / cosh(x)
- *
- * The storage type of ``tanh`` output depends upon the input storage type:
- *
- * - tanh(default) = default
- * - tanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
- * @return org.apache.mxnet.NDArray - */ -def tanh(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Repeats the whole array multiple times.
- *
- * If ``reps`` has length *d*, and input array has dimension of *n*. There are
- * three cases:
- *
- * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]
- *
- * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
- * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
- *
- *
- * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
- * [ 3., 4., 3., 4.]]
- *
- * - **n - * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
- *
- * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]],
- *
- * [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L751
- * @return org.apache.mxnet.NDArray - */ -def tile(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Repeats the whole array multiple times.
- *
- * If ``reps`` has length *d*, and input array has dimension of *n*. There are
- * three cases:
- *
- * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]
- *
- * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
- * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
- *
- *
- * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
- * [ 3., 4., 3., 4.]]
- *
- * - **n - * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
- *
- * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]],
- *
- * [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L751
- * @return org.apache.mxnet.NDArray - */ -def tile(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the top *k* elements in an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // returns an index of the largest element on last axis
- * topk(x) = [[ 2.],
- * [ 1.]]
- *
- * // returns the value of top-2 largest elements on last axis
- * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
- * [ 0.3, 0.2]]
- *
- * // returns the value of top-2 smallest elements on last axis
- * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
- * [ 0.1 , 0.2]]
- *
- * // returns the value of top-2 largest elements on axis 0
- * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
- * [ 0.1, 0.2, 0.2]]
- *
- * // flattens and then returns list of both values and indices
- * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L63
- * @return org.apache.mxnet.NDArray - */ -def topk(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Returns the top *k* elements in an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // returns an index of the largest element on last axis
- * topk(x) = [[ 2.],
- * [ 1.]]
- *
- * // returns the value of top-2 largest elements on last axis
- * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
- * [ 0.3, 0.2]]
- *
- * // returns the value of top-2 smallest elements on last axis
- * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
- * [ 0.1 , 0.2]]
- *
- * // returns the value of top-2 largest elements on axis 0
- * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
- * [ 0.1, 0.2, 0.2]]
- *
- * // flattens and then returns list of both values and indices
- * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L63
- * @return org.apache.mxnet.NDArray - */ -def topk(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Permutes the dimensions of an array.
- *
- * Examples::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * transpose(x) = [[ 1., 3.],
- * [ 2., 4.]]
- *
- * x = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 5., 6.],
- * [ 7., 8.]]]
- *
- * transpose(x) = [[[ 1., 5.],
- * [ 3., 7.]],
- *
- * [[ 2., 6.],
- * [ 4., 8.]]]
- *
- * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
- * [ 5., 6.]],
- *
- * [[ 3., 4.],
- * [ 7., 8.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L310
- * @return org.apache.mxnet.NDArray - */ -def transpose(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Permutes the dimensions of an array.
- *
- * Examples::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * transpose(x) = [[ 1., 3.],
- * [ 2., 4.]]
- *
- * x = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 5., 6.],
- * [ 7., 8.]]]
- *
- * transpose(x) = [[[ 1., 5.],
- * [ 3., 7.]],
- *
- * [[ 2., 6.],
- * [ 4., 8.]]]
- *
- * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
- * [ 5., 6.]],
- *
- * [[ 3., 4.],
- * [ 7., 8.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L310
- * @return org.apache.mxnet.NDArray - */ -def transpose(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return the element-wise truncated value of the input.
- *
- * The truncated value of the scalar x is the nearest integer i which is closer to
- * zero than x is. In short, the fractional part of the signed number x is discarded.
- *
- * Example::
- *
- * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
- *
- * The storage type of ``trunc`` output depends upon the input storage type:
- *
- * - trunc(default) = default
- * - trunc(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
- * @return org.apache.mxnet.NDArray - */ -def trunc(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return the element-wise truncated value of the input.
- *
- * The truncated value of the scalar x is the nearest integer i which is closer to
- * zero than x is. In short, the fractional part of the signed number x is discarded.
- *
- * Example::
- *
- * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
- *
- * The storage type of ``trunc`` output depends upon the input storage type:
- *
- * - trunc(default) = default
- * - trunc(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
- * @return org.apache.mxnet.NDArray - */ -def trunc(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @return org.apache.mxnet.NDArray - */ -def uniform(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @return org.apache.mxnet.NDArray - */ -def uniform(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
- *
- * Examples::
- *
- * A = [22,41,37]
- * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L65
- * @return org.apache.mxnet.NDArray - */ -def unravel_index(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
- *
- * Examples::
- *
- * A = [22,41,37]
- * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L65
- * @return org.apache.mxnet.NDArray - */ -def unravel_index(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return the elements, either from x or y, depending on the condition.
- *
- * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
- * depending on the elements from condition are true or false. x and y must have the same shape.
- * If condition has the same shape as x, each element in the output array is from x if the
- * corresponding element in the condition is true, and from y if false.
- *
- * If condition does not have the same shape as x, it must be a 1D array whose size is
- * the same as x's first dimension size. Each row of the output array is from x's row
- * if the corresponding element from condition is true, and from y's row if false.
- *
- * Note that all non-zero values are interpreted as ``True`` in condition.
- *
- * Examples::
- *
- * x = [[1, 2], [3, 4]]
- * y = [[5, 6], [7, 8]]
- * cond = [[0, 1], [-1, 0]]
- *
- * where(cond, x, y) = [[5, 2], [3, 8]]
- *
- * csr_cond = cast_storage(cond, 'csr')
- *
- * where(csr_cond, x, y) = [[5, 2], [3, 8]]
- *
- *
- *
- * Defined in src/operator/tensor/control_flow_op.cc:L57
- * @return org.apache.mxnet.NDArray - */ -def where(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return the elements, either from x or y, depending on the condition.
- *
- * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
- * depending on the elements from condition are true or false. x and y must have the same shape.
- * If condition has the same shape as x, each element in the output array is from x if the
- * corresponding element in the condition is true, and from y if false.
- *
- * If condition does not have the same shape as x, it must be a 1D array whose size is
- * the same as x's first dimension size. Each row of the output array is from x's row
- * if the corresponding element from condition is true, and from y's row if false.
- *
- * Note that all non-zero values are interpreted as ``True`` in condition.
- *
- * Examples::
- *
- * x = [[1, 2], [3, 4]]
- * y = [[5, 6], [7, 8]]
- * cond = [[0, 1], [-1, 0]]
- *
- * where(cond, x, y) = [[5, 2], [3, 8]]
- *
- * csr_cond = cast_storage(cond, 'csr')
- *
- * where(csr_cond, x, y) = [[5, 2], [3, 8]]
- *
- *
- *
- * Defined in src/operator/tensor/control_flow_op.cc:L57
- * @return org.apache.mxnet.NDArray - */ -def where(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return an array of zeros with the same shape, type and storage type
- * as the input array.
- *
- * The storage type of ``zeros_like`` output depends on the storage type of the input
- *
- * - zeros_like(row_sparse) = row_sparse
- * - zeros_like(csr) = csr
- * - zeros_like(default) = default
- *
- * Examples::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * zeros_like(x) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- * @return org.apache.mxnet.NDArray - */ -def zeros_like(kwargs: Map[String, Any] = null)(args: Any*) : org.apache.mxnet.NDArrayFuncReturn - /** - * Return an array of zeros with the same shape, type and storage type
- * as the input array.
- *
- * The storage type of ``zeros_like`` output depends on the storage type of the input
- *
- * - zeros_like(row_sparse) = row_sparse
- * - zeros_like(csr) = csr
- * - zeros_like(default) = default
- *
- * Examples::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * zeros_like(x) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- * @return org.apache.mxnet.NDArray - */ -def zeros_like(args: Any*) : org.apache.mxnet.NDArrayFuncReturn -} \ No newline at end of file diff --git a/scala-package/core/src/main/scala/org/apache/mxnet/SymbolAPIBase.scala b/scala-package/core/src/main/scala/org/apache/mxnet/SymbolAPIBase.scala deleted file mode 100644 index 8791b444790a..000000000000 --- a/scala-package/core/src/main/scala/org/apache/mxnet/SymbolAPIBase.scala +++ /dev/null @@ -1,6859 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// scalastyle:off -package org.apache.mxnet -import org.apache.mxnet.annotation.Experimental -abstract class SymbolAPIBase { - /** - * Applies an activation function element-wise to the input.
- *
- * The following activation functions are supported:
- *
- * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
- * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
- * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
- * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
- * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
- *
- *
- *
- * Defined in src/operator/nn/activation.cc:L161
- * @param data The input array. - * @param act_type Activation function to be applied. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Activation (data : Option[org.apache.mxnet.Symbol] = None, act_type : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Batch normalization.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
- * two outputs are blocked.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
- * axis to be the last item in the input shape.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/nn/batch_norm.cc:L575
- * @param data Input data to batch normalization - * @param gamma gamma array - * @param beta beta array - * @param moving_mean running mean of input - * @param moving_var running variance of input - * @param eps Epsilon to prevent div 0. Must be no less than CUDNN_BN_MIN_EPSILON defined in cudnn.h when using cudnn (usually 1e-5) - * @param momentum Momentum for moving average - * @param fix_gamma Fix gamma while training - * @param use_global_stats Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator. - * @param output_mean_var Output the mean and inverse std - * @param axis Specify which shape axis the channel is specified - * @param cudnn_off Do not select CUDNN operator, if available - * @return org.apache.mxnet.Symbol - */ -@Experimental -def BatchNorm (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, beta : Option[org.apache.mxnet.Symbol] = None, moving_mean : Option[org.apache.mxnet.Symbol] = None, moving_var : Option[org.apache.mxnet.Symbol] = None, eps : Option[Double] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, fix_gamma : Option[Boolean] = None, use_global_stats : Option[Boolean] = None, output_mean_var : Option[Boolean] = None, axis : Option[Int] = None, cudnn_off : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Batch normalization.
- *
- * This operator is DEPRECATED. Perform BatchNorm on the input.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_var`` as well, which are needed for the backward pass.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/batch_norm_v1.cc:L92
- * @param data Input data to batch normalization - * @param gamma gamma array - * @param beta beta array - * @param eps Epsilon to prevent div 0 - * @param momentum Momentum for moving average - * @param fix_gamma Fix gamma while training - * @param use_global_stats Whether use global moving statistics instead of local batch-norm. This will force change batch-norm into a scale shift operator. - * @param output_mean_var Output All,normal mean and var - * @return org.apache.mxnet.Symbol - */ -@Experimental -def BatchNorm_v1 (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, beta : Option[org.apache.mxnet.Symbol] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, fix_gamma : Option[Boolean] = None, use_global_stats : Option[Boolean] = None, output_mean_var : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies bilinear sampling to input feature map.
- *
- * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
- * except that the operator has the backward pass.
- *
- * Given :math:`data` and :math:`grid`, then the output is computed by
- *
- * .. math::
- * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
- * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
- * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
- *
- * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
- * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
- *
- * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
- *
- * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
- * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
- * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
- *
- * Example 1::
- *
- * ## Zoom out data two times
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * affine_matrix = array([[2, 0, 0],
- * [0, 2, 0]])
- *
- * affine_matrix = reshape(affine_matrix, shape=(1, 6))
- *
- * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
- *
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 0, 0, 0, 0],
- * [ 0, 3.5, 6.5, 0],
- * [ 0, 1.25, 2.5, 0],
- * [ 0, 0, 0, 0]]]
- *
- *
- * Example 2::
- *
- * ## shift data horizontally by -1 pixel
- *
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * warp_maxtrix = array([[[[1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1]],
- * [[0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0]]]])
- *
- * grid = GridGenerator(data=warp_matrix, transform_type='warp')
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 4, 3, 6, 0],
- * [ 8, 8, 9, 0],
- * [ 4, 1, 5, 0],
- * [ 0, 1, 3, 0]]]
- *
- *
- * Defined in src/operator/bilinear_sampler.cc:L245
- * @param data Input data to the BilinearsamplerOp. - * @param grid Input grid to the BilinearsamplerOp.grid has two channels: x_src, y_src - * @return org.apache.mxnet.Symbol - */ -@Experimental -def BilinearSampler (data : Option[org.apache.mxnet.Symbol] = None, grid : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def BlockGrad (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @param data The input. - * @param dtype Output data type. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Cast (data : Option[org.apache.mxnet.Symbol] = None, dtype : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @param data List of arrays to concatenate - * @param num_args Number of inputs to be concated. - * @param dim the dimension to be concated. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Concat (data : Array[org.apache.mxnet.Symbol], num_args : Int, dim : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Compute *N*-D convolution on *(N+2)*-D input.
- *
- * In the 2-D convolution, given input data with shape *(batch_size,
- * channel, height, width)*, the output is computed by
- *
- * .. math::
- *
- * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
- * weight[i,j,:,:]
- *
- * where :math:`\star` is the 2-D cross-correlation operator.
- *
- * For general 2-D convolution, the shapes are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*.
- *
- * Define::
- *
- * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
- *
- * then we have::
- *
- * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
- * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
- * width)*. We can choose other layouts such as *NHWC*.
- *
- * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
- * evenly into *g* parts along the channel axis, and also evenly split ``weight``
- * along the first dimension. Next compute the convolution on the *i*-th part of
- * the data with the *i*-th weight part. The output is obtained by concatenating all
- * the *g* results.
- *
- * 1-D convolution does not have *height* dimension but only *width* in space.
- *
- * - **data**: *(batch_size, channel, width)*
- * - **weight**: *(num_filter, channel, kernel[0])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * 3-D convolution adds an additional *depth* dimension besides *height* and
- * *width*. The shapes are
- *
- * - **data**: *(batch_size, channel, depth, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
- *
- * Both ``weight`` and ``bias`` are learnable parameters.
- *
- * There are other options to tune the performance.
- *
- * - **cudnn_tune**: enable this option leads to higher startup time but may give
- * faster speed. Options are
- *
- * - **off**: no tuning
- * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
- * exceed workspace limit.
- * - **fastest**: pick the fastest algorithm and ignore workspace limit.
- * - **None** (default): the behavior is determined by environment variable
- * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
- * (default), 2 for fastest.
- *
- * - **workspace**: A large number leads to more (GPU) memory usage but may improve
- * the performance.
- *
- *
- *
- * Defined in src/operator/nn/convolution.cc:L470
- * @param data Input data to the ConvolutionOp. - * @param weight Weight matrix. - * @param bias Bias parameter. - * @param kernel Convolution kernel size: (w,), (h, w) or (d, h, w) - * @param stride Convolution stride: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. - * @param dilate Convolution dilate: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. - * @param pad Zero pad for convolution: (w,), (h, w) or (d, h, w). Defaults to no padding. - * @param num_filter Convolution filter(channel) number - * @param num_group Number of group partitions. - * @param workspace Maximum temporary workspace allowed (MB) in convolution.This parameter has two usages. When CUDNN is not used, it determines the effective batch size of the convolution kernel. When CUDNN is used, it controls the maximum temporary storage used for tuning the best CUDNN kernel when `limited_workspace` strategy is used. - * @param no_bias Whether to disable bias parameter. - * @param cudnn_tune Whether to pick convolution algo by running performance test. - * @param cudnn_off Turn off cudnn for this layer. - * @param layout Set layout for input, output and weight. Empty for - default layout: NCW for 1d, NCHW for 2d and NCDHW for 3d. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Convolution (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, bias : Option[org.apache.mxnet.Symbol] = None, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * This operator is DEPRECATED. Apply convolution to input then add a bias.
- * @param data Input data to the ConvolutionV1Op. - * @param weight Weight matrix. - * @param bias Bias parameter. - * @param kernel convolution kernel size: (h, w) or (d, h, w) - * @param stride convolution stride: (h, w) or (d, h, w) - * @param dilate convolution dilate: (h, w) or (d, h, w) - * @param pad pad for convolution: (h, w) or (d, h, w) - * @param num_filter convolution filter(channel) number - * @param num_group Number of group partitions. Equivalent to slicing input into num_group - partitions, apply convolution on each, then concatenate the results - * @param workspace Maximum temporary workspace allowed for convolution (MB).This parameter determines the effective batch size of the convolution kernel, which may be smaller than the given batch size. Also, the workspace will be automatically enlarged to make sure that we can run the kernel with batch_size=1 - * @param no_bias Whether to disable bias parameter. - * @param cudnn_tune Whether to pick convolution algo by running performance test. - Leads to higher startup time but may give faster speed. Options are: - 'off': no tuning - 'limited_workspace': run test and pick the fastest algorithm that doesn't exceed workspace limit. - 'fastest': pick the fastest algorithm and ignore workspace limit. - If set to None (default), behavior is determined by environment - variable MXNET_CUDNN_AUTOTUNE_DEFAULT: 0 for off, - 1 for limited workspace (default), 2 for fastest. - * @param cudnn_off Turn off cudnn for this layer. - * @param layout Set layout for input, output and weight. Empty for - default layout: NCHW for 2d and NCDHW for 3d. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Convolution_v1 (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, bias : Option[org.apache.mxnet.Symbol] = None, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies correlation to inputs.
- *
- * The correlation layer performs multiplicative patch comparisons between two feature maps.
- *
- * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
- * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
- *
- * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
- * :math:`x_{2}` in the second map is then defined as:
- *
- * .. math::
- *
- * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
- *
- * for a square patch of size :math:`K:=2k+1`.
- *
- * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
- * data. For this reason, it has no training weights.
- *
- * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
- *
- * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
- * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
- * centered around :math:`x_{1}`.
- *
- * The final output is defined by the following expression:
- *
- * .. math::
- * out[n, q, i, j] = c(x_{i, j}, x_{q})
- *
- * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
- *
- *
- * Defined in src/operator/correlation.cc:L198
- * @param data1 Input data1 to the correlation. - * @param data2 Input data2 to the correlation. - * @param kernel_size kernel size for Correlation must be an odd number - * @param max_displacement Max displacement of Correlation - * @param stride1 stride1 quantize data1 globally - * @param stride2 stride2 quantize data2 within the neighborhood centered around data1 - * @param pad_size pad for Correlation - * @param is_multiply operation type is either multiplication or subduction - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Correlation (data1 : Option[org.apache.mxnet.Symbol] = None, data2 : Option[org.apache.mxnet.Symbol] = None, kernel_size : Option[Int] = None, max_displacement : Option[Int] = None, stride1 : Option[Int] = None, stride2 : Option[Int] = None, pad_size : Option[Int] = None, is_multiply : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - *
- *
- * .. note:: `Crop` is deprecated. Use `slice` instead.
- *
- * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
- * with width and height of the second input symbol, i.e., with one input, we need h_w to
- * specify the crop height and width, otherwise the second input symbol's size will be used
- *
- *
- * Defined in src/operator/crop.cc:L50
- * @param data Tensor or List of Tensors, the second input will be used as crop_like shape reference - * @param num_args Number of inputs for crop, if equals one, then we will use the h_wfor crop height and width, else if equals two, then we will use the heightand width of the second input symbol, we name crop_like here - * @param offset crop offset coordinate: (y, x) - * @param h_w crop height and width: (h, w) - * @param center_crop If set to true, then it will use be the center_crop,or it will crop using the shape of crop_like - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Crop (data : Array[org.apache.mxnet.Symbol], num_args : Int, offset : Option[org.apache.mxnet.Shape] = None, h_w : Option[org.apache.mxnet.Shape] = None, center_crop : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Apply a custom operator implemented in a frontend language (like Python).
- *
- * Custom operators should override required methods like `forward` and `backward`.
- * The custom operator must be registered before it can be used.
- * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
- *
- *
- *
- * Defined in src/operator/custom/custom.cc:L547
- * @param data Input data for the custom operator. - * @param op_type Name of the custom operator. This is the name that is passed to `mx.operator.register` to register the operator. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Custom (data : Array[org.apache.mxnet.Symbol], op_type : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
- * @param data Input tensor to the deconvolution operation. - * @param weight Weights representing the kernel. - * @param bias Bias added to the result after the deconvolution operation. - * @param kernel Deconvolution kernel size: (w,), (h, w) or (d, h, w). This is same as the kernel size used for the corresponding convolution - * @param stride The stride used for the corresponding convolution: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. - * @param dilate Dilation factor for each dimension of the input: (w,), (h, w) or (d, h, w). Defaults to 1 for each dimension. - * @param pad The amount of implicit zero padding added during convolution for each dimension of the input: (w,), (h, w) or (d, h, w). ``(kernel-1)/2`` is usually a good choice. If `target_shape` is set, `pad` will be ignored and a padding that will generate the target shape will be used. Defaults to no padding. - * @param adj Adjustment for output shape: (w,), (h, w) or (d, h, w). If `target_shape` is set, `adj` will be ignored and computed accordingly. - * @param target_shape Shape of the output tensor: (w,), (h, w) or (d, h, w). - * @param num_filter Number of output filters. - * @param num_group Number of groups partition. - * @param workspace Maximum temporary workspace allowed (MB) in deconvolution.This parameter has two usages. When CUDNN is not used, it determines the effective batch size of the deconvolution kernel. When CUDNN is used, it controls the maximum temporary storage used for tuning the best CUDNN kernel when `limited_workspace` strategy is used. - * @param no_bias Whether to disable bias parameter. - * @param cudnn_tune Whether to pick convolution algorithm by running performance test. - * @param cudnn_off Turn off cudnn for this layer. - * @param layout Set layout for input, output and weight. Empty for default layout, NCW for 1d, NCHW for 2d and NCDHW for 3d. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Deconvolution (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, bias : Option[org.apache.mxnet.Symbol] = None, kernel : org.apache.mxnet.Shape, stride : Option[org.apache.mxnet.Shape] = None, dilate : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, adj : Option[org.apache.mxnet.Shape] = None, target_shape : Option[org.apache.mxnet.Shape] = None, num_filter : Int, num_group : Option[Int] = None, workspace : Option[Long] = None, no_bias : Option[Boolean] = None, cudnn_tune : Option[String] = None, cudnn_off : Option[Boolean] = None, layout : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies dropout operation to input array.
- *
- * - During training, each element of the input is set to zero with probability p.
- * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
- * sum of the input unchanged.
- *
- * - During testing, this operator does not change the input if mode is 'training'.
- * If mode is 'always', the same computaion as during training will be applied.
- *
- * Example::
- *
- * random.seed(998)
- * input_array = array([[3., 0.5, -0.5, 2., 7.],
- * [2., -0.4, 7., 3., 0.2]])
- * a = symbol.Variable('a')
- * dropout = symbol.Dropout(a, p = 0.2)
- * executor = dropout.simple_bind(a = input_array.shape)
- *
- * ## If training
- * executor.forward(is_train = True, a = input_array)
- * executor.outputs
- * [[ 3.75 0.625 -0. 2.5 8.75 ]
- * [ 2.5 -0.5 8.75 3.75 0. ]]
- *
- * ## If testing
- * executor.forward(is_train = False, a = input_array)
- * executor.outputs
- * [[ 3. 0.5 -0.5 2. 7. ]
- * [ 2. -0.4 7. 3. 0.2 ]]
- *
- *
- * Defined in src/operator/nn/dropout.cc:L76
- * @param data Input array to which dropout will be applied. - * @param p Fraction of the input that gets dropped out during training time. - * @param mode Whether to only turn on dropout during training or to also turn on for inference. - * @param axes Axes for variational dropout kernel. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Dropout (data : Option[org.apache.mxnet.Symbol] = None, p : Option[org.apache.mxnet.Base.MXFloat] = None, mode : Option[String] = None, axes : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @param args Positional input arguments - * @return org.apache.mxnet.Symbol - */ -@Experimental -def ElementWiseSum (args : Array[org.apache.mxnet.Symbol], name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Maps integer indices to vector representations (embeddings).
- *
- * This operator maps words to real-valued vectors in a high-dimensional space,
- * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
- * For example, it has been noted that in the learned embedding spaces, similar words tend
- * to be close to each other and dissimilar words far apart.
- *
- * For an input array of shape (d1, ..., dK),
- * the shape of an output array is (d1, ..., dK, output_dim).
- * All the input values should be integers in the range [0, input_dim).
- *
- * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
- * (ip0, op0).
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last vector in an embedding matrix.
- *
- * Examples::
- *
- * input_dim = 4
- * output_dim = 5
- *
- * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
- * y = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.],
- * [ 10., 11., 12., 13., 14.],
- * [ 15., 16., 17., 18., 19.]]
- *
- * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
- * x = [[ 1., 3.],
- * [ 0., 2.]]
- *
- * // Mapped input x to its vector representation y.
- * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
- * [ 15., 16., 17., 18., 19.]],
- *
- * [[ 0., 1., 2., 3., 4.],
- * [ 10., 11., 12., 13., 14.]]]
- *
- *
- * The storage type of weight can be either row_sparse or default, while
- * the storage type of weight's grad depends on the value of "sparse_grad".
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L232
- * @param data The input array to the embedding operator. - * @param weight The embedding weight matrix. - * @param input_dim Vocabulary size of the input indices. - * @param output_dim Dimension of the embedding vectors. - * @param dtype Data type of weight. - * @param sparse_grad Compute row sparse gradient in the backward calculation. If set to True, the grad's storage type is row_sparse. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Embedding (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, input_dim : Int, output_dim : Int, dtype : Option[String] = None, sparse_grad : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @param data Input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Flatten (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies a linear transformation: :math:`Y = XW^T + b`.
- *
- * If ``flatten`` is set to be true, then the shapes are:
- *
- * - **data**: `(batch_size, x1, x2, ..., xn)`
- * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(batch_size, num_hidden)`
- *
- * If ``flatten`` is set to be false, then the shapes are:
- *
- * - **data**: `(x1, x2, ..., xn, input_dim)`
- * - **weight**: `(num_hidden, input_dim)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(x1, x2, ..., xn, num_hidden)`
- *
- * The learnable parameters include both ``weight`` and ``bias``.
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * Note that the operator also supports forward computation with `row_sparse` weight and bias,
- * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
- * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
- *
- *
- *
- * Defined in src/operator/nn/fully_connected.cc:L254
- * @param data Input data. - * @param weight Weight matrix. - * @param bias Bias parameter. - * @param num_hidden Number of hidden nodes of the output. - * @param no_bias Whether to disable bias parameter. - * @param flatten Whether to collapse all but the first axis of the input data tensor. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def FullyConnected (data : Option[org.apache.mxnet.Symbol] = None, weight : Option[org.apache.mxnet.Symbol] = None, bias : Option[org.apache.mxnet.Symbol] = None, num_hidden : Int, no_bias : Option[Boolean] = None, flatten : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Generates 2D sampling grid for bilinear sampling.
- * @param data Input data to the function. - * @param transform_type The type of transformation. For `affine`, input data should be an affine matrix of size (batch, 6). For `warp`, input data should be an optical flow of size (batch, 2, h, w). - * @param target_shape Specifies the output shape (H, W). This is required if transformation type is `affine`. If transformation type is `warp`, this parameter is ignored. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def GridGenerator (data : Option[org.apache.mxnet.Symbol] = None, transform_type : String, target_shape : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Apply a sparse regularization to the output a sigmoid activation function.
- * @param data Input data. - * @param sparseness_target The sparseness target - * @param penalty The tradeoff parameter for the sparseness penalty - * @param momentum The momentum for running average - * @return org.apache.mxnet.Symbol - */ -@Experimental -def IdentityAttachKLSparseReg (data : Option[org.apache.mxnet.Symbol] = None, sparseness_target : Option[org.apache.mxnet.Base.MXFloat] = None, penalty : Option[org.apache.mxnet.Base.MXFloat] = None, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies instance normalization to the n-dimensional input array.
- *
- * This operator takes an n-dimensional input array where (n>2) and normalizes
- * the input using the following formula:
- *
- * .. math::
- *
- * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
- *
- * This layer is similar to batch normalization layer (`BatchNorm`)
- * with two differences: first, the normalization is
- * carried out per example (instance), not over a batch. Second, the
- * same normalization is applied both at test and train time. This
- * operation is also known as `contrast normalization`.
- *
- * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
- * `gamma` and `beta` parameters must be vectors of shape [channel].
- *
- * This implementation is based on paper:
- *
- * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
- * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
- *
- * Examples::
- *
- * // Input of shape (2,1,2)
- * x = [[[ 1.1, 2.2]],
- * [[ 3.3, 4.4]]]
- *
- * // gamma parameter of length 1
- * gamma = [1.5]
- *
- * // beta parameter of length 1
- * beta = [0.5]
- *
- * // Instance normalization is calculated with the above formula
- * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
- * [[-0.99752653, 1.99752724]]]
- *
- *
- *
- * Defined in src/operator/instance_norm.cc:L95
- * @param data An n-dimensional input array (n > 2) of the form [batch, channel, spatial_dim1, spatial_dim2, ...]. - * @param gamma A vector of length 'channel', which multiplies the normalized input. - * @param beta A vector of length 'channel', which is added to the product of the normalized input and the weight. - * @param eps An `epsilon` parameter to prevent division by 0. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def InstanceNorm (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, beta : Option[org.apache.mxnet.Symbol] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Normalize the input array using the L2 norm.
- *
- * For 1-D NDArray, it computes::
- *
- * out = data / sqrt(sum(data ** 2) + eps)
- *
- * For N-D NDArray, if the input array has shape (N, N, ..., N),
- *
- * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
- * array by its L2 norm.::
- *
- * for i in 0...N
- * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
- *
- * for i in 0...N
- * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
- * in the array by its L2 norm.::
- *
- * for dim in 2...N
- * for i in 0...N
- * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
- * -dim-
- *
- * Example::
- *
- * x = [[[1,2],
- * [3,4]],
- * [[2,2],
- * [5,6]]]
- *
- * L2Normalization(x, mode='instance')
- * =[[[ 0.18257418 0.36514837]
- * [ 0.54772252 0.73029673]]
- * [[ 0.24077171 0.24077171]
- * [ 0.60192931 0.72231513]]]
- *
- * L2Normalization(x, mode='channel')
- * =[[[ 0.31622776 0.44721359]
- * [ 0.94868326 0.89442718]]
- * [[ 0.37139067 0.31622776]
- * [ 0.92847669 0.94868326]]]
- *
- * L2Normalization(x, mode='spatial')
- * =[[[ 0.44721359 0.89442718]
- * [ 0.60000002 0.80000001]]
- * [[ 0.70710677 0.70710677]
- * [ 0.6401844 0.76822126]]]
- *
- *
- *
- * Defined in src/operator/l2_normalization.cc:L98
- * @param data Input array to normalize. - * @param eps A small constant for numerical stability. - * @param mode Specify the dimension along which to compute L2 norm. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def L2Normalization (data : Option[org.apache.mxnet.Symbol] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, mode : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies local response normalization to the input.
- *
- * The local response normalization layer performs "lateral inhibition" by normalizing
- * over local input regions.
- *
- * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
- * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
- * activity :math:`b_{x,y}^{i}` is given by the expression:
- *
- * .. math::
- * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
- *
- * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
- * number of kernels in the layer.
- *
- *
- *
- * Defined in src/operator/nn/lrn.cc:L175
- * @param data Input data to LRN - * @param alpha The variance scaling parameter :math:`lpha` in the LRN expression. - * @param beta The power parameter :math:`eta` in the LRN expression. - * @param knorm The parameter :math:`k` in the LRN expression. - * @param nsize normalization window width in elements. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def LRN (data : Option[org.apache.mxnet.Symbol] = None, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, knorm : Option[org.apache.mxnet.Base.MXFloat] = None, nsize : Int, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Layer normalization.
- *
- * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis and then
- * compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
- *
- * Both ``gamma`` and ``beta`` are learnable parameters.
- *
- * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_std``. Note that no gradient will be passed through these two outputs.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is -1, which sets the channel
- * axis to be the last item in the input shape.
- *
- *
- *
- * Defined in src/operator/nn/layer_norm.cc:L94
- * @param data Input data to layer normalization - * @param gamma gamma array - * @param beta beta array - * @param axis The axis to perform layer normalization. Usually, this should be be axis of the channel dimension. Negative values means indexing from right to left. - * @param eps An `epsilon` parameter to prevent division by 0. - * @param output_mean_var Output the mean and std calculated along the given axis. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def LayerNorm (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, beta : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, eps : Option[org.apache.mxnet.Base.MXFloat] = None, output_mean_var : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies Leaky rectified linear unit activation element-wise to the input.
- *
- * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
- * when the input is negative and has a slope of one when input is positive.
- *
- * The following modified ReLU Activation functions are supported:
- *
- * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
- * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
- * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
- * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
- * *[lower_bound, upper_bound)* for training, while fixed to be
- * *(lower_bound+upper_bound)/2* for inference.
- *
- *
- *
- * Defined in src/operator/leaky_relu.cc:L63
- * @param data Input data to activation function. - * @param gamma Slope parameter for PReLU. Only required when act_type is 'prelu'. It should be either a vector of size 1, or the same size as the second dimension of data. - * @param act_type Activation function to be applied. - * @param slope Init slope for the activation. (For leaky and elu only) - * @param lower_bound Lower bound of random slope. (For rrelu only) - * @param upper_bound Upper bound of random slope. (For rrelu only) - * @return org.apache.mxnet.Symbol - */ -@Experimental -def LeakyReLU (data : Option[org.apache.mxnet.Symbol] = None, gamma : Option[org.apache.mxnet.Symbol] = None, act_type : Option[String] = None, slope : Option[org.apache.mxnet.Base.MXFloat] = None, lower_bound : Option[org.apache.mxnet.Base.MXFloat] = None, upper_bound : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes and optimizes for squared loss during backward propagation.
- * Just outputs ``data`` during forward propagation.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the squared loss estimated over :math:`n` samples is defined as
- *
- * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
- *
- * .. note::
- * Use the LinearRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LinearRegressionOutput(default, default) = default
- * - LinearRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L92
- * @param data Input data to the function. - * @param label Input label to the function. - * @param grad_scale Scale the gradient by a float factor - * @return org.apache.mxnet.Symbol - */ -@Experimental -def LinearRegressionOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies a logistic function to the input.
- *
- * The logistic function, also known as the sigmoid function, is computed as
- * :math:`\frac{1}{1+exp(-\textbf{x})}`.
- *
- * Commonly, the sigmoid is used to squash the real-valued output of a linear model
- * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
- * It is suitable for binary classification or probability prediction tasks.
- *
- * .. note::
- * Use the LogisticRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LogisticRegressionOutput(default, default) = default
- * - LogisticRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L148
- * @param data Input data to the function. - * @param label Input label to the function. - * @param grad_scale Scale the gradient by a float factor - * @return org.apache.mxnet.Symbol - */ -@Experimental -def LogisticRegressionOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes mean absolute error of the input.
- *
- * MAE is a risk metric corresponding to the expected value of the absolute error.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
- *
- * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
- *
- * .. note::
- * Use the MAERegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - MAERegressionOutput(default, default) = default
- * - MAERegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L120
- * @param data Input data to the function. - * @param label Input label to the function. - * @param grad_scale Scale the gradient by a float factor - * @return org.apache.mxnet.Symbol - */ -@Experimental -def MAERegressionOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = MakeLoss(cross_entropy)
- *
- * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * In addition, we can give a scale to the loss by setting ``grad_scale``,
- * so that the gradient of the loss will be rescaled in the backpropagation.
- *
- * .. note:: This operator should be used as a Symbol instead of NDArray.
- *
- *
- *
- * Defined in src/operator/make_loss.cc:L71
- * @param data Input array. - * @param grad_scale Gradient scale as a supplement to unary and binary operators - * @param valid_thresh clip each element in the array to 0 when it is less than ``valid_thresh``. This is used when ``normalization`` is set to ``'valid'``. - * @param normalization If this is set to null, the output gradient will not be normalized. If this is set to batch, the output gradient will be divided by the batch size. If this is set to valid, the output gradient will be divided by the number of valid input elements. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def MakeLoss (data : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, valid_thresh : Option[org.apache.mxnet.Base.MXFloat] = None, normalization : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @param data An n-dimensional input array. - * @param mode Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges. - * @param pad_width Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ... , before_N, after_N)``. It should be of length ``2*N`` where ``N`` is the number of dimensions of the array.This is equivalent to pad_width in numpy.pad, but flattened. - * @param constant_value The value used for padding when `mode` is "constant". - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Pad (data : Option[org.apache.mxnet.Symbol] = None, mode : String, pad_width : org.apache.mxnet.Shape, constant_value : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Performs pooling on the input.
- *
- * The shapes for 1-D pooling are
- *
- * - **data**: *(batch_size, channel, width)*,
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * The shapes for 2-D pooling are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- * - **lp**: Lp pooling
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- * Notes on Lp pooling:
- *
- * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
- * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
- * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
- *
- * For each window ``X``, the mathematical expression for Lp pooling is:
- *
- * ..math::
- * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
- *
- *
- *
- * Defined in src/operator/nn/pooling.cc:L367
- * @param data Input data to the pooling operator. - * @param kernel Pooling kernel size: (y, x) or (d, y, x) - * @param pool_type Pooling type to be applied. - * @param global_pool Ignore kernel size, do global pooling based on current input feature map. - * @param cudnn_off Turn off cudnn pooling and use MXNet pooling operator. - * @param pooling_convention Pooling convention to be applied. - * @param stride Stride: for pooling (y, x) or (d, y, x). Defaults to 1 for each dimension. - * @param pad Pad for pooling: (y, x) or (d, y, x). Defaults to no padding. - * @param p_value Value of p for Lp pooling, can be 1 or 2, required for Lp Pooling. - * @param count_include_pad Only used for AvgPool, specify whether to count padding elements for averagecalculation. For example, with a 5*5 kernel on a 3*3 corner of a image,the sum of the 9 valid elements will be divided by 25 if this is set to true,or it will be divided by 9 if this is set to false. Defaults to true. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Pooling (data : Option[org.apache.mxnet.Symbol] = None, kernel : Option[org.apache.mxnet.Shape] = None, pool_type : Option[String] = None, global_pool : Option[Boolean] = None, cudnn_off : Option[Boolean] = None, pooling_convention : Option[String] = None, stride : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, p_value : Option[Int] = None, count_include_pad : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * This operator is DEPRECATED.
- * Perform pooling on the input.
- *
- * The shapes for 2-D pooling is
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- *
- * 1-D pooling is special case of 2-D pooling with *weight=1* and
- * *kernel[1]=1*.
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- *
- *
- * Defined in src/operator/pooling_v1.cc:L104
- * @param data Input data to the pooling operator. - * @param kernel pooling kernel size: (y, x) or (d, y, x) - * @param pool_type Pooling type to be applied. - * @param global_pool Ignore kernel size, do global pooling based on current input feature map. - * @param pooling_convention Pooling convention to be applied. - * @param stride stride: for pooling (y, x) or (d, y, x) - * @param pad pad for pooling: (y, x) or (d, y, x) - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Pooling_v1 (data : Option[org.apache.mxnet.Symbol] = None, kernel : Option[org.apache.mxnet.Shape] = None, pool_type : Option[String] = None, global_pool : Option[Boolean] = None, pooling_convention : Option[String] = None, stride : Option[org.apache.mxnet.Shape] = None, pad : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
- * implemented, with both multi-layer and bidirectional support.
- *
- * **Vanilla RNN**
- *
- * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
- * ReLU and Tanh.
- *
- * With ReLU activation function:
- *
- * .. math::
- * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * With Tanh activtion function:
- *
- * .. math::
- * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * Reference paper: Finding structure in time - Elman, 1988.
- * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
- *
- * **LSTM**
- *
- * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
- *
- * .. math::
- * \begin{array}{ll}
- * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
- * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
- * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
- * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
- * c_t = f_t * c_{(t-1)} + i_t * g_t \\
- * h_t = o_t * \tanh(c_t)
- * \end{array}
- *
- * **GRU**
- *
- * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
- *
- * The definition of GRU here is slightly different from paper but compatible with CUDNN.
- *
- * .. math::
- * \begin{array}{ll}
- * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
- * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
- * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
- * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
- * \end{array}
- * @param data Input data to RNN - * @param parameters Vector of all RNN trainable parameters concatenated - * @param state initial hidden state of the RNN - * @param state_cell initial cell state for LSTM networks (only for LSTM) - * @param state_size size of the state for each layer - * @param num_layers number of stacked layers - * @param bidirectional whether to use bidirectional recurrent layers - * @param mode the type of RNN to compute - * @param p Dropout probability, fraction of the input that gets dropped out at training time - * @param state_outputs Whether to have the states as symbol outputs. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def RNN (data : Option[org.apache.mxnet.Symbol] = None, parameters : Option[org.apache.mxnet.Symbol] = None, state : Option[org.apache.mxnet.Symbol] = None, state_cell : Option[org.apache.mxnet.Symbol] = None, state_size : Int, num_layers : Int, bidirectional : Option[Boolean] = None, mode : String, p : Option[org.apache.mxnet.Base.MXFloat] = None, state_outputs : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Performs region of interest(ROI) pooling on the input array.
- *
- * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
- * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
- * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
- * layer mostly used in training a `Fast R-CNN` network for object detection.
- *
- * This operator takes a 4D feature map as an input array and region proposals as `rois`,
- * then it pools over sub-regions of input and produces a fixed-sized output array
- * regardless of the ROI size.
- *
- * To crop the feature map accordingly, you can resize the bounding box coordinates
- * by changing the parameters `rois` and `spatial_scale`.
- *
- * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
- * indicated by a `pooled_size` parameter. batch_size will change to the number of region
- * bounding boxes after `ROIPooling`.
- *
- * The size of each region of interest doesn't have to be perfectly divisible by
- * the number of pooling sections(`pooled_size`).
- *
- * Example::
- *
- * x = [[[[ 0., 1., 2., 3., 4., 5.],
- * [ 6., 7., 8., 9., 10., 11.],
- * [ 12., 13., 14., 15., 16., 17.],
- * [ 18., 19., 20., 21., 22., 23.],
- * [ 24., 25., 26., 27., 28., 29.],
- * [ 30., 31., 32., 33., 34., 35.],
- * [ 36., 37., 38., 39., 40., 41.],
- * [ 42., 43., 44., 45., 46., 47.]]]]
- *
- * // region of interest i.e. bounding box coordinates.
- * y = [[0,0,0,4,4]]
- *
- * // returns array of shape (2,2) according to the given roi with max pooling.
- * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
- * [ 26., 28.]]]]
- *
- * // region of interest is changed due to the change in `spacial_scale` parameter.
- * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
- * [ 19., 21.]]]]
- *
- *
- *
- * Defined in src/operator/roi_pooling.cc:L295
- * @param data The input array to the pooling operator, a 4D Feature maps - * @param rois Bounding box coordinates, a 2D array of [[batch_index, x1, y1, x2, y2]], where (x1, y1) and (x2, y2) are top left and bottom right corners of designated region of interest. `batch_index` indicates the index of corresponding image in the input array - * @param pooled_size ROI pooling output shape (h,w) - * @param spatial_scale Ratio of input feature map height (or w) to raw image height (or w). Equals the reciprocal of total stride in convolutional layers - * @return org.apache.mxnet.Symbol - */ -@Experimental -def ROIPooling (data : Option[org.apache.mxnet.Symbol] = None, rois : Option[org.apache.mxnet.Symbol] = None, pooled_size : org.apache.mxnet.Shape, spatial_scale : org.apache.mxnet.Base.MXFloat, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @param data Input data to reshape. - * @param shape The target shape - * @param reverse If true then the special values are inferred from right to left - * @param target_shape (Deprecated! Use ``shape`` instead.) Target new shape. One and only one dim can be 0, in which case it will be inferred from the rest of dims - * @param keep_highest (Deprecated! Use ``shape`` instead.) Whether keep the highest dim unchanged.If set to true, then the first dim in target_shape is ignored,and always fixed as input - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Reshape (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, reverse : Option[Boolean] = None, target_shape : Option[org.apache.mxnet.Shape] = None, keep_highest : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes support vector machine based transformation of the input.
- *
- * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
- * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
- * @param data Input data for SVM transformation. - * @param label Class label for the input data. - * @param margin The loss function penalizes outputs that lie outside this margin. Default margin is 1. - * @param regularization_coefficient Regularization parameter for the SVM. This balances the tradeoff between coefficient size and error. - * @param use_linear Whether to use L1-SVM objective. L2-SVM objective is used by default. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def SVMOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, margin : Option[org.apache.mxnet.Base.MXFloat] = None, regularization_coefficient : Option[org.apache.mxnet.Base.MXFloat] = None, use_linear : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Takes the last element of a sequence.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
- * of the form [batch_size, other_feature_dims].
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
- * an input array of positive ints of dimension [batch_size]. To use this parameter,
- * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
- * to have the max sequence length.
- *
- * .. note:: Alternatively, you can also use `take` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]],
- *
- * [[ 10., 11., 12.],
- * [ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]]
- *
- * // returns last sequence when sequence_length parameter is not used
- * SequenceLast(x) = [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 13., 14., 15.],
- * [ 25., 26., 27.]]
- *
- *
- *
- * Defined in src/operator/sequence_last.cc:L92
- * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2 - * @param sequence_length vector of sequence lengths of the form [batch_size] - * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence - * @param axis The sequence axis. Only values of 0 and 1 are currently supported. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def SequenceLast (data : Option[org.apache.mxnet.Symbol] = None, sequence_length : Option[org.apache.mxnet.Symbol] = None, use_sequence_length : Option[Boolean] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Sets all elements outside the sequence to a constant value.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
- * should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length and
- * this operator works as the `identity` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // works as identity operator when sequence_length parameter is not used
- * SequenceMask(x) = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [1,1] means 1 of each batch will be kept
- * // and other rows are masked with default mask value = 0
- * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]]]
- *
- * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
- * // and other rows are masked with value = 1
- * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 1., 1.],
- * [ 16., 17., 18.]]]
- *
- *
- *
- * Defined in src/operator/sequence_mask.cc:L114
- * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims] where n>2 - * @param sequence_length vector of sequence lengths of the form [batch_size] - * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence - * @param value The value to be used as a mask. - * @param axis The sequence axis. Only values of 0 and 1 are currently supported. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def SequenceMask (data : Option[org.apache.mxnet.Symbol] = None, sequence_length : Option[org.apache.mxnet.Symbol] = None, use_sequence_length : Option[Boolean] = None, value : Option[org.apache.mxnet.Base.MXFloat] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Reverses the elements of each sequence.
- *
- * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
- * and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences.
- * `sequence_length` should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // returns reverse sequence when sequence_length parameter is not used
- * SequenceReverse(x) = [[[ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]]]
- *
- * // sequence_length [2,2] means 2 rows of
- * // both batch B1 and B2 will be reversed.
- * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
- * // will be reversed.
- * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 16., 17., 18.]],
- *
- * [[ 1., 2., 3.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14, 15.],
- * [ 4., 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/sequence_reverse.cc:L113
- * @param data n-dimensional input array of the form [max_sequence_length, batch_size, other dims] where n>2 - * @param sequence_length vector of sequence lengths of the form [batch_size] - * @param use_sequence_length If set to true, this layer takes in an extra input parameter `sequence_length` to specify variable length sequence - * @param axis The sequence axis. Only 0 is currently supported. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def SequenceReverse (data : Option[org.apache.mxnet.Symbol] = None, sequence_length : Option[org.apache.mxnet.Symbol] = None, use_sequence_length : Option[Boolean] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @param data The input - * @param num_outputs Number of splits. Note that this should evenly divide the length of the `axis`. - * @param axis Axis along which to split. - * @param squeeze_axis If true, Removes the axis with length 1 from the shapes of the output arrays. **Note** that setting `squeeze_axis` to ``true`` removes axis with length 1 only along the `axis` which it is split. Also `squeeze_axis` can be set to ``true`` only if ``input.shape[axis] == num_outputs``. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def SliceChannel (data : Option[org.apache.mxnet.Symbol] = None, num_outputs : Int, axis : Option[Int] = None, squeeze_axis : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Please use `SoftmaxOutput`.
- *
- * .. note::
- *
- * This operator has been renamed to `SoftmaxOutput`, which
- * computes the gradient of cross-entropy loss w.r.t softmax output.
- * To just compute softmax output, use the `softmax` operator.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L138
- * @param data Input array. - * @param grad_scale Scales the gradient by a float factor. - * @param ignore_label The instances whose `labels` == `ignore_label` will be ignored during backward, if `use_ignore` is set to ``true``). - * @param multi_output If set to ``true``, the softmax function will be computed along axis ``1``. This is applied when the shape of input array differs from the shape of label array. - * @param use_ignore If set to ``true``, the `ignore_label` value will not contribute to the backward gradient. - * @param preserve_shape If set to ``true``, the softmax function will be computed along the last axis (``-1``). - * @param normalization Normalizes the gradient. - * @param out_grad Multiplies gradient with output gradient element-wise. - * @param smooth_alpha Constant for computing a label smoothed version of cross-entropyfor the backwards pass. This constant gets subtracted from theone-hot encoding of the gold label and distributed uniformly toall other labels. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def Softmax (data : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, ignore_label : Option[org.apache.mxnet.Base.MXFloat] = None, multi_output : Option[Boolean] = None, use_ignore : Option[Boolean] = None, preserve_shape : Option[Boolean] = None, normalization : Option[String] = None, out_grad : Option[Boolean] = None, smooth_alpha : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies softmax activation to input. This is intended for internal layers.
- *
- * .. note::
- *
- * This operator has been deprecated, please use `softmax`.
- *
- * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
- * This is the default mode.
- *
- * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
- * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
- * has at least 3 dimensions.
- * This can be used for `fully convolutional network`, `image segmentation`, etc.
- *
- * Example::
- *
- * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
- * >>> [2., -.4, 7., 3., 0.2]])
- * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
- * >>> print softmax_act.asnumpy()
- * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
- * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
- *
- *
- *
- * Defined in src/operator/nn/softmax_activation.cc:L59
- * @param data The input array. - * @param mode Specifies how to compute the softmax. If set to ``instance``, it computes softmax for each instance. If set to ``channel``, It computes cross channel softmax for each position of each instance. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def SoftmaxActivation (data : Option[org.apache.mxnet.Symbol] = None, mode : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the gradient of cross entropy loss with respect to softmax output.
- *
- * - This operator computes the gradient in two steps.
- * The cross entropy loss does not actually need to be computed.
- *
- * - Applies softmax function on the input array.
- * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
- *
- * - The softmax function, cross entropy loss and gradient is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * - The gradient of cross entropy loss w.r.t softmax output:
- *
- * .. math:: \text{gradient} = \text{output} - \text{label}
- *
- * - During forward propagation, the softmax function is computed for each instance in the input array.
- *
- * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
- * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
- * and `multi_output` to specify the way to compute softmax:
- *
- * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
- * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
- * each row in the reshaped array, and afterwards reshape it back to the original shape
- * :math:`(d_1, d_2, ..., d_n)`.
- * - If `preserve_shape` is ``true``, the softmax function will be computed along
- * the last axis (`axis` = ``-1``).
- * - If `multi_output` is ``true``, the softmax function will be computed along
- * the second axis (`axis` = ``1``).
- *
- * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
- * The provided label can be a one-hot label array or a probability label array.
- *
- * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
- * with a particular label to be ignored during backward propagation. **This has no effect when
- * softmax `output` has same shape as `label`**.
- *
- * Example::
- *
- * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
- * label = [1,0,2,3]
- * ignore_label = 1
- * SoftmaxOutput(data=data, label = label,\
- * multi_output=true, use_ignore=true,\
- * ignore_label=ignore_label)
- * ## forward softmax output
- * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]]
- * ## backward gradient output
- * [[ 0. 0. 0. 0. ]
- * [-0.75 0.25 0.25 0.25]
- * [ 0.25 0.25 -0.75 0.25]
- * [ 0.25 0.25 0.25 -0.75]]
- * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
- *
- * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
- * give each loss function different weights.
- *
- * - This operator also supports various ways to normalize the gradient by `normalization`,
- * The `normalization` is applied if softmax output has different shape than the labels.
- * The `normalization` mode can be set to the followings:
- *
- * - ``'null'``: do nothing.
- * - ``'batch'``: divide the gradient by the batch size.
- * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L123
- * @param data Input array. - * @param label Ground truth label. - * @param grad_scale Scales the gradient by a float factor. - * @param ignore_label The instances whose `labels` == `ignore_label` will be ignored during backward, if `use_ignore` is set to ``true``). - * @param multi_output If set to ``true``, the softmax function will be computed along axis ``1``. This is applied when the shape of input array differs from the shape of label array. - * @param use_ignore If set to ``true``, the `ignore_label` value will not contribute to the backward gradient. - * @param preserve_shape If set to ``true``, the softmax function will be computed along the last axis (``-1``). - * @param normalization Normalizes the gradient. - * @param out_grad Multiplies gradient with output gradient element-wise. - * @param smooth_alpha Constant for computing a label smoothed version of cross-entropyfor the backwards pass. This constant gets subtracted from theone-hot encoding of the gold label and distributed uniformly toall other labels. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def SoftmaxOutput (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, grad_scale : Option[org.apache.mxnet.Base.MXFloat] = None, ignore_label : Option[org.apache.mxnet.Base.MXFloat] = None, multi_output : Option[Boolean] = None, use_ignore : Option[Boolean] = None, preserve_shape : Option[Boolean] = None, normalization : Option[String] = None, out_grad : Option[Boolean] = None, smooth_alpha : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies a spatial transformer to input feature map.
- * @param data Input data to the SpatialTransformerOp. - * @param loc localisation net, the output dim should be 6 when transform_type is affine. You shold initialize the weight and bias with identity tranform. - * @param target_shape output shape(h, w) of spatial transformer: (y, x) - * @param transform_type transformation type - * @param sampler_type sampling type - * @return org.apache.mxnet.Symbol - */ -@Experimental -def SpatialTransformer (data : Option[org.apache.mxnet.Symbol] = None, loc : Option[org.apache.mxnet.Symbol] = None, target_shape : Option[org.apache.mxnet.Shape] = None, transform_type : String, sampler_type : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @param data Input array. - * @param dim1 the first axis to be swapped. - * @param dim2 the second axis to be swapped. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def SwapAxis (data : Option[org.apache.mxnet.Symbol] = None, dim1 : Option[Int] = None, dim2 : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Performs nearest neighbor/bilinear up sampling to inputs.
- * @param data Array of tensors to upsample - * @param scale Up sampling scale - * @param num_filter Input filter. Only used by bilinear sample_type. - * @param sample_type upsampling method - * @param multi_input_mode How to handle multiple input. concat means concatenate upsampled images along the channel dimension. sum means add all images together, only available for nearest neighbor upsampling. - * @param num_args Number of inputs to be upsampled. For nearest neighbor upsampling, this can be 1-N; the size of output will be(scale*h_0,scale*w_0) and all other inputs will be upsampled to thesame size. For bilinear upsampling this must be 2; 1 input and 1 weight. - * @param workspace Tmp workspace for deconvolution (MB) - * @return org.apache.mxnet.Symbol - */ -@Experimental -def UpSampling (data : Array[org.apache.mxnet.Symbol], scale : Int, num_filter : Option[Int] = None, sample_type : String, multi_input_mode : Option[String] = None, num_args : Int, workspace : Option[Long] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise absolute value of the input.
- *
- * Example::
- *
- * abs([-2, 0, 3]) = [2, 0, 3]
- *
- * The storage type of ``abs`` output depends upon the input storage type:
- *
- * - abs(default) = default
- * - abs(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def abs (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Update function for Adam optimizer. Adam is seen as a generalization
- * of AdaGrad.
- *
- * Adam update consists of the following steps, where g represents gradient and m, v
- * are 1st and 2nd order moment estimates (mean and variance).
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
- *
- * It updates the weights using::
- *
- * m = beta1*m + (1-beta1)*grad
- * v = beta2*v + (1-beta2)*(grad**2)
- * w += - learning_rate * m / (sqrt(v) + epsilon)
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
- * type of weight is the same as those of m and v,
- * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
- *
- * for row in grad.indices:
- * m[row] = beta1*m[row] + (1-beta1)*grad[row]
- * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
- * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L495
- * @param weight Weight - * @param grad Gradient - * @param mean Moving mean - * @param vari Moving variance - * @param lr Learning rate - * @param beta1 The decay rate for the 1st moment estimates. - * @param beta2 The decay rate for the 2nd moment estimates. - * @param epsilon A small constant for numerical stability. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and all of w, m and v have the same stype - * @return org.apache.mxnet.Symbol - */ -@Experimental -def adam_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, mean : Option[org.apache.mxnet.Symbol] = None, vari : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, beta1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @param args Positional input arguments - * @return org.apache.mxnet.Symbol - */ -@Experimental -def add_n (args : Array[org.apache.mxnet.Symbol], name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise inverse cosine of the input array.
- *
- * The input should be in range `[-1, 1]`.
- * The output is in the closed interval :math:`[0, \pi]`
- *
- * .. math::
- * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
- *
- * The storage type of ``arccos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def arccos (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the element-wise inverse hyperbolic cosine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arccosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def arccosh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise inverse sine of the input array.
- *
- * The input should be in the range `[-1, 1]`.
- * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
- *
- * .. math::
- * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
- *
- * The storage type of ``arcsin`` output depends upon the input storage type:
- *
- * - arcsin(default) = default
- * - arcsin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def arcsin (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the element-wise inverse hyperbolic sine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arcsinh`` output depends upon the input storage type:
- *
- * - arcsinh(default) = default
- * - arcsinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def arcsinh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise inverse tangent of the input array.
- *
- * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
- *
- * .. math::
- * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
- *
- * The storage type of ``arctan`` output depends upon the input storage type:
- *
- * - arctan(default) = default
- * - arctan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def arctan (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the element-wise inverse hyperbolic tangent of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arctanh`` output depends upon the input storage type:
- *
- * - arctanh(default) = default
- * - arctanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def arctanh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns indices of the maximum values along an axis.
- *
- * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmax along axis 0
- * argmax(x, axis=0) = [ 1., 1., 1.]
- *
- * // argmax along axis 1
- * argmax(x, axis=1) = [ 2., 2.]
- *
- * // argmax along axis 1 keeping same dims as an input array
- * argmax(x, axis=1, keepdims=True) = [[ 2.],
- * [ 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
- * @param data The input - * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` - * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def argmax (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, keepdims : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns argmax indices of each channel from the input array.
- *
- * The result will be an NDArray of shape (num_channel,).
- *
- * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * argmax_channel(x) = [ 2., 2.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
- * @param data The input array - * @return org.apache.mxnet.Symbol - */ -@Experimental -def argmax_channel (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns indices of the minimum values along an axis.
- *
- * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmin along axis 0
- * argmin(x, axis=0) = [ 0., 0., 0.]
- *
- * // argmin along axis 1
- * argmin(x, axis=1) = [ 0., 0.]
- *
- * // argmin along axis 1 keeping same dims as an input array
- * argmin(x, axis=1, keepdims=True) = [[ 0.],
- * [ 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
- * @param data The input - * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` - * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def argmin (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, keepdims : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the indices that would sort an input array along the given axis.
- *
- * This function performs sorting along the given axis and returns an array of indices having same shape
- * as an input array that index data in sorted order.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // sort along axis -1
- * argsort(x) = [[ 1., 0., 2.],
- * [ 0., 2., 1.]]
- *
- * // sort along axis 0
- * argsort(x, axis=0) = [[ 1., 0., 1.]
- * [ 0., 1., 0.]]
- *
- * // flatten and then sort
- * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L176
- * @param data The input array - * @param axis Axis along which to sort the input tensor. If not given, the flattened array is used. Default is -1. - * @param is_ascend Whether to sort in ascending or descending order. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def argsort (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, is_ascend : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Batchwise dot product.
- *
- * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
- * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
- *
- * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
- * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
- * which is computed by::
- *
- * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L117
- * @param lhs The first input - * @param rhs The second input - * @param transpose_a If true then transpose the first input before dot. - * @param transpose_b If true then transpose the second input before dot. - * @param forward_stype The desired storage type of the forward output given by user, if thecombination of input storage types and this hint does not matchany implemented ones, the dot operator will perform fallback operationand still produce an output of the desired storage type. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def batch_dot (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, forward_stype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Takes elements from a data batch.
- *
- * .. note::
- * `batch_take` is deprecated. Use `pick` instead.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // takes elements with specified indices
- * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L444
- * @param a The input array - * @param indices The index array - * @return org.apache.mxnet.Symbol - */ -@Experimental -def batch_take (a : Option[org.apache.mxnet.Symbol] = None, indices : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_add (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @param data The input - * @param axis The axes to perform the broadcasting. - * @param size Target sizes of the broadcasting axes. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_axes (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, size : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @param data The input - * @param axis The axes to perform the broadcasting. - * @param size Target sizes of the broadcasting axes. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, size : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise division of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 6., 6., 6.],
- * [ 6., 6., 6.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_div(x, y) = [[ 3., 3., 3.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_div(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_div (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_equal (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_greater (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_greater_equal (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the hypotenuse of a right angled triangle, given its "legs"
- * with broadcasting.
- *
- * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
- *
- * Example::
- *
- * x = [[ 3., 3., 3.]]
- *
- * y = [[ 4.],
- * [ 4.]]
- *
- * broadcast_hypot(x, y) = [[ 5., 5., 5.],
- * [ 5., 5., 5.]]
- *
- * z = [[ 0.],
- * [ 4.]]
- *
- * broadcast_hypot(x, z) = [[ 3., 3., 3.],
- * [ 5., 5., 5.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_hypot (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser(x, y) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_lesser (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_lesser_equal (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **logical and** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_logical_and (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **logical or** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_logical_or (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **logical xor** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_logical_xor (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise maximum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise maxima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_maximum (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise minimum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise minima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_minimum (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_minus (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise modulo of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 8., 8., 8.],
- * [ 8., 8., 8.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_mod(x, y) = [[ 0., 0., 0.],
- * [ 2., 2., 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_mod (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise product of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_mul(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- * Supported sparse operations:
- *
- * broadcast_mul(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_mul (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_not_equal (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_plus (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_power(x, y) = [[ 2., 2., 2.],
- * [ 4., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_power (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @param lhs First input to the function - * @param rhs Second input to the function - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_sub (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Broadcasts the input array to a new shape.
- *
- * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
- * with arrays of different shapes efficiently without creating multiple copies of arrays.
- * Also see, `Broadcasting `_ for more explanation.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * For example::
- *
- * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
- * [ 1., 2., 3.]])
- *
- * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
- * So with `shape=(2,0)`, we will obtain the same result as in the above example.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
- * @param data The input - * @param shape The shape of the desired array. We can set the dim to zero if it's same as the original. E.g `A = broadcast_to(B, shape=(10, 0, 0))` has the same meaning as `A = broadcast_axis(B, axis=0, size=10)`. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def broadcast_to (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @param data The input. - * @param dtype Output data type. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def cast (data : Option[org.apache.mxnet.Symbol] = None, dtype : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Casts tensor storage type to the new type.
- *
- * When an NDArray with default storage type is cast to csr or row_sparse storage,
- * the result is compact, which means:
- *
- * - for csr, zero values will not be retained
- * - for row_sparse, row slices of all zeros will not be retained
- *
- * The storage type of ``cast_storage`` output depends on stype parameter:
- *
- * - cast_storage(csr, 'default') = default
- * - cast_storage(row_sparse, 'default') = default
- * - cast_storage(default, 'csr') = csr
- * - cast_storage(default, 'row_sparse') = row_sparse
- * - cast_storage(csr, 'csr') = csr
- * - cast_storage(row_sparse, 'row_sparse') = row_sparse
- *
- * Example::
- *
- * dense = [[ 0., 1., 0.],
- * [ 2., 0., 3.],
- * [ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * # cast to row_sparse storage type
- * rsp = cast_storage(dense, 'row_sparse')
- * rsp.indices = [0, 1]
- * rsp.values = [[ 0., 1., 0.],
- * [ 2., 0., 3.]]
- *
- * # cast to csr storage type
- * csr = cast_storage(dense, 'csr')
- * csr.indices = [1, 0, 2]
- * csr.values = [ 1., 2., 3.]
- * csr.indptr = [0, 1, 3, 3, 3]
- *
- *
- *
- * Defined in src/operator/tensor/cast_storage.cc:L71
- * @param data The input. - * @param stype Output storage type. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def cast_storage (data : Option[org.apache.mxnet.Symbol] = None, stype : String, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise cube-root value of the input.
- *
- * .. math::
- * cbrt(x) = \sqrt[3]{x}
- *
- * Example::
- *
- * cbrt([1, 8, -125]) = [1, 2, -5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def cbrt (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise ceiling of the input.
- *
- * The ceil of the scalar x is the smallest integer i, such that i >= x.
- *
- * Example::
- *
- * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
- *
- * The storage type of ``ceil`` output depends upon the input storage type:
- *
- * - ceil(default) = default
- * - ceil(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def ceil (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
- * @param lhs Left operand to the function. - * @param rhs Right operand to the function. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def choose_element_0index (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Clips (limits) the values in an array.
- *
- * Given an interval, values outside the interval are clipped to the interval edges.
- * Clipping ``x`` between `a_min` and `a_x` would be::
- *
- * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
- *
- * Example::
- *
- * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- *
- * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
- *
- * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
- * parameter values:
- *
- * - clip(default) = default
- * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
- * - clip(csr, a_min <= 0, a_max >= 0) = csr
- * - clip(row_sparse, a_min < 0, a_max < 0) = default
- * - clip(row_sparse, a_min > 0, a_max > 0) = default
- * - clip(csr, a_min < 0, a_max < 0) = csr
- * - clip(csr, a_min > 0, a_max > 0) = csr
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L617
- * @param data Input array. - * @param a_min Minimum value - * @param a_max Maximum value - * @return org.apache.mxnet.Symbol - */ -@Experimental -def clip (data : Option[org.apache.mxnet.Symbol] = None, a_min : org.apache.mxnet.Base.MXFloat, a_max : org.apache.mxnet.Base.MXFloat, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @param data List of arrays to concatenate - * @param num_args Number of inputs to be concated. - * @param dim the dimension to be concated. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def concat (data : Array[org.apache.mxnet.Symbol], num_args : Int, dim : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the element-wise cosine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
- *
- * The storage type of ``cos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def cos (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the hyperbolic cosine of the input array, computed element-wise.
- *
- * .. math::
- * cosh(x) = 0.5\times(exp(x) + exp(-x))
- *
- * The storage type of ``cosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def cosh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @param data Source input - * @param begin starting indices for the slice operation, supports negative indices. - * @param end ending indices for the slice operation, supports negative indices. - * @param step step for the slice operation, supports negative values. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def crop (data : Option[org.apache.mxnet.Symbol] = None, begin : org.apache.mxnet.Shape, end : org.apache.mxnet.Shape, step : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Converts each element of the input array from radians to degrees.
- *
- * .. math::
- * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
- *
- * The storage type of ``degrees`` output depends upon the input storage type:
- *
- * - degrees(default) = default
- * - degrees(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def degrees (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Dot product of two arrays.
- *
- * ``dot``'s behavior depends on the input array dimensions:
- *
- * - 1-D arrays: inner product of vectors
- * - 2-D arrays: matrix multiplication
- * - N-D arrays: a sum product over the last axis of the first input and the first
- * axis of the second input
- *
- * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
- * result array will have shape `(n,m,r,s)`. It is computed by::
- *
- * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
- *
- * Example::
- *
- * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
- * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
- * dot(x,y)[0,0,1,1] = 0
- * sum(x[0,0,:]*y[:,1,1]) = 0
- *
- * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
- * forward_stype option for output storage type. Implemented sparse operations include:
- *
- * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
- * - dot(csr, default, transpose_a=True) = default
- * - dot(csr, default, transpose_a=True) = row_sparse
- * - dot(csr, default) = default
- * - dot(csr, row_sparse) = default
- * - dot(default, csr) = csr (CPU only)
- * - dot(default, csr, forward_stype='default') = default
- * - dot(default, csr, transpose_b=True, forward_stype='default') = default
- *
- * If the combination of input storage types and forward_stype does not match any of the
- * above patterns, ``dot`` will fallback and generate output with default storage.
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L69
- * @param lhs The first input - * @param rhs The second input - * @param transpose_a If true then transpose the first input before dot. - * @param transpose_b If true then transpose the second input before dot. - * @param forward_stype The desired storage type of the forward output given by user, if thecombination of input storage types and this hint does not matchany implemented ones, the dot operator will perform fallback operationand still produce an output of the desired storage type. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def dot (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, forward_stype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Adds arguments element-wise.
- *
- * The storage type of ``elemwise_add`` output depends on storage types of inputs
- *
- * - elemwise_add(row_sparse, row_sparse) = row_sparse
- * - elemwise_add(csr, csr) = csr
- * - elemwise_add(default, csr) = default
- * - elemwise_add(csr, default) = default
- * - elemwise_add(default, rsp) = default
- * - elemwise_add(rsp, default) = default
- * - otherwise, ``elemwise_add`` generates output with default storage
- * @param lhs first input - * @param rhs second input - * @return org.apache.mxnet.Symbol - */ -@Experimental -def elemwise_add (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Divides arguments element-wise.
- *
- * The storage type of ``elemwise_div`` output is always dense
- * @param lhs first input - * @param rhs second input - * @return org.apache.mxnet.Symbol - */ -@Experimental -def elemwise_div (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Multiplies arguments element-wise.
- *
- * The storage type of ``elemwise_mul`` output depends on storage types of inputs
- *
- * - elemwise_mul(default, default) = default
- * - elemwise_mul(row_sparse, row_sparse) = row_sparse
- * - elemwise_mul(default, row_sparse) = row_sparse
- * - elemwise_mul(row_sparse, default) = row_sparse
- * - elemwise_mul(csr, csr) = csr
- * - otherwise, ``elemwise_mul`` generates output with default storage
- * @param lhs first input - * @param rhs second input - * @return org.apache.mxnet.Symbol - */ -@Experimental -def elemwise_mul (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Subtracts arguments element-wise.
- *
- * The storage type of ``elemwise_sub`` output depends on storage types of inputs
- *
- * - elemwise_sub(row_sparse, row_sparse) = row_sparse
- * - elemwise_sub(csr, csr) = csr
- * - elemwise_sub(default, csr) = default
- * - elemwise_sub(csr, default) = default
- * - elemwise_sub(default, rsp) = default
- * - elemwise_sub(rsp, default) = default
- * - otherwise, ``elemwise_sub`` generates output with default storage
- * @param lhs first input - * @param rhs second input - * @return org.apache.mxnet.Symbol - */ -@Experimental -def elemwise_sub (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise exponential value of the input.
- *
- * .. math::
- * exp(x) = e^x \approx 2.718^x
- *
- * Example::
- *
- * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
- *
- * The storage type of ``exp`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def exp (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Inserts a new axis of size 1 into the array shape
- *
- * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
- * will return a new array with shape ``(2,1,3,4)``.
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L346
- * @param data Source input - * @param axis Position where new axis is to be inserted. Suppose that the input `NDArray`'s dimension is `ndim`, the range of the inserted axis is `[-ndim, ndim]` - * @return org.apache.mxnet.Symbol - */ -@Experimental -def expand_dims (data : Option[org.apache.mxnet.Symbol] = None, axis : Int, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns ``exp(x) - 1`` computed element-wise on the input.
- *
- * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
- *
- * The storage type of ``expm1`` output depends upon the input storage type:
- *
- * - expm1(default) = default
- * - expm1(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def expm1 (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
- * @param lhs Left operand to the function. - * @param mhs Middle operand to the function. - * @param rhs Right operand to the function. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def fill_element_0index (lhs : Option[org.apache.mxnet.Symbol] = None, mhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise rounded value to the nearest \
- * integer towards zero of the input.
- *
- * Example::
- *
- * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
- *
- * The storage type of ``fix`` output depends upon the input storage type:
- *
- * - fix(default) = default
- * - fix(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def fix (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @param data Input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def flatten (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @param data Input data array - * @param axis The axis which to reverse elements. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def flip (data : Option[org.apache.mxnet.Symbol] = None, axis : org.apache.mxnet.Shape, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise floor of the input.
- *
- * The floor of the scalar x is the largest integer i, such that i <= x.
- *
- * Example::
- *
- * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
- *
- * The storage type of ``floor`` output depends upon the input storage type:
- *
- * - floor(default) = default
- * - floor(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def floor (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * The FTML optimizer described in
- * *FTML - Follow the Moving Leader in Deep Learning*,
- * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
- * \sigma_t = d_t - \beta_1 d_{t-1}
- * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
- * W_t = - \frac{ z_t }{ d_t }
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L447
- * @param weight Weight - * @param grad Gradient - * @param d Internal state ``d_t`` - * @param v Internal state ``v_t`` - * @param z Internal state ``z_t`` - * @param lr Learning rate. - * @param beta1 Generally close to 0.5. - * @param beta2 Generally close to 1. - * @param epsilon Epsilon to prevent div 0. - * @param t Number of update. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_grad Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def ftml_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, d : Option[org.apache.mxnet.Symbol] = None, v : Option[org.apache.mxnet.Symbol] = None, z : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, beta1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[Double] = None, t : Int, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_grad : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Update function for Ftrl optimizer.
- * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
- * http://dl.acm.org/citation.cfm?id=2488200.
- *
- * It updates the weights using::
- *
- * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
- * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
- * n += rescaled_grad**2
- * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
- *
- * If w, z and n are all of ``row_sparse`` storage type,
- * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
- *
- * for row in grad.indices:
- * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
- * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
- * n[row] += rescaled_grad[row]**2
- * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L632
- * @param weight Weight - * @param grad Gradient - * @param z z - * @param n Square of grad - * @param lr Learning rate - * @param lamda1 The L1 regularization coefficient. - * @param beta Per-Coordinate Learning Rate beta. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def ftrl_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, z : Option[org.apache.mxnet.Symbol] = None, n : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, lamda1 : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the gamma function (extension of the factorial function \
- * to the reals), computed element-wise on the input array.
- *
- * The storage type of ``gamma`` output is always dense
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def gamma (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise log of the absolute value of the gamma function \
- * of the input.
- *
- * The storage type of ``gammaln`` output is always dense
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def gammaln (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Gather elements or slices from `data` and store to a tensor whose
- * shape is defined by `indices`.
- *
- * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}]
- *
- * Examples::
- *
- * data = [[0, 1], [2, 3]]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * gather_nd(data, indices) = [2, 3, 0]
- * @param data data - * @param indices indices - * @return org.apache.mxnet.Symbol - */ -@Experimental -def gather_nd (data : Option[org.apache.mxnet.Symbol] = None, indices : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes hard sigmoid of x element-wise.
- *
- * .. math::
- * y = max(0, min(1, alpha * x + beta))
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
- * @param data The input array. - * @param alpha Slope of hard sigmoid - * @param beta Bias of hard sigmoid. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def hard_sigmoid (data : Option[org.apache.mxnet.Symbol] = None, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns a copy of the input.
- *
- * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def identity (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the Khatri-Rao product of the input matrices.
- *
- * Given a collection of :math:`n` input matrices,
- *
- * .. math::
- * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
- *
- * the (column-wise) Khatri-Rao product is defined as the matrix,
- *
- * .. math::
- * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
- *
- * where the :math:`k` th column is equal to the column-wise outer product
- * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
- * column of the ith matrix.
- *
- * Example::
- *
- * >>> A = mx.nd.array([[1, -1],
- * >>> [2, -3]])
- * >>> B = mx.nd.array([[1, 4],
- * >>> [2, 5],
- * >>> [3, 6]])
- * >>> C = mx.nd.khatri_rao(A, B)
- * >>> print(C.asnumpy())
- * [[ 1. -4.]
- * [ 2. -5.]
- * [ 3. -6.]
- * [ 2. -12.]
- * [ 4. -15.]
- * [ 6. -18.]]
- *
- *
- *
- * Defined in src/operator/contrib/krprod.cc:L108
- * @param args Positional input matrices - * @return org.apache.mxnet.Symbol - */ -@Experimental -def khatri_rao (args : Array[org.apache.mxnet.Symbol], name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * LQ factorization for general matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
- * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
- * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
- * that:
- *
- * *A* = *L* \* *Q*
- *
- * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
- * and *Q* is row-orthonormal, meaning that
- *
- * *Q* \* *Q*\ :sup:`T`
- *
- * is equal to the identity matrix of shape *(x, x)*.
- *
- * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single LQ factorization
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * Q, L = gelqf(A)
- * Q = [[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]]
- * L = [[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]]
- *
- * // Batch LQ factorization
- * A = [[[1., 2., 3.], [4., 5., 6.]],
- * [[7., 8., 9.], [10., 11., 12.]]]
- * Q, L = gelqf(A)
- * Q = [[[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]],
- * [[-0.50257071, -0.57436653, -0.64616234],
- * [0.7620735, 0.05862104, -0.64483142]]]
- * L = [[[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]],
- * [[-13.92838828, 0.],
- * [-19.09768702, 0.52758934]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L552
- * @param A Tensor of input matrices to be factorized - * @return org.apache.mxnet.Symbol - */ -@Experimental -def linalg_gelqf (A : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Performs general matrix multiplication and accumulation.
- * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
- *
- * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
- * matrix transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = swapaxes(C, dim1=1, dim2=3)
- * C = gemm(A1, B1, C)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply-add
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
- * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
- *
- * // Batch matrix multiply-add
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * C = [[[10.0]], [[0.01]]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
- * = [[[104.0]], [[0.14]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L81
- * @param A Tensor of input matrices - * @param B Tensor of input matrices - * @param C Tensor of input matrices - * @param transpose_a Multiply with transposed of first input (A). - * @param transpose_b Multiply with transposed of second input (B). - * @param alpha Scalar factor multiplied with A*B. - * @param beta Scalar factor multiplied with C. - * @param axis Axis corresponding to the matrix rows. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def linalg_gemm (A : Option[org.apache.mxnet.Symbol] = None, B : Option[org.apache.mxnet.Symbol] = None, C : Option[org.apache.mxnet.Symbol] = None, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, alpha : Option[Double] = None, beta : Option[Double] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Performs general matrix multiplication.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
- *
- * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
- * transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = gemm2(A1, B1)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
- *
- * // Batch matrix multiply
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[[4.0]], [[0.04 ]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L151
- * @param A Tensor of input matrices - * @param B Tensor of input matrices - * @param transpose_a Multiply with transposed of first input (A). - * @param transpose_b Multiply with transposed of second input (B). - * @param alpha Scalar factor multiplied with A*B. - * @param axis Axis corresponding to the matrix row indices. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def linalg_gemm2 (A : Option[org.apache.mxnet.Symbol] = None, B : Option[org.apache.mxnet.Symbol] = None, transpose_a : Option[Boolean] = None, transpose_b : Option[Boolean] = None, alpha : Option[Double] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Performs Cholesky factorization of a symmetric positive-definite matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
- * computed. *L* is lower triangular (entries of upper triangle are all zero), has
- * positive diagonal entries, and:
- *
- * *A* = *L* \* *L*\ :sup:`T`
- *
- * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix factorization
- * A = [[4.0, 1.0], [1.0, 4.25]]
- * potrf(A) = [[2.0, 0], [0.5, 2.0]]
- *
- * // Batch matrix factorization
- * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
- * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L201
- * @param A Tensor of input matrices to be decomposed - * @return org.apache.mxnet.Symbol - */ -@Experimental -def linalg_potrf (A : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Performs matrix inversion from a Cholesky factorization.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
- * with positive diagonal. We compute:
- *
- * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
- *
- * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
- * *B* (obtained by *potrf*), then
- *
- * *out* = *B*\ :sup:`-1`
- *
- * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
- * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
- * (*trsm*). The latter is numerically much safer, and also cheaper.
- *
- * Examples::
- *
- * // Single matrix inverse
- * A = [[2.0, 0], [0.5, 2.0]]
- * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
- *
- * // Batch matrix inverse
- * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
- * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L259
- * @param A Tensor of lower triangular matrices - * @return org.apache.mxnet.Symbol - */ -@Experimental -def linalg_potri (A : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the sum of the logarithms of the diagonal elements of a square matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
- * logarithms of the diagonal elements, the result has shape (1,).
- *
- * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix reduction
- * A = [[1.0, 1.0], [1.0, 7.0]]
- * sumlogdiag(A) = [1.9459]
- *
- * // Batch matrix reduction
- * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
- * sumlogdiag(A) = [1.9459, 3.9318]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L428
- * @param A Tensor of square matrices - * @return org.apache.mxnet.Symbol - */ -@Experimental -def linalg_sumlogdiag (A : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Multiplication of matrix with its transpose.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the operator performs the BLAS3 function *syrk*:
- *
- * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
- *
- * if *transpose=False*, or
- *
- * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
- *
- * if *transpose=True*.
- *
- * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * syrk(A, alpha=1., transpose=False)
- * = [[14., 32.],
- * [32., 77.]]
- * syrk(A, alpha=1., transpose=True)
- * = [[17., 22., 27.],
- * [22., 29., 36.],
- * [27., 36., 45.]]
- *
- * // Batch matrix multiply
- * A = [[[1., 1.]], [[0.1, 0.1]]]
- * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L484
- * @param A Tensor of input matrices - * @param transpose Use transpose of input matrix. - * @param alpha Scalar factor to be applied to the result. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def linalg_syrk (A : Option[org.apache.mxnet.Symbol] = None, transpose : Option[Boolean] = None, alpha : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Performs multiplication with a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trmm*:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* = *alpha* \* *B* \* *op*\ (*A*)
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- *
- * Examples::
- *
- * // Single triangular matrix multiply
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- *
- * // Batch triangular matrix multiply
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
- * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L316
- * @param A Tensor of lower triangular matrices - * @param B Tensor of matrices - * @param transpose Use transposed of the triangular matrix - * @param rightside Multiply triangular matrix from the right to non-triangular one. - * @param alpha Scalar factor to be applied to the result. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def linalg_trmm (A : Option[org.apache.mxnet.Symbol] = None, B : Option[org.apache.mxnet.Symbol] = None, transpose : Option[Boolean] = None, rightside : Option[Boolean] = None, alpha : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Solves matrix equation involving a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trsm*, solving for *out* in:
- *
- * *op*\ (*A*) \* *out* = *alpha* \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* \* *op*\ (*A*) = *alpha* \* *B*
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix solve
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- *
- * // Batch matrix solve
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
- * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
- * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L379
- * @param A Tensor of lower triangular matrices - * @param B Tensor of matrices - * @param transpose Use transposed of the triangular matrix - * @param rightside Multiply triangular matrix from the right to non-triangular one. - * @param alpha Scalar factor to be applied to the result. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def linalg_trsm (A : Option[org.apache.mxnet.Symbol] = None, B : Option[org.apache.mxnet.Symbol] = None, transpose : Option[Boolean] = None, rightside : Option[Boolean] = None, alpha : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise Natural logarithmic value of the input.
- *
- * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
- *
- * The storage type of ``log`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def log (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise Base-10 logarithmic value of the input.
- *
- * ``10**log10(x) = x``
- *
- * The storage type of ``log10`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def log10 (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise ``log(1 + x)`` value of the input.
- *
- * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
- * :math:`1+x\approx 1`
- *
- * The storage type of ``log1p`` output depends upon the input storage type:
- *
- * - log1p(default) = default
- * - log1p(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def log1p (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise Base-2 logarithmic value of the input.
- *
- * ``2**log2(x) = x``
- *
- * The storage type of ``log2`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def log2 (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the log softmax of the input.
- * This is equivalent to computing softmax followed by log.
- *
- * Examples::
- *
- * >>> x = mx.nd.array([1, 2, .1])
- * >>> mx.nd.log_softmax(x).asnumpy()
- * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
- *
- * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
- * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
- * array([[-0.34115392, -0.69314718, -1.24115396],
- * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
- * @param data The input array. - * @param axis The axis along which to compute softmax. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def log_softmax (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the result of logical NOT (!) function
- *
- * Example:
- * logical_not([-2., 0., 1.]) = [0., 1., 0.]
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def logical_not (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = make_loss(cross_entropy)
- *
- * We will need to use ``make_loss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * The storage type of ``make_loss`` output depends upon the input storage type:
- *
- * - make_loss(default) = default
- * - make_loss(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def make_loss (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def max (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def max_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the mean of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def mean (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def min (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def min_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Updater function for multi-precision sgd optimizer
- * @param weight Weight - * @param grad Gradient - * @param mom Momentum - * @param weight32 Weight32 - * @param lr Learning rate - * @param momentum The decay rate of momentum estimates at each epoch. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and both weight and momentum have the same stype - * @return org.apache.mxnet.Symbol - */ -@Experimental -def mp_sgd_mom_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, mom : Option[org.apache.mxnet.Symbol] = None, weight32 : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Updater function for multi-precision sgd optimizer
- * @param weight Weight - * @param grad gradient - * @param weight32 Weight32 - * @param lr Learning rate - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def mp_sgd_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, weight32 : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def nanprod (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def nansum (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Numerical negative of the argument, element-wise.
- *
- * The storage type of ``negative`` output depends upon the input storage type:
- *
- * - negative(default) = default
- * - negative(row_sparse) = row_sparse
- * - negative(csr) = csr
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def negative (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the norm on an NDArray.
- *
- * This operator computes the norm on an NDArray with the specified axis, depending
- * on the value of the ord parameter. By default, it computes the L2 norm on the entire
- * array.
- *
- * Examples::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * norm(x) = [5.47722578]
- *
- * rsp = x.cast_storage('row_sparse')
- *
- * norm(rsp) = [5.47722578]
- *
- * csr = x.cast_storage('csr')
- *
- * norm(csr) = [5.47722578]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
- * @param data The input - * @param ord Order of the norm. Currently ord=2 is supported. - * @param axis The axis or axes along which to perform the reduction. - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - If `axis` is int, a reduction is performed on a particular axis. - If `axis` is a 2-tuple, it specifies the axes that hold 2-D matrices, - and the matrix norms of these matrices are computed. - * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def norm (data : Option[org.apache.mxnet.Symbol] = None, ord : Option[Int] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @param loc Mean of the distribution. - * @param scale Standard deviation of the distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def normal (loc : Option[org.apache.mxnet.Base.MXFloat] = None, scale : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns a one-hot array.
- *
- * The locations represented by `indices` take value `on_value`, while all
- * other locations take value `off_value`.
- *
- * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
- * in an output array of shape ``(i0, i1, d)`` with::
- *
- * output[i,j,:] = off_value
- * output[i,j,indices[i,j]] = on_value
- *
- * Examples::
- *
- * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
- * [ 1. 0. 0.]
- * [ 0. 0. 1.]
- * [ 1. 0. 0.]]
- *
- * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
- * dtype='int32') = [[1 8 1]
- * [8 1 1]
- * [1 1 8]
- * [8 1 1]]
- *
- * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 0. 1.]
- * [ 1. 0. 0.]]]
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L490
- * @param indices array of locations where to set on_value - * @param depth Depth of the one hot dimension. - * @param on_value The value assigned to the locations represented by indices. - * @param off_value The value assigned to the locations not represented by indices. - * @param dtype DType of the output - * @return org.apache.mxnet.Symbol - */ -@Experimental -def one_hot (indices : Option[org.apache.mxnet.Symbol] = None, depth : Int, on_value : Option[Double] = None, off_value : Option[Double] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Return an array of ones with the same shape and type
- * as the input array.
- *
- * Examples::
- *
- * x = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * ones_like(x) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- * @param data The input - * @return org.apache.mxnet.Symbol - */ -@Experimental -def ones_like (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @param data An n-dimensional input array. - * @param mode Padding type to use. "constant" pads with `constant_value` "edge" pads using the edge values of the input array "reflect" pads by reflecting values with respect to the edges. - * @param pad_width Widths of the padding regions applied to the edges of each axis. It is a tuple of integer padding widths for each axis of the format ``(before_1, after_1, ... , before_N, after_N)``. It should be of length ``2*N`` where ``N`` is the number of dimensions of the array.This is equivalent to pad_width in numpy.pad, but flattened. - * @param constant_value The value used for padding when `mode` is "constant". - * @return org.apache.mxnet.Symbol - */ -@Experimental -def pad (data : Option[org.apache.mxnet.Symbol] = None, mode : String, pad_width : org.apache.mxnet.Shape, constant_value : Option[Double] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Picks elements from an input array according to the input indices along the given axis.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last element along an axis (the `clip` mode).
- *
- * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // picks elements with specified indices along axis 0
- * pick(x, y=[0,1], 0) = [ 1., 4.]
- *
- * // picks elements with specified indices along axis 1
- * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
- *
- * y = [[ 1.],
- * [ 0.],
- * [ 2.]]
- *
- * // picks elements with specified indices along axis 1 and dims are maintained
- * pick(x,y, 1, keepdims=True) = [[ 2.],
- * [ 3.],
- * [ 6.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
- * @param data The input array - * @param index The index array - * @param axis The axis along which to perform the reduction. Negative values means indexing from right to left. ``Requires axis to be set as int, because global reduction is not supported yet.`` - * @param keepdims If this is set to `True`, the reduced axis is left in the result as dimension with size one. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def pick (data : Option[org.apache.mxnet.Symbol] = None, index : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, keepdims : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the product of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def prod (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Converts each element of the input array from degrees to radians.
- *
- * .. math::
- * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
- *
- * The storage type of ``radians`` output depends upon the input storage type:
- *
- * - radians(default) = default
- * - radians(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def radians (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Draw random samples from an exponential distribution.
- *
- * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
- *
- * Example::
- *
- * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
- * [ 0.04146638, 0.31715935]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L115
- * @param lam Lambda parameter (rate) of the exponential distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def random_exponential (lam : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Draw random samples from a gamma distribution.
- *
- * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
- *
- * Example::
- *
- * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
- * [ 3.91697288, 3.65933681]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L100
- * @param alpha Alpha parameter (shape) of the gamma distribution. - * @param beta Beta parameter (scale) of the gamma distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def random_gamma (alpha : Option[org.apache.mxnet.Base.MXFloat] = None, beta : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Draw random samples from a generalized negative binomial distribution.
- *
- * Samples are distributed according to a generalized negative binomial distribution parametrized by
- * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
- * number of unsuccessful experiments (generalized to real numbers).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
- * [ 6., 4.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L168
- * @param mu Mean of the negative binomial distribution. - * @param alpha Alpha (dispersion) parameter of the negative binomial distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def random_generalized_negative_binomial (mu : Option[org.apache.mxnet.Base.MXFloat] = None, alpha : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Draw random samples from a negative binomial distribution.
- *
- * Samples are distributed according to a negative binomial distribution parametrized by
- * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
- * [ 2., 5.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L149
- * @param k Limit of unsuccessful experiments. - * @param p Failure probability in each experiment. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def random_negative_binomial (k : Option[Int] = None, p : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @param loc Mean of the distribution. - * @param scale Standard deviation of the distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def random_normal (loc : Option[org.apache.mxnet.Base.MXFloat] = None, scale : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Draw random samples from a Poisson distribution.
- *
- * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
- * [ 4., 6.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L132
- * @param lam Lambda parameter (rate) of the Poisson distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def random_poisson (lam : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @param low Lower bound of the distribution. - * @param high Upper bound of the distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def random_uniform (low : Option[org.apache.mxnet.Base.MXFloat] = None, high : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
- *
- * Examples::
- *
- * A = [[3,6,6],[4,5,1]]
- * ravel(A, shape=(7,6)) = [22,41,37]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L41
- * @param data Batch of multi-indices - * @param shape Shape of the array into which the multi-indices apply. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def ravel_multi_index (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise inverse cube-root value of the input.
- *
- * .. math::
- * rcbrt(x) = 1/\sqrt[3]{x}
- *
- * Example::
- *
- * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def rcbrt (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the reciprocal of the argument, element-wise.
- *
- * Calculates 1/x.
- *
- * Example::
- *
- * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def reciprocal (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes rectified linear.
- *
- * .. math::
- * max(features, 0)
- *
- * The storage type of ``relu`` output depends upon the input storage type:
- *
- * - relu(default) = default
- * - relu(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def relu (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Repeats elements of an array.
- *
- * By default, ``repeat`` flattens the input array into 1-D and then repeats the
- * elements::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
- *
- * The parameter ``axis`` specifies the axis along which to perform repeat::
- *
- * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
- * [ 1., 2.],
- * [ 3., 4.],
- * [ 3., 4.]]
- *
- * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L690
- * @param data Input data array - * @param repeats The number of repetitions for each element. - * @param axis The axis along which to repeat values. The negative numbers are interpreted counting from the backward. By default, use the flattened input array, and return a flat output array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def repeat (data : Option[org.apache.mxnet.Symbol] = None, repeats : Int, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @param data Input data to reshape. - * @param shape The target shape - * @param reverse If true then the special values are inferred from right to left - * @param target_shape (Deprecated! Use ``shape`` instead.) Target new shape. One and only one dim can be 0, in which case it will be inferred from the rest of dims - * @param keep_highest (Deprecated! Use ``shape`` instead.) Whether keep the highest dim unchanged.If set to true, then the first dim in target_shape is ignored,and always fixed as input - * @return org.apache.mxnet.Symbol - */ -@Experimental -def reshape (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, reverse : Option[Boolean] = None, target_shape : Option[org.apache.mxnet.Shape] = None, keep_highest : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Reshape lhs to have the same shape as rhs.
- * @param lhs First input. - * @param rhs Second input. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def reshape_like (lhs : Option[org.apache.mxnet.Symbol] = None, rhs : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @param data Input data array - * @param axis The axis which to reverse elements. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def reverse (data : Option[org.apache.mxnet.Symbol] = None, axis : org.apache.mxnet.Shape, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * .. note::
- * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
- * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
- *
- * Example::
- *
- * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
- *
- * The storage type of ``rint`` output depends upon the input storage type:
- *
- * - rint(default) = default
- * - rint(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def rint (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Update function for `RMSProp` optimizer.
- *
- * `RMSprop` is a variant of stochastic gradient descent where the gradients are
- * divided by a cache which grows with the sum of squares of recent gradients?
- *
- * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
- * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
- * each parameter monotonically over the course of training.
- * While this is analytically motivated for convex optimizations, it may not be ideal
- * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
- * learning rates to rebound as the denominator decays over time.
- *
- * Define the Root Mean Square (RMS) error criterion of the gradient as
- * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
- * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
- *
- * The :math:`E[g^2]_t` is given by:
- *
- * .. math::
- * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
- *
- * The RMSProp code follows the version in
- * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
- * Tieleman & Hinton, 2012.
- *
- * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
- * :math:`\eta` to be 0.001.
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L553
- * @param weight Weight - * @param grad Gradient - * @param n n - * @param lr Learning rate - * @param gamma1 The decay rate of momentum estimates. - * @param epsilon A small constant for numerical stability. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param clip_weights Clip weights to the range of [-clip_weights, clip_weights] If clip_weights <= 0, weight clipping is turned off. weights = max(min(weights, clip_weights), -clip_weights). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def rmsprop_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, n : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, gamma1 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, clip_weights : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Update function for RMSPropAlex optimizer.
- *
- * `RMSPropAlex` is non-centered version of `RMSProp`.
- *
- * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
- * :math:`E[g]_t` is the decaying average over past gradient.
- *
- * .. math::
- * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
- * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
- * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t + \Delta_t
- *
- * The RMSPropAlex code follows the version in
- * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
- *
- * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
- * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L592
- * @param weight Weight - * @param grad Gradient - * @param n n - * @param g g - * @param delta delta - * @param lr Learning rate - * @param gamma1 Decay rate. - * @param gamma2 Decay rate. - * @param epsilon A small constant for numerical stability. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param clip_weights Clip weights to the range of [-clip_weights, clip_weights] If clip_weights <= 0, weight clipping is turned off. weights = max(min(weights, clip_weights), -clip_weights). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def rmspropalex_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, n : Option[org.apache.mxnet.Symbol] = None, g : Option[org.apache.mxnet.Symbol] = None, delta : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, gamma1 : Option[org.apache.mxnet.Base.MXFloat] = None, gamma2 : Option[org.apache.mxnet.Base.MXFloat] = None, epsilon : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, clip_weights : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * Example::
- *
- * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
- *
- * The storage type of ``round`` output depends upon the input storage type:
- *
- * - round(default) = default
- * - round(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def round (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise inverse square-root value of the input.
- *
- * .. math::
- * rsqrt(x) = 1/\sqrt{x}
- *
- * Example::
- *
- * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
- *
- * The storage type of ``rsqrt`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def rsqrt (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * exponential distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_exponential(lam) = [ 0.51837951, 0.09994757]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
- * [ 0.09994757, 0.50447971]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L284
- * @param lam Lambda (rate) parameters of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sample_exponential (lam : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * alpha = [ 0.0, 2.5 ]
- * beta = [ 1.0, 0.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
- * [ 2.25797319, 1.70734084]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L282
- * @param alpha Alpha (shape) parameters of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param beta Beta (scale) parameters of the distributions. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sample_gamma (alpha : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, beta : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * mu = [ 2.0, 2.5 ]
- * alpha = [ 1.0, 0.1 ]
- *
- * // Draw a single sample for each distribution
- * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
- * [ 3., 1.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L293
- * @param mu Means of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param alpha Alpha (dispersion) parameters of the distributions. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sample_generalized_negative_binomial (mu : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, alpha : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple multinomial distributions.
- *
- * *data* is an *n* dimensional array whose last dimension has length *k*, where
- * *k* is the number of possible outcomes of each multinomial distribution. This
- * operator will draw *shape* samples from each distribution. If shape is empty
- * one sample will be drawn from each distribution.
- *
- * If *get_prob* is true, a second array containing log likelihood of the drawn
- * samples will also be returned. This is usually used for reinforcement learning
- * where you can provide reward as head gradient for this array to estimate
- * gradient.
- *
- * Note that the input distribution must be normalized, i.e. *data* must sum to
- * 1 along its last axis.
- *
- * Examples::
- *
- * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
- *
- * // Draw a single sample for each distribution
- * sample_multinomial(probs) = [3, 0]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_multinomial(probs, shape=(2)) = [[4, 2],
- * [0, 0]]
- *
- * // requests log likelihood
- * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
- * @param data Distribution probabilities. Must sum to one on the last axis. - * @param shape Shape to be sampled from each random distribution. - * @param get_prob Whether to also return the log probability of sampled result. This is usually used for differentiating through stochastic variables, e.g. in reinforcement learning. - * @param dtype DType of the output in case this can't be inferred. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sample_multinomial (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, get_prob : Option[Boolean] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * k = [ 20, 49 ]
- * p = [ 0.4 , 0.77 ]
- *
- * // Draw a single sample for each distribution
- * sample_negative_binomial(k, p) = [ 15., 16.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
- * [ 16., 12.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L289
- * @param k Limits of unsuccessful experiments. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param p Failure probabilities in each experiment. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sample_negative_binomial (k : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, p : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * mu = [ 0.0, 2.5 ]
- * sigma = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
- * [ 0.95934606, 4.48287058]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L279
- * @param mu Means of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param sigma Standard deviations of the distributions. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sample_normal (mu : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, sigma : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * Poisson distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_poisson(lam) = [ 0., 13.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
- * [ 13., 8.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L286
- * @param lam Lambda (rate) parameters of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sample_poisson (lam : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * uniform distributions on the intervals given by *[low,high)*.
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * low = [ 0.0, 2.5 ]
- * high = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
- * [ 3.18687344, 3.68352246]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L277
- * @param low Lower bounds of the distributions. - * @param shape Shape to be sampled from each random distribution. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @param high Upper bounds of the distributions. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sample_uniform (low : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, dtype : Option[String] = None, high : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Scatters data into a new tensor according to indices.
- *
- * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
- *
- * all other entries in output are 0.
- *
- * .. warning::
- *
- * If the indices have duplicates, the result will be non-deterministic and
- * the gradient of `scatter_nd` will not be correct!!
- *
- *
- * Examples::
- *
- * data = [2, 3, 0]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * shape = (2, 2)
- * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
- * @param data data - * @param indices indices - * @param shape Shape of output. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def scatter_nd (data : Option[org.apache.mxnet.Symbol] = None, indices : Option[org.apache.mxnet.Symbol] = None, shape : org.apache.mxnet.Shape, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
- *
- * Momentum update has better convergence rates on neural networks. Mathematically it looks
- * like below:
- *
- * .. math::
- *
- * v_1 = \alpha * \nabla J(W_0)\\
- * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
- * W_t = W_{t-1} + v_t
- *
- * It updates the weights using::
- *
- * v = momentum * v - learning_rate * gradient
- * weight += v
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
- * type is the same as momentum's storage type,
- * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
- *
- * for row in gradient.indices:
- * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
- * weight[row] += v[row]
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L372
- * @param weight Weight - * @param grad Gradient - * @param mom Momentum - * @param lr Learning rate - * @param momentum The decay rate of momentum estimates at each epoch. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse and both weight and momentum have the same stype - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sgd_mom_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, mom : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Update function for Stochastic Gradient Descent (SDG) optimizer.
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * (gradient + wd * weight)
- *
- * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
- * only the row slices whose indices appear in grad.indices are updated::
- *
- * for row in gradient.indices:
- * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L331
- * @param weight Weight - * @param grad Gradient - * @param lr Learning rate - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param lazy_update If true, lazy updates are applied if gradient's stype is row_sparse. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sgd_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, lazy_update : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Randomly shuffle the elements.
- *
- * This shuffles the array along the first axis.
- * The order of the elements in each subarray does not change.
- * For example, if a 2D array is given, the order of the rows randomly changes,
- * but the order of the elements in each row does not change.
- * @param data Data to be shuffled. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def shuffle (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes sigmoid of x element-wise.
- *
- * .. math::
- * y = 1 / (1 + exp(-x))
- *
- * The storage type of ``sigmoid`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sigmoid (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise sign of the input.
- *
- * Example::
- *
- * sign([-2, 0, 3]) = [-1, 0, 1]
- *
- * The storage type of ``sign`` output depends upon the input storage type:
- *
- * - sign(default) = default
- * - sign(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sign (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Update function for SignSGD optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * sign(gradient)
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L57
- * @param weight Weight - * @param grad Gradient - * @param lr Learning rate - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def signsgd_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * SIGN momentUM (Signum) optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
- * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
- *
- * It updates the weights using::
- * state = momentum * state + (1-momentum) * gradient
- * weight = weight - learning_rate * sign(state)
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L86
- * @param weight Weight - * @param grad Gradient - * @param mom Momentum - * @param lr Learning rate - * @param momentum The decay rate of momentum estimates at each epoch. - * @param wd Weight decay augments the objective function with a regularization term that penalizes large weights. The penalty scales with the square of the magnitude of each weight. - * @param rescale_grad Rescale gradient to grad = rescale_grad*grad. - * @param clip_gradient Clip gradient to the range of [-clip_gradient, clip_gradient] If clip_gradient <= 0, gradient clipping is turned off. grad = max(min(grad, clip_gradient), -clip_gradient). - * @param wd_lh The amount of weight decay that does not go into gradient/momentum calculationsotherwise do weight decay algorithmically only. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def signum_update (weight : Option[org.apache.mxnet.Symbol] = None, grad : Option[org.apache.mxnet.Symbol] = None, mom : Option[org.apache.mxnet.Symbol] = None, lr : org.apache.mxnet.Base.MXFloat, momentum : Option[org.apache.mxnet.Base.MXFloat] = None, wd : Option[org.apache.mxnet.Base.MXFloat] = None, rescale_grad : Option[org.apache.mxnet.Base.MXFloat] = None, clip_gradient : Option[org.apache.mxnet.Base.MXFloat] = None, wd_lh : Option[org.apache.mxnet.Base.MXFloat] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the element-wise sine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
- *
- * The storage type of ``sin`` output depends upon the input storage type:
- *
- * - sin(default) = default
- * - sin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sin (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the hyperbolic sine of the input array, computed element-wise.
- *
- * .. math::
- * sinh(x) = 0.5\times(exp(x) - exp(-x))
- *
- * The storage type of ``sinh`` output depends upon the input storage type:
- *
- * - sinh(default) = default
- * - sinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sinh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @param data Source input - * @param begin starting indices for the slice operation, supports negative indices. - * @param end ending indices for the slice operation, supports negative indices. - * @param step step for the slice operation, supports negative values. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def slice (data : Option[org.apache.mxnet.Symbol] = None, begin : org.apache.mxnet.Shape, end : org.apache.mxnet.Shape, step : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Slices along a given axis.
- *
- * Returns an array slice along a given `axis` starting from the `begin` index
- * to the `end` index.
- *
- * Examples::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
- * [ 5., 6.],
- * [ 9., 10.]]
- *
- * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
- * [ 6., 7.],
- * [ 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L499
- * @param data Source input - * @param axis Axis along which to be sliced, supports negative indexes. - * @param begin The beginning index along the axis to be sliced, supports negative indexes. - * @param end The ending index along the axis to be sliced, supports negative indexes. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def slice_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Int, begin : Int, end : Int, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Slices a region of the array like the shape of another array.
- *
- * This function is similar to ``slice``, however, the `begin` are always `0`s
- * and `end` of specific axes are inferred from the second input `shape_like`.
- *
- * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
- * a ``slice_like`` operator with default empty `axes`, it performs the
- * following operation:
- *
- * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
- *
- * When `axes` is not empty, it is used to speficy which axes are being sliced.
- *
- * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
- * will perform the following operation:
- *
- * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
- *
- * Note that it is allowed to have first and second input with different dimensions,
- * however, you have to make sure the `axes` are specified and not exceeding the
- * dimension limits.
- *
- * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
- * ``shape=(1,2,3)``, it is not allowed to use:
- *
- * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
- * is 3.
- *
- * The following is allowed in this situation:
- *
- * `` out = slice_like(a, b, axes=(0, 2))``
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * y = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * slice_like(x, y) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
- * [ 5., 6., 7., 8.]]
- * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]
- * [ 9., 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L568
- * @param data Source input - * @param shape_like Shape like input - * @param axes List of axes on which input data will be sliced according to the corresponding size of the second input. By default will slice on all axes. Negative axes are supported. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def slice_like (data : Option[org.apache.mxnet.Symbol] = None, shape_like : Option[org.apache.mxnet.Symbol] = None, axes : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Calculate Smooth L1 Loss(lhs, scalar) by summing
- *
- * .. math::
- *
- * f(x) =
- * \begin{cases}
- * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
- * |x|-0.5/\sigma^2,& \text{otherwise}
- * \end{cases}
- *
- * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
- *
- * Example::
- *
- * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
- * @param data source input - * @param scalar scalar input - * @return org.apache.mxnet.Symbol - */ -@Experimental -def smooth_l1 (data : Option[org.apache.mxnet.Symbol] = None, scalar : org.apache.mxnet.Base.MXFloat, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Applies the softmax function.
- *
- * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
- *
- * .. math::
- * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
- *
- * for :math:`j = 1, ..., K`
- *
- * Example::
- *
- * x = [[ 1. 1. 1.]
- * [ 1. 1. 1.]]
- *
- * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
- * [ 0.5 0.5 0.5]]
- *
- * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
- * [ 0.33333334, 0.33333334, 0.33333334]]
- *
- *
- *
- * Defined in src/operator/nn/softmax.cc:L95
- * @param data The input array. - * @param axis The axis along which to compute softmax. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def softmax (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Calculate cross entropy of softmax output and one-hot label.
- *
- * - This operator computes the cross entropy in two steps:
- * - Applies softmax function on the input array.
- * - Computes and returns the cross entropy loss between the softmax output and the labels.
- *
- * - The softmax function and cross entropy loss is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * Example::
- *
- * x = [[1, 2, 3],
- * [11, 7, 5]]
- *
- * label = [2, 0]
- *
- * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
- * [0.97962922, 0.01794253, 0.00242826]]
- *
- * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
- *
- *
- *
- * Defined in src/operator/loss_binary_op.cc:L59
- * @param data Input data - * @param label Input label - * @return org.apache.mxnet.Symbol - */ -@Experimental -def softmax_cross_entropy (data : Option[org.apache.mxnet.Symbol] = None, label : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes softsign of x element-wise.
- *
- * .. math::
- * y = x / (1 + abs(x))
- *
- * The storage type of ``softsign`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def softsign (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns a sorted copy of an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 1, 4],
- * [ 3, 1]]
- *
- * // sorts along the last axis
- * sort(x) = [[ 1., 4.],
- * [ 1., 3.]]
- *
- * // flattens and then sorts
- * sort(x) = [ 1., 1., 3., 4.]
- *
- * // sorts along the first axis
- * sort(x, axis=0) = [[ 1., 1.],
- * [ 3., 4.]]
- *
- * // in a descend order
- * sort(x, is_ascend=0) = [[ 4., 1.],
- * [ 3., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L126
- * @param data The input array - * @param axis Axis along which to choose sort the input tensor. If not given, the flattened array is used. Default is -1. - * @param is_ascend Whether to sort in ascending or descending order. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sort (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, is_ascend : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @param data The input - * @param num_outputs Number of splits. Note that this should evenly divide the length of the `axis`. - * @param axis Axis along which to split. - * @param squeeze_axis If true, Removes the axis with length 1 from the shapes of the output arrays. **Note** that setting `squeeze_axis` to ``true`` removes axis with length 1 only along the `axis` which it is split. Also `squeeze_axis` can be set to ``true`` only if ``input.shape[axis] == num_outputs``. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def split (data : Option[org.apache.mxnet.Symbol] = None, num_outputs : Int, axis : Option[Int] = None, squeeze_axis : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise square-root value of the input.
- *
- * .. math::
- * \textrm{sqrt}(x) = \sqrt{x}
- *
- * Example::
- *
- * sqrt([4, 9, 16]) = [2, 3, 4]
- *
- * The storage type of ``sqrt`` output depends upon the input storage type:
- *
- * - sqrt(default) = default
- * - sqrt(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sqrt (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns element-wise squared value of the input.
- *
- * .. math::
- * square(x) = x^2
- *
- * Example::
- *
- * square([2, 3, 4]) = [4, 9, 16]
- *
- * The storage type of ``square`` output depends upon the input storage type:
- *
- * - square(default) = default
- * - square(row_sparse) = row_sparse
- * - square(csr) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def square (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Remove single-dimensional entries from the shape of an array.
- * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
- * See the following note for exception.
- *
- * Examples::
- *
- * data = [[[0], [1], [2]]]
- * squeeze(data) = [0, 1, 2]
- * squeeze(data, axis=0) = [[0], [1], [2]]
- * squeeze(data, axis=2) = [[0, 1, 2]]
- * squeeze(data, axis=(0, 2)) = [0, 1, 2]
- *
- * .. Note::
- * The output of this operator will keep at least one dimension not removed. For example,
- * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
- * @param data data to squeeze - * @param axis Selects a subset of the single-dimensional entries in the shape. If an axis is selected with shape entry greater than one, an error is raised. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def squeeze (data : Array[org.apache.mxnet.Symbol], axis : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Join a sequence of arrays along a new axis.
- *
- * The axis parameter specifies the index of the new axis in the dimensions of the
- * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
- * will be the last dimension.
- *
- * Examples::
- *
- * x = [1, 2]
- * y = [3, 4]
- *
- * stack(x, y) = [[1, 2],
- * [3, 4]]
- * stack(x, y, axis=1) = [[1, 3],
- * [2, 4]]
- * @param data List of arrays to stack - * @param axis The axis in the result array along which the input arrays are stacked. - * @param num_args Number of inputs to be stacked. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def stack (data : Array[org.apache.mxnet.Symbol], axis : Option[Int] = None, num_args : Int, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def stop_gradient (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sum (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @param data The input - * @param axis The axis or axes along which to perform the reduction. - - The default, `axis=()`, will compute over all elements into a - scalar array with shape `(1,)`. - - If `axis` is int, a reduction is performed on a particular axis. - - If `axis` is a tuple of ints, a reduction is performed on all the axes - specified in the tuple. - - If `exclude` is true, reduction will be performed on the axes that are - NOT in axis instead. - - Negative values means indexing from right to left. - * @param keepdims If this is set to `True`, the reduced axes are left in the result as dimension with size one. - * @param exclude Whether to perform reduction on axis that are NOT in axis instead. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def sum_axis (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[org.apache.mxnet.Shape] = None, keepdims : Option[Boolean] = None, exclude : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @param data Input array. - * @param dim1 the first axis to be swapped. - * @param dim2 the second axis to be swapped. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def swapaxes (data : Option[org.apache.mxnet.Symbol] = None, dim1 : Option[Int] = None, dim2 : Option[Int] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Takes elements from an input array along the given axis.
- *
- * This function slices the input array along a particular axis with the provided indices.
- *
- * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
- * will have shape ``(i0, i1, d1, d2)``, computed by::
- *
- * output[i,j,:,:] = input[indices[i,j],:,:]
- *
- * .. note::
- * - `axis`- Only slicing along axis 0 is supported for now.
- * - `mode`- Only `clip` mode is supported for now.
- *
- * Examples::
- * x = [4. 5. 6.]
- *
- * // Trivial case, take the second element along the first axis.
- * take(x, [1]) = [ 5. ]
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
- * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 3., 4.],
- * [ 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L389
- * @param a The input array. - * @param indices The indices of the values to be extracted. - * @param axis The axis of input array to be taken. - * @param mode Specify how out-of-bound indices bahave. "clip" means clip to the range. So, if all indices mentioned are too large, they are replaced by the index that addresses the last element along an axis. "wrap" means to wrap around. "raise" means to raise an error. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def take (a : Option[org.apache.mxnet.Symbol] = None, indices : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, mode : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Computes the element-wise tangent of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
- *
- * The storage type of ``tan`` output depends upon the input storage type:
- *
- * - tan(default) = default
- * - tan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def tan (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the hyperbolic tangent of the input array, computed element-wise.
- *
- * .. math::
- * tanh(x) = sinh(x) / cosh(x)
- *
- * The storage type of ``tanh`` output depends upon the input storage type:
- *
- * - tanh(default) = default
- * - tanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def tanh (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Repeats the whole array multiple times.
- *
- * If ``reps`` has length *d*, and input array has dimension of *n*. There are
- * three cases:
- *
- * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]
- *
- * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
- * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
- *
- *
- * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
- * [ 3., 4., 3., 4.]]
- *
- * - **n - * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
- *
- * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]],
- *
- * [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L751
- * @param data Input data array - * @param reps The number of times for repeating the tensor a. Each dim size of reps must be a positive integer. If reps has length d, the result will have dimension of max(d, a.ndim); If a.ndim < d, a is promoted to be d-dimensional by prepending new axes. If a.ndim > d, reps is promoted to a.ndim by pre-pending 1's to it. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def tile (data : Option[org.apache.mxnet.Symbol] = None, reps : org.apache.mxnet.Shape, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Returns the top *k* elements in an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // returns an index of the largest element on last axis
- * topk(x) = [[ 2.],
- * [ 1.]]
- *
- * // returns the value of top-2 largest elements on last axis
- * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
- * [ 0.3, 0.2]]
- *
- * // returns the value of top-2 smallest elements on last axis
- * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
- * [ 0.1 , 0.2]]
- *
- * // returns the value of top-2 largest elements on axis 0
- * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
- * [ 0.1, 0.2, 0.2]]
- *
- * // flattens and then returns list of both values and indices
- * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L63
- * @param data The input array - * @param axis Axis along which to choose the top k indices. If not given, the flattened array is used. Default is -1. - * @param k Number of top elements to select, should be always smaller than or equal to the element number in the given axis. A global sort is performed if set k < 1. - * @param ret_typ The return type. - "value" means to return the top k values, "indices" means to return the indices of the top k values, "mask" means to return a mask array containing 0 and 1. 1 means the top k values. "both" means to return a list of both values and indices of top k elements. - * @param is_ascend Whether to choose k largest or k smallest elements. Top K largest elements will be chosen if set to false. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def topk (data : Option[org.apache.mxnet.Symbol] = None, axis : Option[Int] = None, k : Option[Int] = None, ret_typ : Option[String] = None, is_ascend : Option[Boolean] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Permutes the dimensions of an array.
- *
- * Examples::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * transpose(x) = [[ 1., 3.],
- * [ 2., 4.]]
- *
- * x = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 5., 6.],
- * [ 7., 8.]]]
- *
- * transpose(x) = [[[ 1., 5.],
- * [ 3., 7.]],
- *
- * [[ 2., 6.],
- * [ 4., 8.]]]
- *
- * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
- * [ 5., 6.]],
- *
- * [[ 3., 4.],
- * [ 7., 8.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L310
- * @param data Source input - * @param axes Target axis order. By default the axes will be inverted. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def transpose (data : Option[org.apache.mxnet.Symbol] = None, axes : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Return the element-wise truncated value of the input.
- *
- * The truncated value of the scalar x is the nearest integer i which is closer to
- * zero than x is. In short, the fractional part of the signed number x is discarded.
- *
- * Example::
- *
- * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
- *
- * The storage type of ``trunc`` output depends upon the input storage type:
- *
- * - trunc(default) = default
- * - trunc(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
- * @param data The input array. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def trunc (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @param low Lower bound of the distribution. - * @param high Upper bound of the distribution. - * @param shape Shape of the output. - * @param ctx Context of output, in format [cpu|gpu|cpu_pinned](n). Only used for imperative calls. - * @param dtype DType of the output in case this can't be inferred. Defaults to float32 if not defined (dtype=None). - * @return org.apache.mxnet.Symbol - */ -@Experimental -def uniform (low : Option[org.apache.mxnet.Base.MXFloat] = None, high : Option[org.apache.mxnet.Base.MXFloat] = None, shape : Option[org.apache.mxnet.Shape] = None, ctx : Option[String] = None, dtype : Option[String] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
- *
- * Examples::
- *
- * A = [22,41,37]
- * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L65
- * @param data Array of flat indices - * @param shape Shape of the array into which the multi-indices apply. - * @return org.apache.mxnet.Symbol - */ -@Experimental -def unravel_index (data : Option[org.apache.mxnet.Symbol] = None, shape : Option[org.apache.mxnet.Shape] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Return the elements, either from x or y, depending on the condition.
- *
- * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
- * depending on the elements from condition are true or false. x and y must have the same shape.
- * If condition has the same shape as x, each element in the output array is from x if the
- * corresponding element in the condition is true, and from y if false.
- *
- * If condition does not have the same shape as x, it must be a 1D array whose size is
- * the same as x's first dimension size. Each row of the output array is from x's row
- * if the corresponding element from condition is true, and from y's row if false.
- *
- * Note that all non-zero values are interpreted as ``True`` in condition.
- *
- * Examples::
- *
- * x = [[1, 2], [3, 4]]
- * y = [[5, 6], [7, 8]]
- * cond = [[0, 1], [-1, 0]]
- *
- * where(cond, x, y) = [[5, 2], [3, 8]]
- *
- * csr_cond = cast_storage(cond, 'csr')
- *
- * where(csr_cond, x, y) = [[5, 2], [3, 8]]
- *
- *
- *
- * Defined in src/operator/tensor/control_flow_op.cc:L57
- * @param condition condition array - * @param x - * @param y - * @return org.apache.mxnet.Symbol - */ -@Experimental -def where (condition : Option[org.apache.mxnet.Symbol] = None, x : Option[org.apache.mxnet.Symbol] = None, y : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol - /** - * Return an array of zeros with the same shape, type and storage type
- * as the input array.
- *
- * The storage type of ``zeros_like`` output depends on the storage type of the input
- *
- * - zeros_like(row_sparse) = row_sparse
- * - zeros_like(csr) = csr
- * - zeros_like(default) = default
- *
- * Examples::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * zeros_like(x) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- * @param data The input - * @return org.apache.mxnet.Symbol - */ -@Experimental -def zeros_like (data : Option[org.apache.mxnet.Symbol] = None, name : String = null, attr : Map[String, String] = null) : org.apache.mxnet.Symbol -} \ No newline at end of file diff --git a/scala-package/core/src/main/scala/org/apache/mxnet/SymbolBase.scala b/scala-package/core/src/main/scala/org/apache/mxnet/SymbolBase.scala deleted file mode 100644 index 669912a0f130..000000000000 --- a/scala-package/core/src/main/scala/org/apache/mxnet/SymbolBase.scala +++ /dev/null @@ -1,5755 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You under the Apache License, Version 2.0 -* (the "License"); you may not use this file except in compliance with -* the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -// scalastyle:off -package org.apache.mxnet -import org.apache.mxnet.annotation.Experimental -abstract class SymbolBase { - /** - * Applies an activation function element-wise to the input.
- *
- * The following activation functions are supported:
- *
- * - `relu`: Rectified Linear Unit, :math:`y = max(x, 0)`
- * - `sigmoid`: :math:`y = \frac{1}{1 + exp(-x)}`
- * - `tanh`: Hyperbolic tangent, :math:`y = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}`
- * - `softrelu`: Soft ReLU, or SoftPlus, :math:`y = log(1 + exp(x))`
- * - `softsign`: :math:`y = \frac{x}{1 + abs(x)}`
- *
- *
- *
- * Defined in src/operator/nn/activation.cc:L161
- * @return org.apache.mxnet.Symbol - */ -def Activation(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Batch normalization.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * the inverse of ``data_var``, which are needed for the backward pass. Note that gradient of these
- * two outputs are blocked.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is 1. Specifying -1 sets the channel
- * axis to be the last item in the input shape.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/nn/batch_norm.cc:L575
- * @return org.apache.mxnet.Symbol - */ -def BatchNorm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Batch normalization.
- *
- * This operator is DEPRECATED. Perform BatchNorm on the input.
- *
- * Normalizes a data batch by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis:
- *
- * .. math::
- *
- * data\_mean[i] = mean(data[:,i,:,...]) \\
- * data\_var[i] = var(data[:,i,:,...])
- *
- * Then compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out[:,i,:,...] = \frac{data[:,i,:,...] - data\_mean[i]}{\sqrt{data\_var[i]+\epsilon}} * gamma[i] + beta[i]
- *
- * Both *mean* and *var* returns a scalar by treating the input as a vector.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_var`` as well, which are needed for the backward pass.
- *
- * Besides the inputs and the outputs, this operator accepts two auxiliary
- * states, ``moving_mean`` and ``moving_var``, which are *k*-length
- * vectors. They are global statistics for the whole dataset, which are updated
- * by::
- *
- * moving_mean = moving_mean * momentum + data_mean * (1 - momentum)
- * moving_var = moving_var * momentum + data_var * (1 - momentum)
- *
- * If ``use_global_stats`` is set to be true, then ``moving_mean`` and
- * ``moving_var`` are used instead of ``data_mean`` and ``data_var`` to compute
- * the output. It is often used during inference.
- *
- * Both ``gamma`` and ``beta`` are learnable parameters. But if ``fix_gamma`` is true,
- * then set ``gamma`` to 1 and its gradient to 0.
- *
- *
- *
- * Defined in src/operator/batch_norm_v1.cc:L92
- * @return org.apache.mxnet.Symbol - */ -def BatchNorm_v1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies bilinear sampling to input feature map.
- *
- * Bilinear Sampling is the key of [NIPS2015] \"Spatial Transformer Networks\". The usage of the operator is very similar to remap function in OpenCV,
- * except that the operator has the backward pass.
- *
- * Given :math:`data` and :math:`grid`, then the output is computed by
- *
- * .. math::
- * x_{src} = grid[batch, 0, y_{dst}, x_{dst}] \\
- * y_{src} = grid[batch, 1, y_{dst}, x_{dst}] \\
- * output[batch, channel, y_{dst}, x_{dst}] = G(data[batch, channel, y_{src}, x_{src})
- *
- * :math:`x_{dst}`, :math:`y_{dst}` enumerate all spatial locations in :math:`output`, and :math:`G()` denotes the bilinear interpolation kernel.
- * The out-boundary points will be padded with zeros.The shape of the output will be (data.shape[0], data.shape[1], grid.shape[2], grid.shape[3]).
- *
- * The operator assumes that :math:`data` has 'NCHW' layout and :math:`grid` has been normalized to [-1, 1].
- *
- * BilinearSampler often cooperates with GridGenerator which generates sampling grids for BilinearSampler.
- * GridGenerator supports two kinds of transformation: ``affine`` and ``warp``.
- * If users want to design a CustomOp to manipulate :math:`grid`, please firstly refer to the code of GridGenerator.
- *
- * Example 1::
- *
- * ## Zoom out data two times
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * affine_matrix = array([[2, 0, 0],
- * [0, 2, 0]])
- *
- * affine_matrix = reshape(affine_matrix, shape=(1, 6))
- *
- * grid = GridGenerator(data=affine_matrix, transform_type='affine', target_shape=(4, 4))
- *
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 0, 0, 0, 0],
- * [ 0, 3.5, 6.5, 0],
- * [ 0, 1.25, 2.5, 0],
- * [ 0, 0, 0, 0]]]
- *
- *
- * Example 2::
- *
- * ## shift data horizontally by -1 pixel
- *
- * data = array([[[[1, 4, 3, 6],
- * [1, 8, 8, 9],
- * [0, 4, 1, 5],
- * [1, 0, 1, 3]]]])
- *
- * warp_maxtrix = array([[[[1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1],
- * [1, 1, 1, 1]],
- * [[0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0],
- * [0, 0, 0, 0]]]])
- *
- * grid = GridGenerator(data=warp_matrix, transform_type='warp')
- * out = BilinearSampler(data, grid)
- *
- * out
- * [[[[ 4, 3, 6, 0],
- * [ 8, 8, 9, 0],
- * [ 4, 1, 5, 0],
- * [ 0, 1, 3, 0]]]
- *
- *
- * Defined in src/operator/bilinear_sampler.cc:L245
- * @return org.apache.mxnet.Symbol - */ -def BilinearSampler(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @return org.apache.mxnet.Symbol - */ -def BlockGrad(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @return org.apache.mxnet.Symbol - */ -def Cast(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @return org.apache.mxnet.Symbol - */ -def Concat(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Compute *N*-D convolution on *(N+2)*-D input.
- *
- * In the 2-D convolution, given input data with shape *(batch_size,
- * channel, height, width)*, the output is computed by
- *
- * .. math::
- *
- * out[n,i,:,:] = bias[i] + \sum_{j=0}^{channel} data[n,j,:,:] \star
- * weight[i,j,:,:]
- *
- * where :math:`\star` is the 2-D cross-correlation operator.
- *
- * For general 2-D convolution, the shapes are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*.
- *
- * Define::
- *
- * f(x,k,p,s,d) = floor((x+2*p-d*(k-1)-1)/s)+1
- *
- * then we have::
- *
- * out_height=f(height, kernel[0], pad[0], stride[0], dilate[0])
- * out_width=f(width, kernel[1], pad[1], stride[1], dilate[1])
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * The default data ``layout`` is *NCHW*, namely *(batch_size, channel, height,
- * width)*. We can choose other layouts such as *NHWC*.
- *
- * If ``num_group`` is larger than 1, denoted by *g*, then split the input ``data``
- * evenly into *g* parts along the channel axis, and also evenly split ``weight``
- * along the first dimension. Next compute the convolution on the *i*-th part of
- * the data with the *i*-th weight part. The output is obtained by concatenating all
- * the *g* results.
- *
- * 1-D convolution does not have *height* dimension but only *width* in space.
- *
- * - **data**: *(batch_size, channel, width)*
- * - **weight**: *(num_filter, channel, kernel[0])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * 3-D convolution adds an additional *depth* dimension besides *height* and
- * *width*. The shapes are
- *
- * - **data**: *(batch_size, channel, depth, height, width)*
- * - **weight**: *(num_filter, channel, kernel[0], kernel[1], kernel[2])*
- * - **bias**: *(num_filter,)*
- * - **out**: *(batch_size, num_filter, out_depth, out_height, out_width)*.
- *
- * Both ``weight`` and ``bias`` are learnable parameters.
- *
- * There are other options to tune the performance.
- *
- * - **cudnn_tune**: enable this option leads to higher startup time but may give
- * faster speed. Options are
- *
- * - **off**: no tuning
- * - **limited_workspace**:run test and pick the fastest algorithm that doesn't
- * exceed workspace limit.
- * - **fastest**: pick the fastest algorithm and ignore workspace limit.
- * - **None** (default): the behavior is determined by environment variable
- * ``MXNET_CUDNN_AUTOTUNE_DEFAULT``. 0 for off, 1 for limited workspace
- * (default), 2 for fastest.
- *
- * - **workspace**: A large number leads to more (GPU) memory usage but may improve
- * the performance.
- *
- *
- *
- * Defined in src/operator/nn/convolution.cc:L470
- * @return org.apache.mxnet.Symbol - */ -def Convolution(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * This operator is DEPRECATED. Apply convolution to input then add a bias.
- * @return org.apache.mxnet.Symbol - */ -def Convolution_v1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies correlation to inputs.
- *
- * The correlation layer performs multiplicative patch comparisons between two feature maps.
- *
- * Given two multi-channel feature maps :math:`f_{1}, f_{2}`, with :math:`w`, :math:`h`, and :math:`c` being their width, height, and number of channels,
- * the correlation layer lets the network compare each patch from :math:`f_{1}` with each patch from :math:`f_{2}`.
- *
- * For now we consider only a single comparison of two patches. The 'correlation' of two patches centered at :math:`x_{1}` in the first map and
- * :math:`x_{2}` in the second map is then defined as:
- *
- * .. math::
- *
- * c(x_{1}, x_{2}) = \sum_{o \in [-k,k] \times [-k,k]}
- *
- * for a square patch of size :math:`K:=2k+1`.
- *
- * Note that the equation above is identical to one step of a convolution in neural networks, but instead of convolving data with a filter, it convolves data with other
- * data. For this reason, it has no training weights.
- *
- * Computing :math:`c(x_{1}, x_{2})` involves :math:`c * K^{2}` multiplications. Comparing all patch combinations involves :math:`w^{2}*h^{2}` such computations.
- *
- * Given a maximum displacement :math:`d`, for each location :math:`x_{1}` it computes correlations :math:`c(x_{1}, x_{2})` only in a neighborhood of size :math:`D:=2d+1`,
- * by limiting the range of :math:`x_{2}`. We use strides :math:`s_{1}, s_{2}`, to quantize :math:`x_{1}` globally and to quantize :math:`x_{2}` within the neighborhood
- * centered around :math:`x_{1}`.
- *
- * The final output is defined by the following expression:
- *
- * .. math::
- * out[n, q, i, j] = c(x_{i, j}, x_{q})
- *
- * where :math:`i` and :math:`j` enumerate spatial locations in :math:`f_{1}`, and :math:`q` denotes the :math:`q^{th}` neighborhood of :math:`x_{i,j}`.
- *
- *
- * Defined in src/operator/correlation.cc:L198
- * @return org.apache.mxnet.Symbol - */ -def Correlation(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - *
- *
- * .. note:: `Crop` is deprecated. Use `slice` instead.
- *
- * Crop the 2nd and 3rd dim of input data, with the corresponding size of h_w or
- * with width and height of the second input symbol, i.e., with one input, we need h_w to
- * specify the crop height and width, otherwise the second input symbol's size will be used
- *
- *
- * Defined in src/operator/crop.cc:L50
- * @return org.apache.mxnet.Symbol - */ -def Crop(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Apply a custom operator implemented in a frontend language (like Python).
- *
- * Custom operators should override required methods like `forward` and `backward`.
- * The custom operator must be registered before it can be used.
- * Please check the tutorial here: http://mxnet.io/faq/new_op.html.
- *
- *
- *
- * Defined in src/operator/custom/custom.cc:L547
- * @return org.apache.mxnet.Symbol - */ -def Custom(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes 1D or 2D transposed convolution (aka fractionally strided convolution) of the input tensor. This operation can be seen as the gradient of Convolution operation with respect to its input. Convolution usually reduces the size of the input. Transposed convolution works the other way, going from a smaller input to a larger output while preserving the connectivity pattern.
- * @return org.apache.mxnet.Symbol - */ -def Deconvolution(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies dropout operation to input array.
- *
- * - During training, each element of the input is set to zero with probability p.
- * The whole array is rescaled by :math:`1/(1-p)` to keep the expected
- * sum of the input unchanged.
- *
- * - During testing, this operator does not change the input if mode is 'training'.
- * If mode is 'always', the same computaion as during training will be applied.
- *
- * Example::
- *
- * random.seed(998)
- * input_array = array([[3., 0.5, -0.5, 2., 7.],
- * [2., -0.4, 7., 3., 0.2]])
- * a = symbol.Variable('a')
- * dropout = symbol.Dropout(a, p = 0.2)
- * executor = dropout.simple_bind(a = input_array.shape)
- *
- * ## If training
- * executor.forward(is_train = True, a = input_array)
- * executor.outputs
- * [[ 3.75 0.625 -0. 2.5 8.75 ]
- * [ 2.5 -0.5 8.75 3.75 0. ]]
- *
- * ## If testing
- * executor.forward(is_train = False, a = input_array)
- * executor.outputs
- * [[ 3. 0.5 -0.5 2. 7. ]
- * [ 2. -0.4 7. 3. 0.2 ]]
- *
- *
- * Defined in src/operator/nn/dropout.cc:L76
- * @return org.apache.mxnet.Symbol - */ -def Dropout(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @return org.apache.mxnet.Symbol - */ -def ElementWiseSum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Maps integer indices to vector representations (embeddings).
- *
- * This operator maps words to real-valued vectors in a high-dimensional space,
- * called word embeddings. These embeddings can capture semantic and syntactic properties of the words.
- * For example, it has been noted that in the learned embedding spaces, similar words tend
- * to be close to each other and dissimilar words far apart.
- *
- * For an input array of shape (d1, ..., dK),
- * the shape of an output array is (d1, ..., dK, output_dim).
- * All the input values should be integers in the range [0, input_dim).
- *
- * If the input_dim is ip0 and output_dim is op0, then shape of the embedding weight matrix must be
- * (ip0, op0).
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last vector in an embedding matrix.
- *
- * Examples::
- *
- * input_dim = 4
- * output_dim = 5
- *
- * // Each row in weight matrix y represents a word. So, y = (w0,w1,w2,w3)
- * y = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.],
- * [ 10., 11., 12., 13., 14.],
- * [ 15., 16., 17., 18., 19.]]
- *
- * // Input array x represents n-grams(2-gram). So, x = [(w1,w3), (w0,w2)]
- * x = [[ 1., 3.],
- * [ 0., 2.]]
- *
- * // Mapped input x to its vector representation y.
- * Embedding(x, y, 4, 5) = [[[ 5., 6., 7., 8., 9.],
- * [ 15., 16., 17., 18., 19.]],
- *
- * [[ 0., 1., 2., 3., 4.],
- * [ 10., 11., 12., 13., 14.]]]
- *
- *
- * The storage type of weight can be either row_sparse or default, while
- * the storage type of weight's grad depends on the value of "sparse_grad".
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L232
- * @return org.apache.mxnet.Symbol - */ -def Embedding(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @return org.apache.mxnet.Symbol - */ -def Flatten(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies a linear transformation: :math:`Y = XW^T + b`.
- *
- * If ``flatten`` is set to be true, then the shapes are:
- *
- * - **data**: `(batch_size, x1, x2, ..., xn)`
- * - **weight**: `(num_hidden, x1 * x2 * ... * xn)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(batch_size, num_hidden)`
- *
- * If ``flatten`` is set to be false, then the shapes are:
- *
- * - **data**: `(x1, x2, ..., xn, input_dim)`
- * - **weight**: `(num_hidden, input_dim)`
- * - **bias**: `(num_hidden,)`
- * - **out**: `(x1, x2, ..., xn, num_hidden)`
- *
- * The learnable parameters include both ``weight`` and ``bias``.
- *
- * If ``no_bias`` is set to be true, then the ``bias`` term is ignored.
- *
- * Note that the operator also supports forward computation with `row_sparse` weight and bias,
- * where the length of `weight.indices` and `bias.indices` must be equal to `num_hidden`.
- * This could be used for model inference with `row_sparse` weights trained with `SparseEmbedding`.
- *
- *
- *
- * Defined in src/operator/nn/fully_connected.cc:L254
- * @return org.apache.mxnet.Symbol - */ -def FullyConnected(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Generates 2D sampling grid for bilinear sampling.
- * @return org.apache.mxnet.Symbol - */ -def GridGenerator(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Apply a sparse regularization to the output a sigmoid activation function.
- * @return org.apache.mxnet.Symbol - */ -def IdentityAttachKLSparseReg(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies instance normalization to the n-dimensional input array.
- *
- * This operator takes an n-dimensional input array where (n>2) and normalizes
- * the input using the following formula:
- *
- * .. math::
- *
- * out = \frac{x - mean[data]}{ \sqrt{Var[data]} + \epsilon} * gamma + beta
- *
- * This layer is similar to batch normalization layer (`BatchNorm`)
- * with two differences: first, the normalization is
- * carried out per example (instance), not over a batch. Second, the
- * same normalization is applied both at test and train time. This
- * operation is also known as `contrast normalization`.
- *
- * If the input data is of shape [batch, channel, spacial_dim1, spacial_dim2, ...],
- * `gamma` and `beta` parameters must be vectors of shape [channel].
- *
- * This implementation is based on paper:
- *
- * .. [1] Instance Normalization: The Missing Ingredient for Fast Stylization,
- * D. Ulyanov, A. Vedaldi, V. Lempitsky, 2016 (arXiv:1607.08022v2).
- *
- * Examples::
- *
- * // Input of shape (2,1,2)
- * x = [[[ 1.1, 2.2]],
- * [[ 3.3, 4.4]]]
- *
- * // gamma parameter of length 1
- * gamma = [1.5]
- *
- * // beta parameter of length 1
- * beta = [0.5]
- *
- * // Instance normalization is calculated with the above formula
- * InstanceNorm(x,gamma,beta) = [[[-0.997527 , 1.99752665]],
- * [[-0.99752653, 1.99752724]]]
- *
- *
- *
- * Defined in src/operator/instance_norm.cc:L95
- * @return org.apache.mxnet.Symbol - */ -def InstanceNorm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Normalize the input array using the L2 norm.
- *
- * For 1-D NDArray, it computes::
- *
- * out = data / sqrt(sum(data ** 2) + eps)
- *
- * For N-D NDArray, if the input array has shape (N, N, ..., N),
- *
- * with ``mode`` = ``instance``, it normalizes each instance in the multidimensional
- * array by its L2 norm.::
- *
- * for i in 0...N
- * out[i,:,:,...,:] = data[i,:,:,...,:] / sqrt(sum(data[i,:,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``channel``, it normalizes each channel in the array by its L2 norm.::
- *
- * for i in 0...N
- * out[:,i,:,...,:] = data[:,i,:,...,:] / sqrt(sum(data[:,i,:,...,:] ** 2) + eps)
- *
- * with ``mode`` = ``spatial``, it normalizes the cross channel norm for each position
- * in the array by its L2 norm.::
- *
- * for dim in 2...N
- * for i in 0...N
- * out[.....,i,...] = take(out, indices=i, axis=dim) / sqrt(sum(take(out, indices=i, axis=dim) ** 2) + eps)
- * -dim-
- *
- * Example::
- *
- * x = [[[1,2],
- * [3,4]],
- * [[2,2],
- * [5,6]]]
- *
- * L2Normalization(x, mode='instance')
- * =[[[ 0.18257418 0.36514837]
- * [ 0.54772252 0.73029673]]
- * [[ 0.24077171 0.24077171]
- * [ 0.60192931 0.72231513]]]
- *
- * L2Normalization(x, mode='channel')
- * =[[[ 0.31622776 0.44721359]
- * [ 0.94868326 0.89442718]]
- * [[ 0.37139067 0.31622776]
- * [ 0.92847669 0.94868326]]]
- *
- * L2Normalization(x, mode='spatial')
- * =[[[ 0.44721359 0.89442718]
- * [ 0.60000002 0.80000001]]
- * [[ 0.70710677 0.70710677]
- * [ 0.6401844 0.76822126]]]
- *
- *
- *
- * Defined in src/operator/l2_normalization.cc:L98
- * @return org.apache.mxnet.Symbol - */ -def L2Normalization(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies local response normalization to the input.
- *
- * The local response normalization layer performs "lateral inhibition" by normalizing
- * over local input regions.
- *
- * If :math:`a_{x,y}^{i}` is the activity of a neuron computed by applying kernel :math:`i` at position
- * :math:`(x, y)` and then applying the ReLU nonlinearity, the response-normalized
- * activity :math:`b_{x,y}^{i}` is given by the expression:
- *
- * .. math::
- * b_{x,y}^{i} = \frac{a_{x,y}^{i}}{\Bigg({k + \frac{\alpha}{n} \sum_{j=max(0, i-\frac{n}{2})}^{min(N-1, i+\frac{n}{2})} (a_{x,y}^{j})^{2}}\Bigg)^{\beta}}
- *
- * where the sum runs over :math:`n` "adjacent" kernel maps at the same spatial position, and :math:`N` is the total
- * number of kernels in the layer.
- *
- *
- *
- * Defined in src/operator/nn/lrn.cc:L175
- * @return org.apache.mxnet.Symbol - */ -def LRN(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Layer normalization.
- *
- * Normalizes the channels of the input tensor by mean and variance, and applies a scale ``gamma`` as
- * well as offset ``beta``.
- *
- * Assume the input has more than one dimension and we normalize along axis 1.
- * We first compute the mean and variance along this axis and then
- * compute the normalized output, which has the same shape as input, as following:
- *
- * .. math::
- *
- * out = \frac{data - mean(data, axis)}{\sqrt{var(data, axis) + \epsilon}} * gamma + beta
- *
- * Both ``gamma`` and ``beta`` are learnable parameters.
- *
- * Unlike BatchNorm and InstanceNorm, the *mean* and *var* are computed along the channel dimension.
- *
- * Assume the input has size *k* on axis 1, then both ``gamma`` and ``beta``
- * have shape *(k,)*. If ``output_mean_var`` is set to be true, then outputs both ``data_mean`` and
- * ``data_std``. Note that no gradient will be passed through these two outputs.
- *
- * The parameter ``axis`` specifies which axis of the input shape denotes
- * the 'channel' (separately normalized groups). The default is -1, which sets the channel
- * axis to be the last item in the input shape.
- *
- *
- *
- * Defined in src/operator/nn/layer_norm.cc:L94
- * @return org.apache.mxnet.Symbol - */ -def LayerNorm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies Leaky rectified linear unit activation element-wise to the input.
- *
- * Leaky ReLUs attempt to fix the "dying ReLU" problem by allowing a small `slope`
- * when the input is negative and has a slope of one when input is positive.
- *
- * The following modified ReLU Activation functions are supported:
- *
- * - *elu*: Exponential Linear Unit. `y = x > 0 ? x : slope * (exp(x)-1)`
- * - *leaky*: Leaky ReLU. `y = x > 0 ? x : slope * x`
- * - *prelu*: Parametric ReLU. This is same as *leaky* except that `slope` is learnt during training.
- * - *rrelu*: Randomized ReLU. same as *leaky* but the `slope` is uniformly and randomly chosen from
- * *[lower_bound, upper_bound)* for training, while fixed to be
- * *(lower_bound+upper_bound)/2* for inference.
- *
- *
- *
- * Defined in src/operator/leaky_relu.cc:L63
- * @return org.apache.mxnet.Symbol - */ -def LeakyReLU(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes and optimizes for squared loss during backward propagation.
- * Just outputs ``data`` during forward propagation.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the squared loss estimated over :math:`n` samples is defined as
- *
- * :math:`\text{SquaredLoss}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_2`
- *
- * .. note::
- * Use the LinearRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LinearRegressionOutput(default, default) = default
- * - LinearRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L92
- * @return org.apache.mxnet.Symbol - */ -def LinearRegressionOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies a logistic function to the input.
- *
- * The logistic function, also known as the sigmoid function, is computed as
- * :math:`\frac{1}{1+exp(-\textbf{x})}`.
- *
- * Commonly, the sigmoid is used to squash the real-valued output of a linear model
- * :math:`wTx+b` into the [0,1] range so that it can be interpreted as a probability.
- * It is suitable for binary classification or probability prediction tasks.
- *
- * .. note::
- * Use the LogisticRegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - LogisticRegressionOutput(default, default) = default
- * - LogisticRegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L148
- * @return org.apache.mxnet.Symbol - */ -def LogisticRegressionOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes mean absolute error of the input.
- *
- * MAE is a risk metric corresponding to the expected value of the absolute error.
- *
- * If :math:`\hat{y}_i` is the predicted value of the i-th sample, and :math:`y_i` is the corresponding target value,
- * then the mean absolute error (MAE) estimated over :math:`n` samples is defined as
- *
- * :math:`\text{MAE}(\textbf{Y}, \hat{\textbf{Y}} ) = \frac{1}{n} \sum_{i=0}^{n-1} \lVert \textbf{y}_i - \hat{\textbf{y}}_i \rVert_1`
- *
- * .. note::
- * Use the MAERegressionOutput as the final output layer of a net.
- *
- * The storage type of ``label`` can be ``default`` or ``csr``
- *
- * - MAERegressionOutput(default, default) = default
- * - MAERegressionOutput(default, csr) = default
- *
- * By default, gradients of this loss function are scaled by factor `1/m`, where m is the number of regression outputs of a training example.
- * The parameter `grad_scale` can be used to change this scale to `grad_scale/m`.
- *
- *
- *
- * Defined in src/operator/regression_output.cc:L120
- * @return org.apache.mxnet.Symbol - */ -def MAERegressionOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = MakeLoss(cross_entropy)
- *
- * We will need to use ``MakeLoss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * In addition, we can give a scale to the loss by setting ``grad_scale``,
- * so that the gradient of the loss will be rescaled in the backpropagation.
- *
- * .. note:: This operator should be used as a Symbol instead of NDArray.
- *
- *
- *
- * Defined in src/operator/make_loss.cc:L71
- * @return org.apache.mxnet.Symbol - */ -def MakeLoss(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @return org.apache.mxnet.Symbol - */ -def Pad(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Performs pooling on the input.
- *
- * The shapes for 1-D pooling are
- *
- * - **data**: *(batch_size, channel, width)*,
- * - **out**: *(batch_size, num_filter, out_width)*.
- *
- * The shapes for 2-D pooling are
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- * - **lp**: Lp pooling
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- * Notes on Lp pooling:
- *
- * Lp pooling was first introduced by this paper: https://arxiv.org/pdf/1204.3968.pdf.
- * L-1 pooling is simply sum pooling, while L-inf pooling is simply max pooling.
- * We can see that Lp pooling stands between those two, in practice the most common value for p is 2.
- *
- * For each window ``X``, the mathematical expression for Lp pooling is:
- *
- * ..math::
- * f(X) = \sqrt{p}{\sum\limits_{x \in X} x^p}
- *
- *
- *
- * Defined in src/operator/nn/pooling.cc:L367
- * @return org.apache.mxnet.Symbol - */ -def Pooling(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * This operator is DEPRECATED.
- * Perform pooling on the input.
- *
- * The shapes for 2-D pooling is
- *
- * - **data**: *(batch_size, channel, height, width)*
- * - **out**: *(batch_size, num_filter, out_height, out_width)*, with::
- *
- * out_height = f(height, kernel[0], pad[0], stride[0])
- * out_width = f(width, kernel[1], pad[1], stride[1])
- *
- * The definition of *f* depends on ``pooling_convention``, which has two options:
- *
- * - **valid** (default)::
- *
- * f(x, k, p, s) = floor((x+2*p-k)/s)+1
- *
- * - **full**, which is compatible with Caffe::
- *
- * f(x, k, p, s) = ceil((x+2*p-k)/s)+1
- *
- * But ``global_pool`` is set to be true, then do a global pooling, namely reset
- * ``kernel=(height, width)``.
- *
- * Three pooling options are supported by ``pool_type``:
- *
- * - **avg**: average pooling
- * - **max**: max pooling
- * - **sum**: sum pooling
- *
- * 1-D pooling is special case of 2-D pooling with *weight=1* and
- * *kernel[1]=1*.
- *
- * For 3-D pooling, an additional *depth* dimension is added before
- * *height*. Namely the input data will have shape *(batch_size, channel, depth,
- * height, width)*.
- *
- *
- *
- * Defined in src/operator/pooling_v1.cc:L104
- * @return org.apache.mxnet.Symbol - */ -def Pooling_v1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies recurrent layers to input data. Currently, vanilla RNN, LSTM and GRU are
- * implemented, with both multi-layer and bidirectional support.
- *
- * **Vanilla RNN**
- *
- * Applies a single-gate recurrent layer to input X. Two kinds of activation function are supported:
- * ReLU and Tanh.
- *
- * With ReLU activation function:
- *
- * .. math::
- * h_t = relu(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * With Tanh activtion function:
- *
- * .. math::
- * h_t = \tanh(W_{ih} * x_t + b_{ih} + W_{hh} * h_{(t-1)} + b_{hh})
- *
- * Reference paper: Finding structure in time - Elman, 1988.
- * https://crl.ucsd.edu/~elman/Papers/fsit.pdf
- *
- * **LSTM**
- *
- * Long Short-Term Memory - Hochreiter, 1997. http://www.bioinf.jku.at/publications/older/2604.pdf
- *
- * .. math::
- * \begin{array}{ll}
- * i_t = \mathrm{sigmoid}(W_{ii} x_t + b_{ii} + W_{hi} h_{(t-1)} + b_{hi}) \\
- * f_t = \mathrm{sigmoid}(W_{if} x_t + b_{if} + W_{hf} h_{(t-1)} + b_{hf}) \\
- * g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hc} h_{(t-1)} + b_{hg}) \\
- * o_t = \mathrm{sigmoid}(W_{io} x_t + b_{io} + W_{ho} h_{(t-1)} + b_{ho}) \\
- * c_t = f_t * c_{(t-1)} + i_t * g_t \\
- * h_t = o_t * \tanh(c_t)
- * \end{array}
- *
- * **GRU**
- *
- * Gated Recurrent Unit - Cho et al. 2014. http://arxiv.org/abs/1406.1078
- *
- * The definition of GRU here is slightly different from paper but compatible with CUDNN.
- *
- * .. math::
- * \begin{array}{ll}
- * r_t = \mathrm{sigmoid}(W_{ir} x_t + b_{ir} + W_{hr} h_{(t-1)} + b_{hr}) \\
- * z_t = \mathrm{sigmoid}(W_{iz} x_t + b_{iz} + W_{hz} h_{(t-1)} + b_{hz}) \\
- * n_t = \tanh(W_{in} x_t + b_{in} + r_t * (W_{hn} h_{(t-1)}+ b_{hn})) \\
- * h_t = (1 - z_t) * n_t + z_t * h_{(t-1)} \\
- * \end{array}
- * @return org.apache.mxnet.Symbol - */ -def RNN(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Performs region of interest(ROI) pooling on the input array.
- *
- * ROI pooling is a variant of a max pooling layer, in which the output size is fixed and
- * region of interest is a parameter. Its purpose is to perform max pooling on the inputs
- * of non-uniform sizes to obtain fixed-size feature maps. ROI pooling is a neural-net
- * layer mostly used in training a `Fast R-CNN` network for object detection.
- *
- * This operator takes a 4D feature map as an input array and region proposals as `rois`,
- * then it pools over sub-regions of input and produces a fixed-sized output array
- * regardless of the ROI size.
- *
- * To crop the feature map accordingly, you can resize the bounding box coordinates
- * by changing the parameters `rois` and `spatial_scale`.
- *
- * The cropped feature maps are pooled by standard max pooling operation to a fixed size output
- * indicated by a `pooled_size` parameter. batch_size will change to the number of region
- * bounding boxes after `ROIPooling`.
- *
- * The size of each region of interest doesn't have to be perfectly divisible by
- * the number of pooling sections(`pooled_size`).
- *
- * Example::
- *
- * x = [[[[ 0., 1., 2., 3., 4., 5.],
- * [ 6., 7., 8., 9., 10., 11.],
- * [ 12., 13., 14., 15., 16., 17.],
- * [ 18., 19., 20., 21., 22., 23.],
- * [ 24., 25., 26., 27., 28., 29.],
- * [ 30., 31., 32., 33., 34., 35.],
- * [ 36., 37., 38., 39., 40., 41.],
- * [ 42., 43., 44., 45., 46., 47.]]]]
- *
- * // region of interest i.e. bounding box coordinates.
- * y = [[0,0,0,4,4]]
- *
- * // returns array of shape (2,2) according to the given roi with max pooling.
- * ROIPooling(x, y, (2,2), 1.0) = [[[[ 14., 16.],
- * [ 26., 28.]]]]
- *
- * // region of interest is changed due to the change in `spacial_scale` parameter.
- * ROIPooling(x, y, (2,2), 0.7) = [[[[ 7., 9.],
- * [ 19., 21.]]]]
- *
- *
- *
- * Defined in src/operator/roi_pooling.cc:L295
- * @return org.apache.mxnet.Symbol - */ -def ROIPooling(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @return org.apache.mxnet.Symbol - */ -def Reshape(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes support vector machine based transformation of the input.
- *
- * This tutorial demonstrates using SVM as output layer for classification instead of softmax:
- * https://github.com/dmlc/mxnet/tree/master/example/svm_mnist.
- * @return org.apache.mxnet.Symbol - */ -def SVMOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Takes the last element of a sequence.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns a (n-1)-dimensional array
- * of the form [batch_size, other_feature_dims].
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length` should be
- * an input array of positive ints of dimension [batch_size]. To use this parameter,
- * set `use_sequence_length` to `True`, otherwise each example in the batch is assumed
- * to have the max sequence length.
- *
- * .. note:: Alternatively, you can also use `take` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]],
- *
- * [[ 10., 11., 12.],
- * [ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]]
- *
- * // returns last sequence when sequence_length parameter is not used
- * SequenceLast(x) = [[ 19., 20., 21.],
- * [ 22., 23., 24.],
- * [ 25., 26., 27.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,1,1], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.],
- * [ 7., 8., 9.]]
- *
- * // sequence_length is used
- * SequenceLast(x, sequence_length=[1,2,3], use_sequence_length=True) =
- * [[ 1., 2., 3.],
- * [ 13., 14., 15.],
- * [ 25., 26., 27.]]
- *
- *
- *
- * Defined in src/operator/sequence_last.cc:L92
- * @return org.apache.mxnet.Symbol - */ -def SequenceLast(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Sets all elements outside the sequence to a constant value.
- *
- * This function takes an n-dimensional input array of the form
- * [max_sequence_length, batch_size, other_feature_dims] and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences. `sequence_length`
- * should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length and
- * this operator works as the `identity` operator.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // works as identity operator when sequence_length parameter is not used
- * SequenceMask(x) = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [1,1] means 1 of each batch will be kept
- * // and other rows are masked with default mask value = 0
- * SequenceMask(x, sequence_length=[1,1], use_sequence_length=True) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]],
- *
- * [[ 0., 0., 0.],
- * [ 0., 0., 0.]]]
- *
- * // sequence_length [2,3] means 2 of batch B1 and 3 of batch B2 will be kept
- * // and other rows are masked with value = 1
- * SequenceMask(x, sequence_length=[2,3], use_sequence_length=True, value=1) =
- * [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 1., 1.],
- * [ 16., 17., 18.]]]
- *
- *
- *
- * Defined in src/operator/sequence_mask.cc:L114
- * @return org.apache.mxnet.Symbol - */ -def SequenceMask(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Reverses the elements of each sequence.
- *
- * This function takes an n-dimensional input array of the form [max_sequence_length, batch_size, other_feature_dims]
- * and returns an array of the same shape.
- *
- * Parameter `sequence_length` is used to handle variable-length sequences.
- * `sequence_length` should be an input array of positive ints of dimension [batch_size].
- * To use this parameter, set `use_sequence_length` to `True`,
- * otherwise each example in the batch is assumed to have the max sequence length.
- *
- * Example::
- *
- * x = [[[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // Batch 1
- * B1 = [[ 1., 2., 3.],
- * [ 7., 8., 9.],
- * [ 13., 14., 15.]]
- *
- * // Batch 2
- * B2 = [[ 4., 5., 6.],
- * [ 10., 11., 12.],
- * [ 16., 17., 18.]]
- *
- * // returns reverse sequence when sequence_length parameter is not used
- * SequenceReverse(x) = [[[ 13., 14., 15.],
- * [ 16., 17., 18.]],
- *
- * [[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]]]
- *
- * // sequence_length [2,2] means 2 rows of
- * // both batch B1 and B2 will be reversed.
- * SequenceReverse(x, sequence_length=[2,2], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 10., 11., 12.]],
- *
- * [[ 1., 2., 3.],
- * [ 4., 5., 6.]],
- *
- * [[ 13., 14., 15.],
- * [ 16., 17., 18.]]]
- *
- * // sequence_length [2,3] means 2 of batch B2 and 3 of batch B3
- * // will be reversed.
- * SequenceReverse(x, sequence_length=[2,3], use_sequence_length=True) =
- * [[[ 7., 8., 9.],
- * [ 16., 17., 18.]],
- *
- * [[ 1., 2., 3.],
- * [ 10., 11., 12.]],
- *
- * [[ 13., 14, 15.],
- * [ 4., 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/sequence_reverse.cc:L113
- * @return org.apache.mxnet.Symbol - */ -def SequenceReverse(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @return org.apache.mxnet.Symbol - */ -def SliceChannel(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Please use `SoftmaxOutput`.
- *
- * .. note::
- *
- * This operator has been renamed to `SoftmaxOutput`, which
- * computes the gradient of cross-entropy loss w.r.t softmax output.
- * To just compute softmax output, use the `softmax` operator.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L138
- * @return org.apache.mxnet.Symbol - */ -def Softmax(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies softmax activation to input. This is intended for internal layers.
- *
- * .. note::
- *
- * This operator has been deprecated, please use `softmax`.
- *
- * If `mode` = ``instance``, this operator will compute a softmax for each instance in the batch.
- * This is the default mode.
- *
- * If `mode` = ``channel``, this operator will compute a k-class softmax at each position
- * of each instance, where `k` = ``num_channel``. This mode can only be used when the input array
- * has at least 3 dimensions.
- * This can be used for `fully convolutional network`, `image segmentation`, etc.
- *
- * Example::
- *
- * >>> input_array = mx.nd.array([[3., 0.5, -0.5, 2., 7.],
- * >>> [2., -.4, 7., 3., 0.2]])
- * >>> softmax_act = mx.nd.SoftmaxActivation(input_array)
- * >>> print softmax_act.asnumpy()
- * [[ 1.78322066e-02 1.46375655e-03 5.38485940e-04 6.56010211e-03 9.73605454e-01]
- * [ 6.56221947e-03 5.95310994e-04 9.73919690e-01 1.78379621e-02 1.08472735e-03]]
- *
- *
- *
- * Defined in src/operator/nn/softmax_activation.cc:L59
- * @return org.apache.mxnet.Symbol - */ -def SoftmaxActivation(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the gradient of cross entropy loss with respect to softmax output.
- *
- * - This operator computes the gradient in two steps.
- * The cross entropy loss does not actually need to be computed.
- *
- * - Applies softmax function on the input array.
- * - Computes and returns the gradient of cross entropy loss w.r.t. the softmax output.
- *
- * - The softmax function, cross entropy loss and gradient is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * - The gradient of cross entropy loss w.r.t softmax output:
- *
- * .. math:: \text{gradient} = \text{output} - \text{label}
- *
- * - During forward propagation, the softmax function is computed for each instance in the input array.
- *
- * For general *N*-D input arrays with shape :math:`(d_1, d_2, ..., d_n)`. The size is
- * :math:`s=d_1 \cdot d_2 \cdot \cdot \cdot d_n`. We can use the parameters `preserve_shape`
- * and `multi_output` to specify the way to compute softmax:
- *
- * - By default, `preserve_shape` is ``false``. This operator will reshape the input array
- * into a 2-D array with shape :math:`(d_1, \frac{s}{d_1})` and then compute the softmax function for
- * each row in the reshaped array, and afterwards reshape it back to the original shape
- * :math:`(d_1, d_2, ..., d_n)`.
- * - If `preserve_shape` is ``true``, the softmax function will be computed along
- * the last axis (`axis` = ``-1``).
- * - If `multi_output` is ``true``, the softmax function will be computed along
- * the second axis (`axis` = ``1``).
- *
- * - During backward propagation, the gradient of cross-entropy loss w.r.t softmax output array is computed.
- * The provided label can be a one-hot label array or a probability label array.
- *
- * - If the parameter `use_ignore` is ``true``, `ignore_label` can specify input instances
- * with a particular label to be ignored during backward propagation. **This has no effect when
- * softmax `output` has same shape as `label`**.
- *
- * Example::
- *
- * data = [[1,2,3,4],[2,2,2,2],[3,3,3,3],[4,4,4,4]]
- * label = [1,0,2,3]
- * ignore_label = 1
- * SoftmaxOutput(data=data, label = label,\
- * multi_output=true, use_ignore=true,\
- * ignore_label=ignore_label)
- * ## forward softmax output
- * [[ 0.0320586 0.08714432 0.23688284 0.64391428]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]
- * [ 0.25 0.25 0.25 0.25 ]]
- * ## backward gradient output
- * [[ 0. 0. 0. 0. ]
- * [-0.75 0.25 0.25 0.25]
- * [ 0.25 0.25 -0.75 0.25]
- * [ 0.25 0.25 0.25 -0.75]]
- * ## notice that the first row is all 0 because label[0] is 1, which is equal to ignore_label.
- *
- * - The parameter `grad_scale` can be used to rescale the gradient, which is often used to
- * give each loss function different weights.
- *
- * - This operator also supports various ways to normalize the gradient by `normalization`,
- * The `normalization` is applied if softmax output has different shape than the labels.
- * The `normalization` mode can be set to the followings:
- *
- * - ``'null'``: do nothing.
- * - ``'batch'``: divide the gradient by the batch size.
- * - ``'valid'``: divide the gradient by the number of instances which are not ignored.
- *
- *
- *
- * Defined in src/operator/softmax_output.cc:L123
- * @return org.apache.mxnet.Symbol - */ -def SoftmaxOutput(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies a spatial transformer to input feature map.
- * @return org.apache.mxnet.Symbol - */ -def SpatialTransformer(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @return org.apache.mxnet.Symbol - */ -def SwapAxis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Performs nearest neighbor/bilinear up sampling to inputs.
- * @return org.apache.mxnet.Symbol - */ -def UpSampling(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise absolute value of the input.
- *
- * Example::
- *
- * abs([-2, 0, 3]) = [2, 0, 3]
- *
- * The storage type of ``abs`` output depends upon the input storage type:
- *
- * - abs(default) = default
- * - abs(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L490
- * @return org.apache.mxnet.Symbol - */ -def abs(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Update function for Adam optimizer. Adam is seen as a generalization
- * of AdaGrad.
- *
- * Adam update consists of the following steps, where g represents gradient and m, v
- * are 1st and 2nd order moment estimates (mean and variance).
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta_1 m_{t-1} + (1 - \beta_1) g_t\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * W_t = W_{t-1} - \alpha \frac{ m_t }{ \sqrt{ v_t } + \epsilon }
- *
- * It updates the weights using::
- *
- * m = beta1*m + (1-beta1)*grad
- * v = beta2*v + (1-beta2)*(grad**2)
- * w += - learning_rate * m / (sqrt(v) + epsilon)
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and the storage
- * type of weight is the same as those of m and v,
- * only the row slices whose indices appear in grad.indices are updated (for w, m and v)::
- *
- * for row in grad.indices:
- * m[row] = beta1*m[row] + (1-beta1)*grad[row]
- * v[row] = beta2*v[row] + (1-beta2)*(grad[row]**2)
- * w[row] += - learning_rate * m[row] / (sqrt(v[row]) + epsilon)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L495
- * @return org.apache.mxnet.Symbol - */ -def adam_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Adds all input arguments element-wise.
- *
- * .. math::
- * add\_n(a_1, a_2, ..., a_n) = a_1 + a_2 + ... + a_n
- *
- * ``add_n`` is potentially more efficient than calling ``add`` by `n` times.
- *
- * The storage type of ``add_n`` output depends on storage types of inputs
- *
- * - add_n(row_sparse, row_sparse, ..) = row_sparse
- * - otherwise, ``add_n`` generates output with default storage
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_sum.cc:L150
- * @return org.apache.mxnet.Symbol - */ -def add_n(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise inverse cosine of the input array.
- *
- * The input should be in range `[-1, 1]`.
- * The output is in the closed interval :math:`[0, \pi]`
- *
- * .. math::
- * arccos([-1, -.707, 0, .707, 1]) = [\pi, 3\pi/4, \pi/2, \pi/4, 0]
- *
- * The storage type of ``arccos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L123
- * @return org.apache.mxnet.Symbol - */ -def arccos(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the element-wise inverse hyperbolic cosine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arccosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L264
- * @return org.apache.mxnet.Symbol - */ -def arccosh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise inverse sine of the input array.
- *
- * The input should be in the range `[-1, 1]`.
- * The output is in the closed interval of [:math:`-\pi/2`, :math:`\pi/2`].
- *
- * .. math::
- * arcsin([-1, -.707, 0, .707, 1]) = [-\pi/2, -\pi/4, 0, \pi/4, \pi/2]
- *
- * The storage type of ``arcsin`` output depends upon the input storage type:
- *
- * - arcsin(default) = default
- * - arcsin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L104
- * @return org.apache.mxnet.Symbol - */ -def arcsin(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the element-wise inverse hyperbolic sine of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arcsinh`` output depends upon the input storage type:
- *
- * - arcsinh(default) = default
- * - arcsinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L250
- * @return org.apache.mxnet.Symbol - */ -def arcsinh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise inverse tangent of the input array.
- *
- * The output is in the closed interval :math:`[-\pi/2, \pi/2]`
- *
- * .. math::
- * arctan([-1, 0, 1]) = [-\pi/4, 0, \pi/4]
- *
- * The storage type of ``arctan`` output depends upon the input storage type:
- *
- * - arctan(default) = default
- * - arctan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L144
- * @return org.apache.mxnet.Symbol - */ -def arctan(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the element-wise inverse hyperbolic tangent of the input array, \
- * computed element-wise.
- *
- * The storage type of ``arctanh`` output depends upon the input storage type:
- *
- * - arctanh(default) = default
- * - arctanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L281
- * @return org.apache.mxnet.Symbol - */ -def arctanh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns indices of the maximum values along an axis.
- *
- * In the case of multiple occurrences of maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmax along axis 0
- * argmax(x, axis=0) = [ 1., 1., 1.]
- *
- * // argmax along axis 1
- * argmax(x, axis=1) = [ 2., 2.]
- *
- * // argmax along axis 1 keeping same dims as an input array
- * argmax(x, axis=1, keepdims=True) = [[ 2.],
- * [ 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L52
- * @return org.apache.mxnet.Symbol - */ -def argmax(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns argmax indices of each channel from the input array.
- *
- * The result will be an NDArray of shape (num_channel,).
- *
- * In case of multiple occurrences of the maximum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * argmax_channel(x) = [ 2., 2.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L97
- * @return org.apache.mxnet.Symbol - */ -def argmax_channel(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns indices of the minimum values along an axis.
- *
- * In the case of multiple occurrences of minimum values, the indices corresponding to the first occurrence
- * are returned.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2.],
- * [ 3., 4., 5.]]
- *
- * // argmin along axis 0
- * argmin(x, axis=0) = [ 0., 0., 0.]
- *
- * // argmin along axis 1
- * argmin(x, axis=1) = [ 0., 0.]
- *
- * // argmin along axis 1 keeping same dims as an input array
- * argmin(x, axis=1, keepdims=True) = [[ 0.],
- * [ 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L77
- * @return org.apache.mxnet.Symbol - */ -def argmin(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the indices that would sort an input array along the given axis.
- *
- * This function performs sorting along the given axis and returns an array of indices having same shape
- * as an input array that index data in sorted order.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // sort along axis -1
- * argsort(x) = [[ 1., 0., 2.],
- * [ 0., 2., 1.]]
- *
- * // sort along axis 0
- * argsort(x, axis=0) = [[ 1., 0., 1.]
- * [ 0., 1., 0.]]
- *
- * // flatten and then sort
- * argsort(x) = [ 3., 1., 5., 0., 4., 2.]
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L176
- * @return org.apache.mxnet.Symbol - */ -def argsort(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Batchwise dot product.
- *
- * ``batch_dot`` is used to compute dot product of ``x`` and ``y`` when ``x`` and
- * ``y`` are data in batch, namely 3D arrays in shape of `(batch_size, :, :)`.
- *
- * For example, given ``x`` with shape `(batch_size, n, m)` and ``y`` with shape
- * `(batch_size, m, k)`, the result array will have shape `(batch_size, n, k)`,
- * which is computed by::
- *
- * batch_dot(x,y)[i,:,:] = dot(x[i,:,:], y[i,:,:])
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L117
- * @return org.apache.mxnet.Symbol - */ -def batch_dot(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Takes elements from a data batch.
- *
- * .. note::
- * `batch_take` is deprecated. Use `pick` instead.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // takes elements with specified indices
- * batch_take(x, [0,1,0]) = [ 1. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L444
- * @return org.apache.mxnet.Symbol - */ -def batch_take(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @return org.apache.mxnet.Symbol - */ -def broadcast_add(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @return org.apache.mxnet.Symbol - */ -def broadcast_axes(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Broadcasts the input array over particular axes.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * Example::
- *
- * // given x of shape (1,2,1)
- * x = [[[ 1.],
- * [ 2.]]]
- *
- * // broadcast x on on axis 2
- * broadcast_axis(x, axis=2, size=3) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- * // broadcast x on on axes 0 and 2
- * broadcast_axis(x, axis=(0,2), size=(2,3)) = [[[ 1., 1., 1.],
- * [ 2., 2., 2.]],
- * [[ 1., 1., 1.],
- * [ 2., 2., 2.]]]
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L237
- * @return org.apache.mxnet.Symbol - */ -def broadcast_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise division of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 6., 6., 6.],
- * [ 6., 6., 6.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_div(x, y) = [[ 3., 3., 3.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_div(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L187
- * @return org.apache.mxnet.Symbol - */ -def broadcast_div(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **equal to** (==) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L46
- * @return org.apache.mxnet.Symbol - */ -def broadcast_equal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **greater than** (>) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L82
- * @return org.apache.mxnet.Symbol - */ -def broadcast_greater(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **greater than or equal to** (>=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_greater_equal(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L100
- * @return org.apache.mxnet.Symbol - */ -def broadcast_greater_equal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the hypotenuse of a right angled triangle, given its "legs"
- * with broadcasting.
- *
- * It is equivalent to doing :math:`sqrt(x_1^2 + x_2^2)`.
- *
- * Example::
- *
- * x = [[ 3., 3., 3.]]
- *
- * y = [[ 4.],
- * [ 4.]]
- *
- * broadcast_hypot(x, y) = [[ 5., 5., 5.],
- * [ 5., 5., 5.]]
- *
- * z = [[ 0.],
- * [ 4.]]
- *
- * broadcast_hypot(x, z) = [[ 3., 3., 3.],
- * [ 5., 5., 5.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L156
- * @return org.apache.mxnet.Symbol - */ -def broadcast_hypot(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **lesser than** (<) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser(x, y) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L118
- * @return org.apache.mxnet.Symbol - */ -def broadcast_lesser(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **lesser than or equal to** (<=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_lesser_equal(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L136
- * @return org.apache.mxnet.Symbol - */ -def broadcast_lesser_equal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **logical and** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_logical_and(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L154
- * @return org.apache.mxnet.Symbol - */ -def broadcast_logical_and(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **logical or** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_or(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L172
- * @return org.apache.mxnet.Symbol - */ -def broadcast_logical_or(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **logical xor** with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 0.],
- * [ 1., 1., 0.]]
- *
- * y = [[ 1.],
- * [ 0.]]
- *
- * broadcast_logical_xor(x, y) = [[ 0., 0., 1.],
- * [ 1., 1., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L190
- * @return org.apache.mxnet.Symbol - */ -def broadcast_logical_xor(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise maximum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise maxima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L80
- * @return org.apache.mxnet.Symbol - */ -def broadcast_maximum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise minimum of the input arrays with broadcasting.
- *
- * This function compares two input arrays and returns a new array having the element-wise minima.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_maximum(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L115
- * @return org.apache.mxnet.Symbol - */ -def broadcast_minimum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @return org.apache.mxnet.Symbol - */ -def broadcast_minus(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise modulo of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 8., 8., 8.],
- * [ 8., 8., 8.]]
- *
- * y = [[ 2.],
- * [ 3.]]
- *
- * broadcast_mod(x, y) = [[ 0., 0., 0.],
- * [ 2., 2., 2.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L222
- * @return org.apache.mxnet.Symbol - */ -def broadcast_mod(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise product of the input arrays with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_mul(x, y) = [[ 0., 0., 0.],
- * [ 1., 1., 1.]]
- *
- * Supported sparse operations:
- *
- * broadcast_mul(csr, dense(1D)) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L146
- * @return org.apache.mxnet.Symbol - */ -def broadcast_mul(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of element-wise **not equal to** (!=) comparison operation with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_not_equal(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_logic.cc:L64
- * @return org.apache.mxnet.Symbol - */ -def broadcast_not_equal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise sum of the input arrays with broadcasting.
- *
- * `broadcast_plus` is an alias to the function `broadcast_add`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_add(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * broadcast_plus(x, y) = [[ 1., 1., 1.],
- * [ 2., 2., 2.]]
- *
- * Supported sparse operations:
- *
- * broadcast_add(csr, dense(1D)) = dense
- * broadcast_add(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L58
- * @return org.apache.mxnet.Symbol - */ -def broadcast_plus(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns result of first array elements raised to powers from second array, element-wise with broadcasting.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_power(x, y) = [[ 2., 2., 2.],
- * [ 4., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_extended.cc:L45
- * @return org.apache.mxnet.Symbol - */ -def broadcast_power(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise difference of the input arrays with broadcasting.
- *
- * `broadcast_minus` is an alias to the function `broadcast_sub`.
- *
- * Example::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * y = [[ 0.],
- * [ 1.]]
- *
- * broadcast_sub(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * broadcast_minus(x, y) = [[ 1., 1., 1.],
- * [ 0., 0., 0.]]
- *
- * Supported sparse operations:
- *
- * broadcast_sub/minus(csr, dense(1D)) = dense
- * broadcast_sub/minus(dense(1D), csr) = dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_broadcast_op_basic.cc:L106
- * @return org.apache.mxnet.Symbol - */ -def broadcast_sub(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Broadcasts the input array to a new shape.
- *
- * Broadcasting is a mechanism that allows NDArrays to perform arithmetic operations
- * with arrays of different shapes efficiently without creating multiple copies of arrays.
- * Also see, `Broadcasting `_ for more explanation.
- *
- * Broadcasting is allowed on axes with size 1, such as from `(2,1,3,1)` to
- * `(2,8,3,9)`. Elements will be duplicated on the broadcasted axes.
- *
- * For example::
- *
- * broadcast_to([[1,2,3]], shape=(2,3)) = [[ 1., 2., 3.],
- * [ 1., 2., 3.]])
- *
- * The dimension which you do not want to change can also be kept as `0` which means copy the original value.
- * So with `shape=(2,0)`, we will obtain the same result as in the above example.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L261
- * @return org.apache.mxnet.Symbol - */ -def broadcast_to(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Casts all elements of the input to a new type.
- *
- * .. note:: ``Cast`` is deprecated. Use ``cast`` instead.
- *
- * Example::
- *
- * cast([0.9, 1.3], dtype='int32') = [0, 1]
- * cast([1e20, 11.1], dtype='float16') = [inf, 11.09375]
- * cast([300, 11.1, 10.9, -1, -3], dtype='uint8') = [44, 11, 10, 255, 253]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L415
- * @return org.apache.mxnet.Symbol - */ -def cast(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Casts tensor storage type to the new type.
- *
- * When an NDArray with default storage type is cast to csr or row_sparse storage,
- * the result is compact, which means:
- *
- * - for csr, zero values will not be retained
- * - for row_sparse, row slices of all zeros will not be retained
- *
- * The storage type of ``cast_storage`` output depends on stype parameter:
- *
- * - cast_storage(csr, 'default') = default
- * - cast_storage(row_sparse, 'default') = default
- * - cast_storage(default, 'csr') = csr
- * - cast_storage(default, 'row_sparse') = row_sparse
- * - cast_storage(csr, 'csr') = csr
- * - cast_storage(row_sparse, 'row_sparse') = row_sparse
- *
- * Example::
- *
- * dense = [[ 0., 1., 0.],
- * [ 2., 0., 3.],
- * [ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * # cast to row_sparse storage type
- * rsp = cast_storage(dense, 'row_sparse')
- * rsp.indices = [0, 1]
- * rsp.values = [[ 0., 1., 0.],
- * [ 2., 0., 3.]]
- *
- * # cast to csr storage type
- * csr = cast_storage(dense, 'csr')
- * csr.indices = [1, 0, 2]
- * csr.values = [ 1., 2., 3.]
- * csr.indptr = [0, 1, 3, 3, 3]
- *
- *
- *
- * Defined in src/operator/tensor/cast_storage.cc:L71
- * @return org.apache.mxnet.Symbol - */ -def cast_storage(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise cube-root value of the input.
- *
- * .. math::
- * cbrt(x) = \sqrt[3]{x}
- *
- * Example::
- *
- * cbrt([1, 8, -125]) = [1, 2, -5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L706
- * @return org.apache.mxnet.Symbol - */ -def cbrt(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise ceiling of the input.
- *
- * The ceil of the scalar x is the smallest integer i, such that i >= x.
- *
- * Example::
- *
- * ceil([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 2., 2., 3.]
- *
- * The storage type of ``ceil`` output depends upon the input storage type:
- *
- * - ceil(default) = default
- * - ceil(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L568
- * @return org.apache.mxnet.Symbol - */ -def ceil(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Choose one element from each line(row for python, column for R/Julia) in lhs according to index indicated by rhs. This function assume rhs uses 0-based index.
- * @return org.apache.mxnet.Symbol - */ -def choose_element_0index(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Clips (limits) the values in an array.
- *
- * Given an interval, values outside the interval are clipped to the interval edges.
- * Clipping ``x`` between `a_min` and `a_x` would be::
- *
- * clip(x, a_min, a_max) = max(min(x, a_max), a_min))
- *
- * Example::
- *
- * x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- *
- * clip(x,1,8) = [ 1., 1., 2., 3., 4., 5., 6., 7., 8., 8.]
- *
- * The storage type of ``clip`` output depends on storage types of inputs and the a_min, a_max \
- * parameter values:
- *
- * - clip(default) = default
- * - clip(row_sparse, a_min <= 0, a_max >= 0) = row_sparse
- * - clip(csr, a_min <= 0, a_max >= 0) = csr
- * - clip(row_sparse, a_min < 0, a_max < 0) = default
- * - clip(row_sparse, a_min > 0, a_max > 0) = default
- * - clip(csr, a_min < 0, a_max < 0) = csr
- * - clip(csr, a_min > 0, a_max > 0) = csr
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L617
- * @return org.apache.mxnet.Symbol - */ -def clip(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Joins input arrays along a given axis.
- *
- * .. note:: `Concat` is deprecated. Use `concat` instead.
- *
- * The dimensions of the input arrays should be the same except the axis along
- * which they will be concatenated.
- * The dimension of the output array along the concatenated axis will be equal
- * to the sum of the corresponding dimensions of the input arrays.
- *
- * The storage type of ``concat`` output depends on storage types of inputs
- *
- * - concat(csr, csr, ..., csr, dim=0) = csr
- * - otherwise, ``concat`` generates output with default storage
- *
- * Example::
- *
- * x = [[1,1],[2,2]]
- * y = [[3,3],[4,4],[5,5]]
- * z = [[6,6], [7,7],[8,8]]
- *
- * concat(x,y,z,dim=0) = [[ 1., 1.],
- * [ 2., 2.],
- * [ 3., 3.],
- * [ 4., 4.],
- * [ 5., 5.],
- * [ 6., 6.],
- * [ 7., 7.],
- * [ 8., 8.]]
- *
- * Note that you cannot concat x,y,z along dimension 1 since dimension
- * 0 is not the same for all the input arrays.
- *
- * concat(y,z,dim=1) = [[ 3., 3., 6., 6.],
- * [ 4., 4., 7., 7.],
- * [ 5., 5., 8., 8.]]
- *
- *
- *
- * Defined in src/operator/nn/concat.cc:L260
- * @return org.apache.mxnet.Symbol - */ -def concat(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the element-wise cosine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * cos([0, \pi/4, \pi/2]) = [1, 0.707, 0]
- *
- * The storage type of ``cos`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L63
- * @return org.apache.mxnet.Symbol - */ -def cos(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the hyperbolic cosine of the input array, computed element-wise.
- *
- * .. math::
- * cosh(x) = 0.5\times(exp(x) + exp(-x))
- *
- * The storage type of ``cosh`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L216
- * @return org.apache.mxnet.Symbol - */ -def cosh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @return org.apache.mxnet.Symbol - */ -def crop(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Converts each element of the input array from radians to degrees.
- *
- * .. math::
- * degrees([0, \pi/2, \pi, 3\pi/2, 2\pi]) = [0, 90, 180, 270, 360]
- *
- * The storage type of ``degrees`` output depends upon the input storage type:
- *
- * - degrees(default) = default
- * - degrees(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L163
- * @return org.apache.mxnet.Symbol - */ -def degrees(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Dot product of two arrays.
- *
- * ``dot``'s behavior depends on the input array dimensions:
- *
- * - 1-D arrays: inner product of vectors
- * - 2-D arrays: matrix multiplication
- * - N-D arrays: a sum product over the last axis of the first input and the first
- * axis of the second input
- *
- * For example, given 3-D ``x`` with shape `(n,m,k)` and ``y`` with shape `(k,r,s)`, the
- * result array will have shape `(n,m,r,s)`. It is computed by::
- *
- * dot(x,y)[i,j,a,b] = sum(x[i,j,:]*y[:,a,b])
- *
- * Example::
- *
- * x = reshape([0,1,2,3,4,5,6,7], shape=(2,2,2))
- * y = reshape([7,6,5,4,3,2,1,0], shape=(2,2,2))
- * dot(x,y)[0,0,1,1] = 0
- * sum(x[0,0,:]*y[:,1,1]) = 0
- *
- * The storage type of ``dot`` output depends on storage types of inputs, transpose option and
- * forward_stype option for output storage type. Implemented sparse operations include:
- *
- * - dot(default, default, transpose_a=True/False, transpose_b=True/False) = default
- * - dot(csr, default, transpose_a=True) = default
- * - dot(csr, default, transpose_a=True) = row_sparse
- * - dot(csr, default) = default
- * - dot(csr, row_sparse) = default
- * - dot(default, csr) = csr (CPU only)
- * - dot(default, csr, forward_stype='default') = default
- * - dot(default, csr, transpose_b=True, forward_stype='default') = default
- *
- * If the combination of input storage types and forward_stype does not match any of the
- * above patterns, ``dot`` will fallback and generate output with default storage.
- *
- *
- *
- * Defined in src/operator/tensor/dot.cc:L69
- * @return org.apache.mxnet.Symbol - */ -def dot(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Adds arguments element-wise.
- *
- * The storage type of ``elemwise_add`` output depends on storage types of inputs
- *
- * - elemwise_add(row_sparse, row_sparse) = row_sparse
- * - elemwise_add(csr, csr) = csr
- * - elemwise_add(default, csr) = default
- * - elemwise_add(csr, default) = default
- * - elemwise_add(default, rsp) = default
- * - elemwise_add(rsp, default) = default
- * - otherwise, ``elemwise_add`` generates output with default storage
- * @return org.apache.mxnet.Symbol - */ -def elemwise_add(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Divides arguments element-wise.
- *
- * The storage type of ``elemwise_div`` output is always dense
- * @return org.apache.mxnet.Symbol - */ -def elemwise_div(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Multiplies arguments element-wise.
- *
- * The storage type of ``elemwise_mul`` output depends on storage types of inputs
- *
- * - elemwise_mul(default, default) = default
- * - elemwise_mul(row_sparse, row_sparse) = row_sparse
- * - elemwise_mul(default, row_sparse) = row_sparse
- * - elemwise_mul(row_sparse, default) = row_sparse
- * - elemwise_mul(csr, csr) = csr
- * - otherwise, ``elemwise_mul`` generates output with default storage
- * @return org.apache.mxnet.Symbol - */ -def elemwise_mul(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Subtracts arguments element-wise.
- *
- * The storage type of ``elemwise_sub`` output depends on storage types of inputs
- *
- * - elemwise_sub(row_sparse, row_sparse) = row_sparse
- * - elemwise_sub(csr, csr) = csr
- * - elemwise_sub(default, csr) = default
- * - elemwise_sub(csr, default) = default
- * - elemwise_sub(default, rsp) = default
- * - elemwise_sub(rsp, default) = default
- * - otherwise, ``elemwise_sub`` generates output with default storage
- * @return org.apache.mxnet.Symbol - */ -def elemwise_sub(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise exponential value of the input.
- *
- * .. math::
- * exp(x) = e^x \approx 2.718^x
- *
- * Example::
- *
- * exp([0, 1, 2]) = [1., 2.71828175, 7.38905621]
- *
- * The storage type of ``exp`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L746
- * @return org.apache.mxnet.Symbol - */ -def exp(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Inserts a new axis of size 1 into the array shape
- *
- * For example, given ``x`` with shape ``(2,3,4)``, then ``expand_dims(x, axis=1)``
- * will return a new array with shape ``(2,1,3,4)``.
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L346
- * @return org.apache.mxnet.Symbol - */ -def expand_dims(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns ``exp(x) - 1`` computed element-wise on the input.
- *
- * This function provides greater precision than ``exp(x) - 1`` for small values of ``x``.
- *
- * The storage type of ``expm1`` output depends upon the input storage type:
- *
- * - expm1(default) = default
- * - expm1(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L825
- * @return org.apache.mxnet.Symbol - */ -def expm1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Fill one element of each line(row for python, column for R/Julia) in lhs according to index indicated by rhs and values indicated by mhs. This function assume rhs uses 0-based index.
- * @return org.apache.mxnet.Symbol - */ -def fill_element_0index(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise rounded value to the nearest \
- * integer towards zero of the input.
- *
- * Example::
- *
- * fix([-2.1, -1.9, 1.9, 2.1]) = [-2., -1., 1., 2.]
- *
- * The storage type of ``fix`` output depends upon the input storage type:
- *
- * - fix(default) = default
- * - fix(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L625
- * @return org.apache.mxnet.Symbol - */ -def fix(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Flattens the input array into a 2-D array by collapsing the higher dimensions.
- *
- * .. note:: `Flatten` is deprecated. Use `flatten` instead.
- *
- * For an input array with shape ``(d1, d2, ..., dk)``, `flatten` operation reshapes
- * the input array into an output array of shape ``(d1, d2*...*dk)``.
- *
- * Note that the bahavior of this function is different from numpy.ndarray.flatten,
- * which behaves similar to mxnet.ndarray.reshape((-1,)).
- *
- * Example::
- *
- * x = [[
- * [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ],
- * [ [1,2,3],
- * [4,5,6],
- * [7,8,9]
- * ]],
- *
- * flatten(x) = [[ 1., 2., 3., 4., 5., 6., 7., 8., 9.],
- * [ 1., 2., 3., 4., 5., 6., 7., 8., 9.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L258
- * @return org.apache.mxnet.Symbol - */ -def flatten(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @return org.apache.mxnet.Symbol - */ -def flip(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise floor of the input.
- *
- * The floor of the scalar x is the largest integer i, such that i <= x.
- *
- * Example::
- *
- * floor([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-3., -2., 1., 1., 2.]
- *
- * The storage type of ``floor`` output depends upon the input storage type:
- *
- * - floor(default) = default
- * - floor(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L587
- * @return org.apache.mxnet.Symbol - */ -def floor(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * The FTML optimizer described in
- * *FTML - Follow the Moving Leader in Deep Learning*,
- * available at http://proceedings.mlr.press/v70/zheng17a/zheng17a.pdf.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * v_t = \beta_2 v_{t-1} + (1 - \beta_2) g_t^2\\
- * d_t = \frac{ 1 - \beta_1^t }{ \eta_t } (\sqrt{ \frac{ v_t }{ 1 - \beta_2^t } } + \epsilon)
- * \sigma_t = d_t - \beta_1 d_{t-1}
- * z_t = \beta_1 z_{ t-1 } + (1 - \beta_1^t) g_t - \sigma_t W_{t-1}
- * W_t = - \frac{ z_t }{ d_t }
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L447
- * @return org.apache.mxnet.Symbol - */ -def ftml_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Update function for Ftrl optimizer.
- * Referenced from *Ad Click Prediction: a View from the Trenches*, available at
- * http://dl.acm.org/citation.cfm?id=2488200.
- *
- * It updates the weights using::
- *
- * rescaled_grad = clip(grad * rescale_grad, clip_gradient)
- * z += rescaled_grad - (sqrt(n + rescaled_grad**2) - sqrt(n)) * weight / learning_rate
- * n += rescaled_grad**2
- * w = (sign(z) * lamda1 - z) / ((beta + sqrt(n)) / learning_rate + wd) * (abs(z) > lamda1)
- *
- * If w, z and n are all of ``row_sparse`` storage type,
- * only the row slices whose indices appear in grad.indices are updated (for w, z and n)::
- *
- * for row in grad.indices:
- * rescaled_grad[row] = clip(grad[row] * rescale_grad, clip_gradient)
- * z[row] += rescaled_grad[row] - (sqrt(n[row] + rescaled_grad[row]**2) - sqrt(n[row])) * weight[row] / learning_rate
- * n[row] += rescaled_grad[row]**2
- * w[row] = (sign(z[row]) * lamda1 - z[row]) / ((beta + sqrt(n[row])) / learning_rate + wd) * (abs(z[row]) > lamda1)
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L632
- * @return org.apache.mxnet.Symbol - */ -def ftrl_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the gamma function (extension of the factorial function \
- * to the reals), computed element-wise on the input array.
- *
- * The storage type of ``gamma`` output is always dense
- * @return org.apache.mxnet.Symbol - */ -def gamma(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise log of the absolute value of the gamma function \
- * of the input.
- *
- * The storage type of ``gammaln`` output is always dense
- * @return org.apache.mxnet.Symbol - */ -def gammaln(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Gather elements or slices from `data` and store to a tensor whose
- * shape is defined by `indices`.
- *
- * Given `data` with shape `(X_0, X_1, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, output shape will simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}] = data[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}]
- *
- * Examples::
- *
- * data = [[0, 1], [2, 3]]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * gather_nd(data, indices) = [2, 3, 0]
- * @return org.apache.mxnet.Symbol - */ -def gather_nd(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes hard sigmoid of x element-wise.
- *
- * .. math::
- * y = max(0, min(1, alpha * x + beta))
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L118
- * @return org.apache.mxnet.Symbol - */ -def hard_sigmoid(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns a copy of the input.
- *
- * From:src/operator/tensor/elemwise_unary_op_basic.cc:205
- * @return org.apache.mxnet.Symbol - */ -def identity(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the Khatri-Rao product of the input matrices.
- *
- * Given a collection of :math:`n` input matrices,
- *
- * .. math::
- * A_1 \in \mathbb{R}^{M_1 \times M}, \ldots, A_n \in \mathbb{R}^{M_n \times N},
- *
- * the (column-wise) Khatri-Rao product is defined as the matrix,
- *
- * .. math::
- * X = A_1 \otimes \cdots \otimes A_n \in \mathbb{R}^{(M_1 \cdots M_n) \times N},
- *
- * where the :math:`k` th column is equal to the column-wise outer product
- * :math:`{A_1}_k \otimes \cdots \otimes {A_n}_k` where :math:`{A_i}_k` is the kth
- * column of the ith matrix.
- *
- * Example::
- *
- * >>> A = mx.nd.array([[1, -1],
- * >>> [2, -3]])
- * >>> B = mx.nd.array([[1, 4],
- * >>> [2, 5],
- * >>> [3, 6]])
- * >>> C = mx.nd.khatri_rao(A, B)
- * >>> print(C.asnumpy())
- * [[ 1. -4.]
- * [ 2. -5.]
- * [ 3. -6.]
- * [ 2. -12.]
- * [ 4. -15.]
- * [ 6. -18.]]
- *
- *
- *
- * Defined in src/operator/contrib/krprod.cc:L108
- * @return org.apache.mxnet.Symbol - */ -def khatri_rao(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * LQ factorization for general matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, we compute the LQ factorization (LAPACK *gelqf*, followed by *orglq*). *A*
- * must have shape *(x, y)* with *x <= y*, and must have full rank *=x*. The LQ
- * factorization consists of *L* with shape *(x, x)* and *Q* with shape *(x, y)*, so
- * that:
- *
- * *A* = *L* \* *Q*
- *
- * Here, *L* is lower triangular (upper triangle equal to zero) with nonzero diagonal,
- * and *Q* is row-orthonormal, meaning that
- *
- * *Q* \* *Q*\ :sup:`T`
- *
- * is equal to the identity matrix of shape *(x, x)*.
- *
- * If *n>2*, *gelqf* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single LQ factorization
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * Q, L = gelqf(A)
- * Q = [[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]]
- * L = [[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]]
- *
- * // Batch LQ factorization
- * A = [[[1., 2., 3.], [4., 5., 6.]],
- * [[7., 8., 9.], [10., 11., 12.]]]
- * Q, L = gelqf(A)
- * Q = [[[-0.26726124, -0.53452248, -0.80178373],
- * [0.87287156, 0.21821789, -0.43643578]],
- * [[-0.50257071, -0.57436653, -0.64616234],
- * [0.7620735, 0.05862104, -0.64483142]]]
- * L = [[[-3.74165739, 0.],
- * [-8.55235974, 1.96396101]],
- * [[-13.92838828, 0.],
- * [-19.09768702, 0.52758934]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L552
- * @return org.apache.mxnet.Symbol - */ -def linalg_gelqf(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Performs general matrix multiplication and accumulation.
- * Input are tensors *A*, *B*, *C*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*) + *beta* \* *C*
- *
- * Here, *alpha* and *beta* are scalar parameters, and *op()* is either the identity or
- * matrix transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B*, *C* be 5 dimensional tensors. Then gemm(*A*, *B*, *C*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = swapaxes(C, dim1=1, dim2=3)
- * C = gemm(A1, B1, C)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply-add
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * C = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0, beta=10.0)
- * = [[14.0, 14.0, 14.0], [14.0, 14.0, 14.0]]
- *
- * // Batch matrix multiply-add
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * C = [[[10.0]], [[0.01]]]
- * gemm(A, B, C, transpose_b=True, alpha=2.0 , beta=10.0)
- * = [[[104.0]], [[0.14]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L81
- * @return org.apache.mxnet.Symbol - */ -def linalg_gemm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Performs general matrix multiplication.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, the BLAS3 function *gemm* is performed:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *op*\ (*B*)
- *
- * Here *alpha* is a scalar parameter and *op()* is either the identity or the matrix
- * transposition (depending on *transpose_a*, *transpose_b*).
- *
- * If *n>2*, *gemm* is performed separately for a batch of matrices. The column indices of the matrices
- * are given by the last dimensions of the tensors, the row indices by the axis specified with the *axis*
- * parameter. By default, the trailing two dimensions will be used for matrix encoding.
- *
- * For a non-default axis parameter, the operation performed is equivalent to a series of swapaxes/gemm/swapaxes
- * calls. For example let *A*, *B* be 5 dimensional tensors. Then gemm(*A*, *B*, axis=1) is equivalent to
- *
- * A1 = swapaxes(A, dim1=1, dim2=3)
- * B1 = swapaxes(B, dim1=1, dim2=3)
- * C = gemm2(A1, B1)
- * C = swapaxis(C, dim1=1, dim2=3)
- *
- * without the overhead of the additional swapaxis operations.
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1.0, 1.0], [1.0, 1.0]]
- * B = [[1.0, 1.0], [1.0, 1.0], [1.0, 1.0]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[4.0, 4.0, 4.0], [4.0, 4.0, 4.0]]
- *
- * // Batch matrix multiply
- * A = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * B = [[[1.0, 1.0]], [[0.1, 0.1]]]
- * gemm2(A, B, transpose_b=True, alpha=2.0)
- * = [[[4.0]], [[0.04 ]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L151
- * @return org.apache.mxnet.Symbol - */ -def linalg_gemm2(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Performs Cholesky factorization of a symmetric positive-definite matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the Cholesky factor *L* of the symmetric, positive definite matrix *A* is
- * computed. *L* is lower triangular (entries of upper triangle are all zero), has
- * positive diagonal entries, and:
- *
- * *A* = *L* \* *L*\ :sup:`T`
- *
- * If *n>2*, *potrf* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix factorization
- * A = [[4.0, 1.0], [1.0, 4.25]]
- * potrf(A) = [[2.0, 0], [0.5, 2.0]]
- *
- * // Batch matrix factorization
- * A = [[[4.0, 1.0], [1.0, 4.25]], [[16.0, 4.0], [4.0, 17.0]]]
- * potrf(A) = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L201
- * @return org.apache.mxnet.Symbol - */ -def linalg_potrf(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Performs matrix inversion from a Cholesky factorization.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* is a lower triangular matrix (entries of upper triangle are all zero)
- * with positive diagonal. We compute:
- *
- * *out* = *A*\ :sup:`-T` \* *A*\ :sup:`-1`
- *
- * In other words, if *A* is the Cholesky factor of a symmetric positive definite matrix
- * *B* (obtained by *potrf*), then
- *
- * *out* = *B*\ :sup:`-1`
- *
- * If *n>2*, *potri* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * .. note:: Use this operator only if you are certain you need the inverse of *B*, and
- * cannot use the Cholesky factor *A* (*potrf*), together with backsubstitution
- * (*trsm*). The latter is numerically much safer, and also cheaper.
- *
- * Examples::
- *
- * // Single matrix inverse
- * A = [[2.0, 0], [0.5, 2.0]]
- * potri(A) = [[0.26563, -0.0625], [-0.0625, 0.25]]
- *
- * // Batch matrix inverse
- * A = [[[2.0, 0], [0.5, 2.0]], [[4.0, 0], [1.0, 4.0]]]
- * potri(A) = [[[0.26563, -0.0625], [-0.0625, 0.25]],
- * [[0.06641, -0.01562], [-0.01562, 0,0625]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L259
- * @return org.apache.mxnet.Symbol - */ -def linalg_potri(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the sum of the logarithms of the diagonal elements of a square matrix.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, *A* must be square with positive diagonal entries. We sum the natural
- * logarithms of the diagonal elements, the result has shape (1,).
- *
- * If *n>2*, *sumlogdiag* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix reduction
- * A = [[1.0, 1.0], [1.0, 7.0]]
- * sumlogdiag(A) = [1.9459]
- *
- * // Batch matrix reduction
- * A = [[[1.0, 1.0], [1.0, 7.0]], [[3.0, 0], [0, 17.0]]]
- * sumlogdiag(A) = [1.9459, 3.9318]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L428
- * @return org.apache.mxnet.Symbol - */ -def linalg_sumlogdiag(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Multiplication of matrix with its transpose.
- * Input is a tensor *A* of dimension *n >= 2*.
- *
- * If *n=2*, the operator performs the BLAS3 function *syrk*:
- *
- * *out* = *alpha* \* *A* \* *A*\ :sup:`T`
- *
- * if *transpose=False*, or
- *
- * *out* = *alpha* \* *A*\ :sup:`T` \ \* *A*
- *
- * if *transpose=True*.
- *
- * If *n>2*, *syrk* is performed separately on the trailing two dimensions for all
- * inputs (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix multiply
- * A = [[1., 2., 3.], [4., 5., 6.]]
- * syrk(A, alpha=1., transpose=False)
- * = [[14., 32.],
- * [32., 77.]]
- * syrk(A, alpha=1., transpose=True)
- * = [[17., 22., 27.],
- * [22., 29., 36.],
- * [27., 36., 45.]]
- *
- * // Batch matrix multiply
- * A = [[[1., 1.]], [[0.1, 0.1]]]
- * syrk(A, alpha=2., transpose=False) = [[[4.]], [[0.04]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L484
- * @return org.apache.mxnet.Symbol - */ -def linalg_syrk(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Performs multiplication with a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trmm*:
- *
- * *out* = *alpha* \* *op*\ (*A*) \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* = *alpha* \* *B* \* *op*\ (*A*)
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trmm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- *
- * Examples::
- *
- * // Single triangular matrix multiply
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- * trmm(A, B, alpha=2.0) = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- *
- * // Batch triangular matrix multiply
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]], [[0.5, 0.5, 0.5], [0.5, 0.5, 0.5]]]
- * trmm(A, B, alpha=2.0) = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[1.0, 1.0, 1.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L316
- * @return org.apache.mxnet.Symbol - */ -def linalg_trmm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Solves matrix equation involving a lower triangular matrix.
- * Input are tensors *A*, *B*, each of dimension *n >= 2* and having the same shape
- * on the leading *n-2* dimensions.
- *
- * If *n=2*, *A* must be lower triangular. The operator performs the BLAS3 function
- * *trsm*, solving for *out* in:
- *
- * *op*\ (*A*) \* *out* = *alpha* \* *B*
- *
- * if *rightside=False*, or
- *
- * *out* \* *op*\ (*A*) = *alpha* \* *B*
- *
- * if *rightside=True*. Here, *alpha* is a scalar parameter, and *op()* is either the
- * identity or the matrix transposition (depending on *transpose*).
- *
- * If *n>2*, *trsm* is performed separately on the trailing two dimensions for all inputs
- * (batch mode).
- *
- * .. note:: The operator supports float32 and float64 data types only.
- *
- * Examples::
- *
- * // Single matrix solve
- * A = [[1.0, 0], [1.0, 1.0]]
- * B = [[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]]
- * trsm(A, B, alpha=0.5) = [[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]
- *
- * // Batch matrix solve
- * A = [[[1.0, 0], [1.0, 1.0]], [[1.0, 0], [1.0, 1.0]]]
- * B = [[[2.0, 2.0, 2.0], [4.0, 4.0, 4.0]],
- * [[4.0, 4.0, 4.0], [8.0, 8.0, 8.0]]]
- * trsm(A, B, alpha=0.5) = [[[1.0, 1.0, 1.0], [1.0, 1.0, 1.0]],
- * [[2.0, 2.0, 2.0], [2.0, 2.0, 2.0]]]
- *
- *
- * Defined in src/operator/tensor/la_op.cc:L379
- * @return org.apache.mxnet.Symbol - */ -def linalg_trsm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise Natural logarithmic value of the input.
- *
- * The natural logarithm is logarithm in base *e*, so that ``log(exp(x)) = x``
- *
- * The storage type of ``log`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L758
- * @return org.apache.mxnet.Symbol - */ -def log(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise Base-10 logarithmic value of the input.
- *
- * ``10**log10(x) = x``
- *
- * The storage type of ``log10`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L770
- * @return org.apache.mxnet.Symbol - */ -def log10(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise ``log(1 + x)`` value of the input.
- *
- * This function is more accurate than ``log(1 + x)`` for small ``x`` so that
- * :math:`1+x\approx 1`
- *
- * The storage type of ``log1p`` output depends upon the input storage type:
- *
- * - log1p(default) = default
- * - log1p(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L807
- * @return org.apache.mxnet.Symbol - */ -def log1p(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise Base-2 logarithmic value of the input.
- *
- * ``2**log2(x) = x``
- *
- * The storage type of ``log2`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L782
- * @return org.apache.mxnet.Symbol - */ -def log2(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the log softmax of the input.
- * This is equivalent to computing softmax followed by log.
- *
- * Examples::
- *
- * >>> x = mx.nd.array([1, 2, .1])
- * >>> mx.nd.log_softmax(x).asnumpy()
- * array([-1.41702998, -0.41702995, -2.31702995], dtype=float32)
- *
- * >>> x = mx.nd.array( [[1, 2, .1],[.1, 2, 1]] )
- * >>> mx.nd.log_softmax(x, axis=0).asnumpy()
- * array([[-0.34115392, -0.69314718, -1.24115396],
- * [-1.24115396, -0.69314718, -0.34115392]], dtype=float32)
- * @return org.apache.mxnet.Symbol - */ -def log_softmax(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the result of logical NOT (!) function
- *
- * Example:
- * logical_not([-2., 0., 1.]) = [0., 1., 0.]
- * @return org.apache.mxnet.Symbol - */ -def logical_not(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Make your own loss function in network construction.
- *
- * This operator accepts a customized loss function symbol as a terminal loss and
- * the symbol should be an operator with no backward dependency.
- * The output of this function is the gradient of loss with respect to the input data.
- *
- * For example, if you are a making a cross entropy loss function. Assume ``out`` is the
- * predicted output and ``label`` is the true label, then the cross entropy can be defined as::
- *
- * cross_entropy = label * log(out) + (1 - label) * log(1 - out)
- * loss = make_loss(cross_entropy)
- *
- * We will need to use ``make_loss`` when we are creating our own loss function or we want to
- * combine multiple loss functions. Also we may want to stop some variables' gradients
- * from backpropagation. See more detail in ``BlockGrad`` or ``stop_gradient``.
- *
- * The storage type of ``make_loss`` output depends upon the input storage type:
- *
- * - make_loss(default) = default
- * - make_loss(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L303
- * @return org.apache.mxnet.Symbol - */ -def make_loss(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @return org.apache.mxnet.Symbol - */ -def max(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the max of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L190
- * @return org.apache.mxnet.Symbol - */ -def max_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the mean of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L131
- * @return org.apache.mxnet.Symbol - */ -def mean(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @return org.apache.mxnet.Symbol - */ -def min(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the min of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L204
- * @return org.apache.mxnet.Symbol - */ -def min_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Updater function for multi-precision sgd optimizer
- * @return org.apache.mxnet.Symbol - */ -def mp_sgd_mom_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Updater function for multi-precision sgd optimizer
- * @return org.apache.mxnet.Symbol - */ -def mp_sgd_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the product of array elements over given axes treating Not a Numbers (``NaN``) as one.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L176
- * @return org.apache.mxnet.Symbol - */ -def nanprod(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the sum of array elements over given axes treating Not a Numbers (``NaN``) as zero.
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L161
- * @return org.apache.mxnet.Symbol - */ -def nansum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Numerical negative of the argument, element-wise.
- *
- * The storage type of ``negative`` output depends upon the input storage type:
- *
- * - negative(default) = default
- * - negative(row_sparse) = row_sparse
- * - negative(csr) = csr
- * @return org.apache.mxnet.Symbol - */ -def negative(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the norm on an NDArray.
- *
- * This operator computes the norm on an NDArray with the specified axis, depending
- * on the value of the ord parameter. By default, it computes the L2 norm on the entire
- * array.
- *
- * Examples::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * norm(x) = [5.47722578]
- *
- * rsp = x.cast_storage('row_sparse')
- *
- * norm(rsp) = [5.47722578]
- *
- * csr = x.cast_storage('csr')
- *
- * norm(csr) = [5.47722578]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L300
- * @return org.apache.mxnet.Symbol - */ -def norm(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @return org.apache.mxnet.Symbol - */ -def normal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns a one-hot array.
- *
- * The locations represented by `indices` take value `on_value`, while all
- * other locations take value `off_value`.
- *
- * `one_hot` operation with `indices` of shape ``(i0, i1)`` and `depth` of ``d`` would result
- * in an output array of shape ``(i0, i1, d)`` with::
- *
- * output[i,j,:] = off_value
- * output[i,j,indices[i,j]] = on_value
- *
- * Examples::
- *
- * one_hot([1,0,2,0], 3) = [[ 0. 1. 0.]
- * [ 1. 0. 0.]
- * [ 0. 0. 1.]
- * [ 1. 0. 0.]]
- *
- * one_hot([1,0,2,0], 3, on_value=8, off_value=1,
- * dtype='int32') = [[1 8 1]
- * [8 1 1]
- * [1 1 8]
- * [8 1 1]]
- *
- * one_hot([[1,0],[1,0],[2,0]], 3) = [[[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 1. 0.]
- * [ 1. 0. 0.]]
- *
- * [[ 0. 0. 1.]
- * [ 1. 0. 0.]]]
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L490
- * @return org.apache.mxnet.Symbol - */ -def one_hot(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Return an array of ones with the same shape and type
- * as the input array.
- *
- * Examples::
- *
- * x = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * ones_like(x) = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- * @return org.apache.mxnet.Symbol - */ -def ones_like(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Pads an input array with a constant or edge values of the array.
- *
- * .. note:: `Pad` is deprecated. Use `pad` instead.
- *
- * .. note:: Current implementation only supports 4D and 5D input arrays with padding applied
- * only on axes 1, 2 and 3. Expects axes 4 and 5 in `pad_width` to be zero.
- *
- * This operation pads an input array with either a `constant_value` or edge values
- * along each axis of the input array. The amount of padding is specified by `pad_width`.
- *
- * `pad_width` is a tuple of integer padding widths for each axis of the format
- * ``(before_1, after_1, ... , before_N, after_N)``. The `pad_width` should be of length ``2*N``
- * where ``N`` is the number of dimensions of the array.
- *
- * For dimension ``N`` of the input array, ``before_N`` and ``after_N`` indicates how many values
- * to add before and after the elements of the array along dimension ``N``.
- * The widths of the higher two dimensions ``before_1``, ``after_1``, ``before_2``,
- * ``after_2`` must be 0.
- *
- * Example::
- *
- * x = [[[[ 1. 2. 3.]
- * [ 4. 5. 6.]]
- *
- * [[ 7. 8. 9.]
- * [ 10. 11. 12.]]]
- *
- *
- * [[[ 11. 12. 13.]
- * [ 14. 15. 16.]]
- *
- * [[ 17. 18. 19.]
- * [ 20. 21. 22.]]]]
- *
- * pad(x,mode="edge", pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 1. 1. 2. 3. 3.]
- * [ 1. 1. 2. 3. 3.]
- * [ 4. 4. 5. 6. 6.]
- * [ 4. 4. 5. 6. 6.]]
- *
- * [[ 7. 7. 8. 9. 9.]
- * [ 7. 7. 8. 9. 9.]
- * [ 10. 10. 11. 12. 12.]
- * [ 10. 10. 11. 12. 12.]]]
- *
- *
- * [[[ 11. 11. 12. 13. 13.]
- * [ 11. 11. 12. 13. 13.]
- * [ 14. 14. 15. 16. 16.]
- * [ 14. 14. 15. 16. 16.]]
- *
- * [[ 17. 17. 18. 19. 19.]
- * [ 17. 17. 18. 19. 19.]
- * [ 20. 20. 21. 22. 22.]
- * [ 20. 20. 21. 22. 22.]]]]
- *
- * pad(x, mode="constant", constant_value=0, pad_width=(0,0,0,0,1,1,1,1)) =
- *
- * [[[[ 0. 0. 0. 0. 0.]
- * [ 0. 1. 2. 3. 0.]
- * [ 0. 4. 5. 6. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 7. 8. 9. 0.]
- * [ 0. 10. 11. 12. 0.]
- * [ 0. 0. 0. 0. 0.]]]
- *
- *
- * [[[ 0. 0. 0. 0. 0.]
- * [ 0. 11. 12. 13. 0.]
- * [ 0. 14. 15. 16. 0.]
- * [ 0. 0. 0. 0. 0.]]
- *
- * [[ 0. 0. 0. 0. 0.]
- * [ 0. 17. 18. 19. 0.]
- * [ 0. 20. 21. 22. 0.]
- * [ 0. 0. 0. 0. 0.]]]]
- *
- *
- *
- *
- * Defined in src/operator/pad.cc:L766
- * @return org.apache.mxnet.Symbol - */ -def pad(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Picks elements from an input array according to the input indices along the given axis.
- *
- * Given an input array of shape ``(d0, d1)`` and indices of shape ``(i0,)``, the result will be
- * an output array of shape ``(i0,)`` with::
- *
- * output[i] = input[i, indices[i]]
- *
- * By default, if any index mentioned is too large, it is replaced by the index that addresses
- * the last element along an axis (the `clip` mode).
- *
- * This function supports n-dimensional input and (n-1)-dimensional indices arrays.
- *
- * Examples::
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // picks elements with specified indices along axis 0
- * pick(x, y=[0,1], 0) = [ 1., 4.]
- *
- * // picks elements with specified indices along axis 1
- * pick(x, y=[0,1,0], 1) = [ 1., 4., 5.]
- *
- * y = [[ 1.],
- * [ 0.],
- * [ 2.]]
- *
- * // picks elements with specified indices along axis 1 and dims are maintained
- * pick(x,y, 1, keepdims=True) = [[ 2.],
- * [ 3.],
- * [ 6.]]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_index.cc:L145
- * @return org.apache.mxnet.Symbol - */ -def pick(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the product of array elements over given axes.
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L146
- * @return org.apache.mxnet.Symbol - */ -def prod(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Converts each element of the input array from degrees to radians.
- *
- * .. math::
- * radians([0, 90, 180, 270, 360]) = [0, \pi/2, \pi, 3\pi/2, 2\pi]
- *
- * The storage type of ``radians`` output depends upon the input storage type:
- *
- * - radians(default) = default
- * - radians(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L182
- * @return org.apache.mxnet.Symbol - */ -def radians(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Draw random samples from an exponential distribution.
- *
- * Samples are distributed according to an exponential distribution parametrized by *lambda* (rate).
- *
- * Example::
- *
- * exponential(lam=4, shape=(2,2)) = [[ 0.0097189 , 0.08999364],
- * [ 0.04146638, 0.31715935]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L115
- * @return org.apache.mxnet.Symbol - */ -def random_exponential(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Draw random samples from a gamma distribution.
- *
- * Samples are distributed according to a gamma distribution parametrized by *alpha* (shape) and *beta* (scale).
- *
- * Example::
- *
- * gamma(alpha=9, beta=0.5, shape=(2,2)) = [[ 7.10486984, 3.37695289],
- * [ 3.91697288, 3.65933681]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L100
- * @return org.apache.mxnet.Symbol - */ -def random_gamma(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Draw random samples from a generalized negative binomial distribution.
- *
- * Samples are distributed according to a generalized negative binomial distribution parametrized by
- * *mu* (mean) and *alpha* (dispersion). *alpha* is defined as *1/k* where *k* is the failure limit of the
- * number of unsuccessful experiments (generalized to real numbers).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * generalized_negative_binomial(mu=2.0, alpha=0.3, shape=(2,2)) = [[ 2., 1.],
- * [ 6., 4.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L168
- * @return org.apache.mxnet.Symbol - */ -def random_generalized_negative_binomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Draw random samples from a negative binomial distribution.
- *
- * Samples are distributed according to a negative binomial distribution parametrized by
- * *k* (limit of unsuccessful experiments) and *p* (failure probability in each experiment).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * negative_binomial(k=3, p=0.4, shape=(2,2)) = [[ 4., 7.],
- * [ 2., 5.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L149
- * @return org.apache.mxnet.Symbol - */ -def random_negative_binomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Draw random samples from a normal (Gaussian) distribution.
- *
- * .. note:: The existing alias ``normal`` is deprecated.
- *
- * Samples are distributed according to a normal distribution parametrized by *loc* (mean) and *scale* (standard deviation).
- *
- * Example::
- *
- * normal(loc=0, scale=1, shape=(2,2)) = [[ 1.89171135, -1.16881478],
- * [-1.23474145, 1.55807114]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L85
- * @return org.apache.mxnet.Symbol - */ -def random_normal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Draw random samples from a Poisson distribution.
- *
- * Samples are distributed according to a Poisson distribution parametrized by *lambda* (rate).
- * Samples will always be returned as a floating point data type.
- *
- * Example::
- *
- * poisson(lam=4, shape=(2,2)) = [[ 5., 2.],
- * [ 4., 6.]]
- *
- *
- * Defined in src/operator/random/sample_op.cc:L132
- * @return org.apache.mxnet.Symbol - */ -def random_poisson(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @return org.apache.mxnet.Symbol - */ -def random_uniform(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Converts a batch of index arrays into an array of flat indices. The operator follows numpy conventions so a single multi index is given by a column of the input matrix.
- *
- * Examples::
- *
- * A = [[3,6,6],[4,5,1]]
- * ravel(A, shape=(7,6)) = [22,41,37]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L41
- * @return org.apache.mxnet.Symbol - */ -def ravel_multi_index(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise inverse cube-root value of the input.
- *
- * .. math::
- * rcbrt(x) = 1/\sqrt[3]{x}
- *
- * Example::
- *
- * rcbrt([1,8,-125]) = [1.0, 0.5, -0.2]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L723
- * @return org.apache.mxnet.Symbol - */ -def rcbrt(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the reciprocal of the argument, element-wise.
- *
- * Calculates 1/x.
- *
- * Example::
- *
- * reciprocal([-2, 1, 3, 1.6, 0.2]) = [-0.5, 1.0, 0.33333334, 0.625, 5.0]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L468
- * @return org.apache.mxnet.Symbol - */ -def reciprocal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes rectified linear.
- *
- * .. math::
- * max(features, 0)
- *
- * The storage type of ``relu`` output depends upon the input storage type:
- *
- * - relu(default) = default
- * - relu(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L85
- * @return org.apache.mxnet.Symbol - */ -def relu(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Repeats elements of an array.
- *
- * By default, ``repeat`` flattens the input array into 1-D and then repeats the
- * elements::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * repeat(x, repeats=2) = [ 1., 1., 2., 2., 3., 3., 4., 4.]
- *
- * The parameter ``axis`` specifies the axis along which to perform repeat::
- *
- * repeat(x, repeats=2, axis=1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- * repeat(x, repeats=2, axis=0) = [[ 1., 2.],
- * [ 1., 2.],
- * [ 3., 4.],
- * [ 3., 4.]]
- *
- * repeat(x, repeats=2, axis=-1) = [[ 1., 1., 2., 2.],
- * [ 3., 3., 4., 4.]]
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L690
- * @return org.apache.mxnet.Symbol - */ -def repeat(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Reshapes the input array.
- *
- * .. note:: ``Reshape`` is deprecated, use ``reshape``
- *
- * Given an array and a shape, this function returns a copy of the array in the new shape.
- * The shape is a tuple of integers such as (2,3,4). The size of the new shape should be same as the size of the input array.
- *
- * Example::
- *
- * reshape([1,2,3,4], shape=(2,2)) = [[1,2], [3,4]]
- *
- * Some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}. The significance of each is explained below:
- *
- * - ``0`` copy this dimension from the input to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (4,0,2), output shape = (4,3,2)
- * - input shape = (2,3,4), shape = (2,0,0), output shape = (2,3,4)
- *
- * - ``-1`` infers the dimension of the output shape by using the remainder of the input dimensions
- * keeping the size of the new array same as that of the input array.
- * At most one dimension of shape can be -1.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (6,1,-1), output shape = (6,1,4)
- * - input shape = (2,3,4), shape = (3,-1,8), output shape = (3,1,8)
- * - input shape = (2,3,4), shape=(-1,), output shape = (24,)
- *
- * - ``-2`` copy all/remainder of the input dimensions to the output shape.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-2,), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (2,-2), output shape = (2,3,4)
- * - input shape = (2,3,4), shape = (-2,1,1), output shape = (2,3,4,1,1)
- *
- * - ``-3`` use the product of two consecutive dimensions of the input shape as the output dimension.
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-3,4), output shape = (6,4)
- * - input shape = (2,3,4,5), shape = (-3,-3), output shape = (6,20)
- * - input shape = (2,3,4), shape = (0,-3), output shape = (2,12)
- * - input shape = (2,3,4), shape = (-3,-2), output shape = (6,4)
- *
- * - ``-4`` split one dimension of the input into two dimensions passed subsequent to -4 in shape (can contain -1).
- *
- * Example::
- *
- * - input shape = (2,3,4), shape = (-4,1,2,-2), output shape =(1,2,3,4)
- * - input shape = (2,3,4), shape = (2,-4,-1,3,-2), output shape = (2,1,3,4)
- *
- * If the argument `reverse` is set to 1, then the special values are inferred from right to left.
- *
- * Example::
- *
- * - without reverse=1, for input shape = (10,5,4), shape = (-1,0), output shape would be (40,5)
- * - with reverse=1, output shape will be (50,4).
- *
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L168
- * @return org.apache.mxnet.Symbol - */ -def reshape(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Reshape lhs to have the same shape as rhs.
- * @return org.apache.mxnet.Symbol - */ -def reshape_like(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Reverses the order of elements along given axis while preserving array shape.
- *
- * Note: reverse and flip are equivalent. We use reverse in the following examples.
- *
- * Examples::
- *
- * x = [[ 0., 1., 2., 3., 4.],
- * [ 5., 6., 7., 8., 9.]]
- *
- * reverse(x, axis=0) = [[ 5., 6., 7., 8., 9.],
- * [ 0., 1., 2., 3., 4.]]
- *
- * reverse(x, axis=1) = [[ 4., 3., 2., 1., 0.],
- * [ 9., 8., 7., 6., 5.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L792
- * @return org.apache.mxnet.Symbol - */ -def reverse(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * .. note::
- * - For input ``n.5`` ``rint`` returns ``n`` while ``round`` returns ``n+1``.
- * - For input ``-n.5`` both ``rint`` and ``round`` returns ``-n-1``.
- *
- * Example::
- *
- * rint([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 1., -2., 2., 2.]
- *
- * The storage type of ``rint`` output depends upon the input storage type:
- *
- * - rint(default) = default
- * - rint(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L549
- * @return org.apache.mxnet.Symbol - */ -def rint(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Update function for `RMSProp` optimizer.
- *
- * `RMSprop` is a variant of stochastic gradient descent where the gradients are
- * divided by a cache which grows with the sum of squares of recent gradients?
- *
- * `RMSProp` is similar to `AdaGrad`, a popular variant of `SGD` which adaptively
- * tunes the learning rate of each parameter. `AdaGrad` lowers the learning rate for
- * each parameter monotonically over the course of training.
- * While this is analytically motivated for convex optimizations, it may not be ideal
- * for non-convex problems. `RMSProp` deals with this heuristically by allowing the
- * learning rates to rebound as the denominator decays over time.
- *
- * Define the Root Mean Square (RMS) error criterion of the gradient as
- * :math:`RMS[g]_t = \sqrt{E[g^2]_t + \epsilon}`, where :math:`g` represents
- * gradient and :math:`E[g^2]_t` is the decaying average over past squared gradient.
- *
- * The :math:`E[g^2]_t` is given by:
- *
- * .. math::
- * E[g^2]_t = \gamma * E[g^2]_{t-1} + (1-\gamma) * g_t^2
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t - \frac{\eta}{RMS[g]_t} g_t
- *
- * The RMSProp code follows the version in
- * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf
- * Tieleman & Hinton, 2012.
- *
- * Hinton suggests the momentum term :math:`\gamma` to be 0.9 and the learning rate
- * :math:`\eta` to be 0.001.
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L553
- * @return org.apache.mxnet.Symbol - */ -def rmsprop_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Update function for RMSPropAlex optimizer.
- *
- * `RMSPropAlex` is non-centered version of `RMSProp`.
- *
- * Define :math:`E[g^2]_t` is the decaying average over past squared gradient and
- * :math:`E[g]_t` is the decaying average over past gradient.
- *
- * .. math::
- * E[g^2]_t = \gamma_1 * E[g^2]_{t-1} + (1 - \gamma_1) * g_t^2\\
- * E[g]_t = \gamma_1 * E[g]_{t-1} + (1 - \gamma_1) * g_t\\
- * \Delta_t = \gamma_2 * \Delta_{t-1} - \frac{\eta}{\sqrt{E[g^2]_t - E[g]_t^2 + \epsilon}} g_t\\
- *
- * The update step is
- *
- * .. math::
- * \theta_{t+1} = \theta_t + \Delta_t
- *
- * The RMSPropAlex code follows the version in
- * http://arxiv.org/pdf/1308.0850v5.pdf Eq(38) - Eq(45) by Alex Graves, 2013.
- *
- * Graves suggests the momentum term :math:`\gamma_1` to be 0.95, :math:`\gamma_2`
- * to be 0.9 and the learning rate :math:`\eta` to be 0.0001.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L592
- * @return org.apache.mxnet.Symbol - */ -def rmspropalex_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise rounded value to the nearest integer of the input.
- *
- * Example::
- *
- * round([-1.5, 1.5, -1.9, 1.9, 2.1]) = [-2., 2., -2., 2., 2.]
- *
- * The storage type of ``round`` output depends upon the input storage type:
- *
- * - round(default) = default
- * - round(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L528
- * @return org.apache.mxnet.Symbol - */ -def round(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise inverse square-root value of the input.
- *
- * .. math::
- * rsqrt(x) = 1/\sqrt{x}
- *
- * Example::
- *
- * rsqrt([4,9,16]) = [0.5, 0.33333334, 0.25]
- *
- * The storage type of ``rsqrt`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L689
- * @return org.apache.mxnet.Symbol - */ -def rsqrt(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * exponential distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_exponential(lam) = [ 0.51837951, 0.09994757]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_exponential(lam, shape=(2)) = [[ 0.51837951, 0.19866663],
- * [ 0.09994757, 0.50447971]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L284
- * @return org.apache.mxnet.Symbol - */ -def sample_exponential(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * gamma distributions with parameters *alpha* (shape) and *beta* (scale).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * alpha = [ 0.0, 2.5 ]
- * beta = [ 1.0, 0.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_gamma(alpha, beta) = [ 0. , 2.25797319]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_gamma(alpha, beta, shape=(2)) = [[ 0. , 0. ],
- * [ 2.25797319, 1.70734084]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L282
- * @return org.apache.mxnet.Symbol - */ -def sample_gamma(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * generalized negative binomial distributions with parameters *mu* (mean) and *alpha* (dispersion).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * mu = [ 2.0, 2.5 ]
- * alpha = [ 1.0, 0.1 ]
- *
- * // Draw a single sample for each distribution
- * sample_generalized_negative_binomial(mu, alpha) = [ 0., 3.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_generalized_negative_binomial(mu, alpha, shape=(2)) = [[ 0., 3.],
- * [ 3., 1.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L293
- * @return org.apache.mxnet.Symbol - */ -def sample_generalized_negative_binomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple multinomial distributions.
- *
- * *data* is an *n* dimensional array whose last dimension has length *k*, where
- * *k* is the number of possible outcomes of each multinomial distribution. This
- * operator will draw *shape* samples from each distribution. If shape is empty
- * one sample will be drawn from each distribution.
- *
- * If *get_prob* is true, a second array containing log likelihood of the drawn
- * samples will also be returned. This is usually used for reinforcement learning
- * where you can provide reward as head gradient for this array to estimate
- * gradient.
- *
- * Note that the input distribution must be normalized, i.e. *data* must sum to
- * 1 along its last axis.
- *
- * Examples::
- *
- * probs = [[0, 0.1, 0.2, 0.3, 0.4], [0.4, 0.3, 0.2, 0.1, 0]]
- *
- * // Draw a single sample for each distribution
- * sample_multinomial(probs) = [3, 0]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_multinomial(probs, shape=(2)) = [[4, 2],
- * [0, 0]]
- *
- * // requests log likelihood
- * sample_multinomial(probs, get_prob=True) = [2, 1], [0.2, 0.3]
- * @return org.apache.mxnet.Symbol - */ -def sample_multinomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * negative binomial distributions with parameters *k* (failure limit) and *p* (failure probability).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * k = [ 20, 49 ]
- * p = [ 0.4 , 0.77 ]
- *
- * // Draw a single sample for each distribution
- * sample_negative_binomial(k, p) = [ 15., 16.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_negative_binomial(k, p, shape=(2)) = [[ 15., 50.],
- * [ 16., 12.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L289
- * @return org.apache.mxnet.Symbol - */ -def sample_negative_binomial(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * normal distributions with parameters *mu* (mean) and *sigma* (standard deviation).
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * mu = [ 0.0, 2.5 ]
- * sigma = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_normal(mu, sigma) = [-0.56410581, 0.95934606]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_normal(mu, sigma, shape=(2)) = [[-0.56410581, 0.2928229 ],
- * [ 0.95934606, 4.48287058]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L279
- * @return org.apache.mxnet.Symbol - */ -def sample_normal(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * Poisson distributions with parameters lambda (rate).
- *
- * The parameters of the distributions are provided as an input array.
- * Let *[s]* be the shape of the input array, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input array, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input value at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input array.
- *
- * Samples will always be returned as a floating point data type.
- *
- * Examples::
- *
- * lam = [ 1.0, 8.5 ]
- *
- * // Draw a single sample for each distribution
- * sample_poisson(lam) = [ 0., 13.]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_poisson(lam, shape=(2)) = [[ 0., 4.],
- * [ 13., 8.]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L286
- * @return org.apache.mxnet.Symbol - */ -def sample_poisson(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Concurrent sampling from multiple
- * uniform distributions on the intervals given by *[low,high)*.
- *
- * The parameters of the distributions are provided as input arrays.
- * Let *[s]* be the shape of the input arrays, *n* be the dimension of *[s]*, *[t]*
- * be the shape specified as the parameter of the operator, and *m* be the dimension
- * of *[t]*. Then the output will be a *(n+m)*-dimensional array with shape *[s]x[t]*.
- *
- * For any valid *n*-dimensional index *i* with respect to the input arrays, *output[i]*
- * will be an *m*-dimensional array that holds randomly drawn samples from the distribution
- * which is parameterized by the input values at index *i*. If the shape parameter of the
- * operator is not set, then one sample will be drawn per distribution and the output array
- * has the same shape as the input arrays.
- *
- * Examples::
- *
- * low = [ 0.0, 2.5 ]
- * high = [ 1.0, 3.7 ]
- *
- * // Draw a single sample for each distribution
- * sample_uniform(low, high) = [ 0.40451524, 3.18687344]
- *
- * // Draw a vector containing two samples for each distribution
- * sample_uniform(low, high, shape=(2)) = [[ 0.40451524, 0.18017688],
- * [ 3.18687344, 3.68352246]]
- *
- *
- * Defined in src/operator/random/multisample_op.cc:L277
- * @return org.apache.mxnet.Symbol - */ -def sample_uniform(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Scatters data into a new tensor according to indices.
- *
- * Given `data` with shape `(Y_0, ..., Y_{K-1}, X_M, ..., X_{N-1})` and indices with shape
- * `(M, Y_0, ..., Y_{K-1})`, the output will have shape `(X_0, X_1, ..., X_{N-1})`,
- * where `M <= N`. If `M == N`, data shape should simply be `(Y_0, ..., Y_{K-1})`.
- *
- * The elements in output is defined as follows::
- *
- * output[indices[0, y_0, ..., y_{K-1}],
- * ...,
- * indices[M-1, y_0, ..., y_{K-1}],
- * x_M, ..., x_{N-1}] = data[y_0, ..., y_{K-1}, x_M, ..., x_{N-1}]
- *
- * all other entries in output are 0.
- *
- * .. warning::
- *
- * If the indices have duplicates, the result will be non-deterministic and
- * the gradient of `scatter_nd` will not be correct!!
- *
- *
- * Examples::
- *
- * data = [2, 3, 0]
- * indices = [[1, 1, 0], [0, 1, 0]]
- * shape = (2, 2)
- * scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
- * @return org.apache.mxnet.Symbol - */ -def scatter_nd(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Momentum update function for Stochastic Gradient Descent (SGD) optimizer.
- *
- * Momentum update has better convergence rates on neural networks. Mathematically it looks
- * like below:
- *
- * .. math::
- *
- * v_1 = \alpha * \nabla J(W_0)\\
- * v_t = \gamma v_{t-1} - \alpha * \nabla J(W_{t-1})\\
- * W_t = W_{t-1} + v_t
- *
- * It updates the weights using::
- *
- * v = momentum * v - learning_rate * gradient
- * weight += v
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * However, if grad's storage type is ``row_sparse``, ``lazy_update`` is True and weight's storage
- * type is the same as momentum's storage type,
- * only the row slices whose indices appear in grad.indices are updated (for both weight and momentum)::
- *
- * for row in gradient.indices:
- * v[row] = momentum[row] * v[row] - learning_rate * gradient[row]
- * weight[row] += v[row]
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L372
- * @return org.apache.mxnet.Symbol - */ -def sgd_mom_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Update function for Stochastic Gradient Descent (SDG) optimizer.
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * (gradient + wd * weight)
- *
- * However, if gradient is of ``row_sparse`` storage type and ``lazy_update`` is True,
- * only the row slices whose indices appear in grad.indices are updated::
- *
- * for row in gradient.indices:
- * weight[row] = weight[row] - learning_rate * (gradient[row] + wd * weight[row])
- *
- *
- *
- * Defined in src/operator/optimizer_op.cc:L331
- * @return org.apache.mxnet.Symbol - */ -def sgd_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Randomly shuffle the elements.
- *
- * This shuffles the array along the first axis.
- * The order of the elements in each subarray does not change.
- * For example, if a 2D array is given, the order of the rows randomly changes,
- * but the order of the elements in each row does not change.
- * @return org.apache.mxnet.Symbol - */ -def shuffle(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes sigmoid of x element-wise.
- *
- * .. math::
- * y = 1 / (1 + exp(-x))
- *
- * The storage type of ``sigmoid`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L104
- * @return org.apache.mxnet.Symbol - */ -def sigmoid(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise sign of the input.
- *
- * Example::
- *
- * sign([-2, 0, 3]) = [-1, 0, 1]
- *
- * The storage type of ``sign`` output depends upon the input storage type:
- *
- * - sign(default) = default
- * - sign(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L509
- * @return org.apache.mxnet.Symbol - */ -def sign(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Update function for SignSGD optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * W_t = W_{t-1} - \eta_t \text{sign}(g_t)
- *
- * It updates the weights using::
- *
- * weight = weight - learning_rate * sign(gradient)
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L57
- * @return org.apache.mxnet.Symbol - */ -def signsgd_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * SIGN momentUM (Signum) optimizer.
- *
- * .. math::
- *
- * g_t = \nabla J(W_{t-1})\\
- * m_t = \beta m_{t-1} + (1 - \beta) g_t\\
- * W_t = W_{t-1} - \eta_t \text{sign}(m_t)
- *
- * It updates the weights using::
- * state = momentum * state + (1-momentum) * gradient
- * weight = weight - learning_rate * sign(state)
- *
- * Where the parameter ``momentum`` is the decay rate of momentum estimates at each epoch.
- *
- * .. note::
- * - sparse ndarray not supported for this optimizer yet.
- *
- *
- * Defined in src/operator/optimizer_op.cc:L86
- * @return org.apache.mxnet.Symbol - */ -def signum_update(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the element-wise sine of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * sin([0, \pi/4, \pi/2]) = [0, 0.707, 1]
- *
- * The storage type of ``sin`` output depends upon the input storage type:
- *
- * - sin(default) = default
- * - sin(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L46
- * @return org.apache.mxnet.Symbol - */ -def sin(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the hyperbolic sine of the input array, computed element-wise.
- *
- * .. math::
- * sinh(x) = 0.5\times(exp(x) - exp(-x))
- *
- * The storage type of ``sinh`` output depends upon the input storage type:
- *
- * - sinh(default) = default
- * - sinh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L201
- * @return org.apache.mxnet.Symbol - */ -def sinh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Slices a region of the array.
- *
- * .. note:: ``crop`` is deprecated. Use ``slice`` instead.
- *
- * This function returns a sliced array between the indices given
- * by `begin` and `end` with the corresponding `step`.
- *
- * For an input array of ``shape=(d_0, d_1, ..., d_n-1)``,
- * slice operation with ``begin=(b_0, b_1...b_m-1)``,
- * ``end=(e_0, e_1, ..., e_m-1)``, and ``step=(s_0, s_1, ..., s_m-1)``,
- * where m <= n, results in an array with the shape
- * ``(|e_0-b_0|/|s_0|, ..., |e_m-1-b_m-1|/|s_m-1|, d_m, ..., d_n-1)``.
- *
- * The resulting array's *k*-th dimension contains elements
- * from the *k*-th dimension of the input array starting
- * from index ``b_k`` (inclusive) with step ``s_k``
- * until reaching ``e_k`` (exclusive).
- *
- * If the *k*-th elements are `None` in the sequence of `begin`, `end`,
- * and `step`, the following rule will be used to set default values.
- * If `s_k` is `None`, set `s_k=1`. If `s_k > 0`, set `b_k=0`, `e_k=d_k`;
- * else, set `b_k=d_k-1`, `e_k=-1`.
- *
- * The storage type of ``slice`` output depends on storage types of inputs
- *
- * - slice(csr) = csr
- * - otherwise, ``slice`` generates output with default storage
- *
- * .. note:: When input data storage type is csr, it only supports
- * step=(), or step=(None,), or step=(1,) to generate a csr output.
- * For other step parameter values, it falls back to slicing
- * a dense tensor.
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice(x, begin=(0,1), end=(2,4)) = [[ 2., 3., 4.],
- * [ 6., 7., 8.]]
- * slice(x, begin=(None, 0), end=(None, 3), step=(-1, 2)) = [[9., 11.],
- * [5., 7.],
- * [1., 3.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L412
- * @return org.apache.mxnet.Symbol - */ -def slice(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Slices along a given axis.
- *
- * Returns an array slice along a given `axis` starting from the `begin` index
- * to the `end` index.
- *
- * Examples::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=0, begin=1, end=3) = [[ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * slice_axis(x, axis=1, begin=0, end=2) = [[ 1., 2.],
- * [ 5., 6.],
- * [ 9., 10.]]
- *
- * slice_axis(x, axis=1, begin=-3, end=-1) = [[ 2., 3.],
- * [ 6., 7.],
- * [ 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L499
- * @return org.apache.mxnet.Symbol - */ -def slice_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Slices a region of the array like the shape of another array.
- *
- * This function is similar to ``slice``, however, the `begin` are always `0`s
- * and `end` of specific axes are inferred from the second input `shape_like`.
- *
- * Given the second `shape_like` input of ``shape=(d_0, d_1, ..., d_n-1)``,
- * a ``slice_like`` operator with default empty `axes`, it performs the
- * following operation:
- *
- * `` out = slice(input, begin=(0, 0, ..., 0), end=(d_0, d_1, ..., d_n-1))``.
- *
- * When `axes` is not empty, it is used to speficy which axes are being sliced.
- *
- * Given a 4-d input data, ``slice_like`` operator with ``axes=(0, 2, -1)``
- * will perform the following operation:
- *
- * `` out = slice(input, begin=(0, 0, 0, 0), end=(d_0, None, d_2, d_3))``.
- *
- * Note that it is allowed to have first and second input with different dimensions,
- * however, you have to make sure the `axes` are specified and not exceeding the
- * dimension limits.
- *
- * For example, given `input_1` with ``shape=(2,3,4,5)`` and `input_2` with
- * ``shape=(1,2,3)``, it is not allowed to use:
- *
- * `` out = slice_like(a, b)`` because ndim of `input_1` is 4, and ndim of `input_2`
- * is 3.
- *
- * The following is allowed in this situation:
- *
- * `` out = slice_like(a, b, axes=(0, 2))``
- *
- * Example::
- *
- * x = [[ 1., 2., 3., 4.],
- * [ 5., 6., 7., 8.],
- * [ 9., 10., 11., 12.]]
- *
- * y = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- *
- * slice_like(x, y) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0, 1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]]
- * slice_like(x, y, axes=(0)) = [[ 1., 2., 3., 4.]
- * [ 5., 6., 7., 8.]]
- * slice_like(x, y, axes=(-1)) = [[ 1., 2., 3.]
- * [ 5., 6., 7.]
- * [ 9., 10., 11.]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L568
- * @return org.apache.mxnet.Symbol - */ -def slice_like(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Calculate Smooth L1 Loss(lhs, scalar) by summing
- *
- * .. math::
- *
- * f(x) =
- * \begin{cases}
- * (\sigma x)^2/2,& \text{if }x < 1/\sigma^2\\
- * |x|-0.5/\sigma^2,& \text{otherwise}
- * \end{cases}
- *
- * where :math:`x` is an element of the tensor *lhs* and :math:`\sigma` is the scalar.
- *
- * Example::
- *
- * smooth_l1([1, 2, 3, 4], scalar=1) = [0.5, 1.5, 2.5, 3.5]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_binary_scalar_op_extended.cc:L103
- * @return org.apache.mxnet.Symbol - */ -def smooth_l1(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Applies the softmax function.
- *
- * The resulting array contains elements in the range (0,1) and the elements along the given axis sum up to 1.
- *
- * .. math::
- * softmax(\mathbf{z})_j = \frac{e^{z_j}}{\sum_{k=1}^K e^{z_k}}
- *
- * for :math:`j = 1, ..., K`
- *
- * Example::
- *
- * x = [[ 1. 1. 1.]
- * [ 1. 1. 1.]]
- *
- * softmax(x,axis=0) = [[ 0.5 0.5 0.5]
- * [ 0.5 0.5 0.5]]
- *
- * softmax(x,axis=1) = [[ 0.33333334, 0.33333334, 0.33333334],
- * [ 0.33333334, 0.33333334, 0.33333334]]
- *
- *
- *
- * Defined in src/operator/nn/softmax.cc:L95
- * @return org.apache.mxnet.Symbol - */ -def softmax(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Calculate cross entropy of softmax output and one-hot label.
- *
- * - This operator computes the cross entropy in two steps:
- * - Applies softmax function on the input array.
- * - Computes and returns the cross entropy loss between the softmax output and the labels.
- *
- * - The softmax function and cross entropy loss is given by:
- *
- * - Softmax Function:
- *
- * .. math:: \text{softmax}(x)_i = \frac{exp(x_i)}{\sum_j exp(x_j)}
- *
- * - Cross Entropy Function:
- *
- * .. math:: \text{CE(label, output)} = - \sum_i \text{label}_i \log(\text{output}_i)
- *
- * Example::
- *
- * x = [[1, 2, 3],
- * [11, 7, 5]]
- *
- * label = [2, 0]
- *
- * softmax(x) = [[0.09003057, 0.24472848, 0.66524094],
- * [0.97962922, 0.01794253, 0.00242826]]
- *
- * softmax_cross_entropy(data, label) = - log(0.66524084) - log(0.97962922) = 0.4281871
- *
- *
- *
- * Defined in src/operator/loss_binary_op.cc:L59
- * @return org.apache.mxnet.Symbol - */ -def softmax_cross_entropy(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes softsign of x element-wise.
- *
- * .. math::
- * y = x / (1 + abs(x))
- *
- * The storage type of ``softsign`` output is always dense
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L148
- * @return org.apache.mxnet.Symbol - */ -def softsign(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns a sorted copy of an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 1, 4],
- * [ 3, 1]]
- *
- * // sorts along the last axis
- * sort(x) = [[ 1., 4.],
- * [ 1., 3.]]
- *
- * // flattens and then sorts
- * sort(x) = [ 1., 1., 3., 4.]
- *
- * // sorts along the first axis
- * sort(x, axis=0) = [[ 1., 1.],
- * [ 3., 4.]]
- *
- * // in a descend order
- * sort(x, is_ascend=0) = [[ 4., 1.],
- * [ 3., 1.]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L126
- * @return org.apache.mxnet.Symbol - */ -def sort(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Splits an array along a particular axis into multiple sub-arrays.
- *
- * .. note:: ``SliceChannel`` is deprecated. Use ``split`` instead.
- *
- * **Note** that `num_outputs` should evenly divide the length of the axis
- * along which to split the array.
- *
- * Example::
- *
- * x = [[[ 1.]
- * [ 2.]]
- * [[ 3.]
- * [ 4.]]
- * [[ 5.]
- * [ 6.]]]
- * x.shape = (3, 2, 1)
- *
- * y = split(x, axis=1, num_outputs=2) // a list of 2 arrays with shape (3, 1, 1)
- * y = [[[ 1.]]
- * [[ 3.]]
- * [[ 5.]]]
- *
- * [[[ 2.]]
- * [[ 4.]]
- * [[ 6.]]]
- *
- * y[0].shape = (3, 1, 1)
- *
- * z = split(x, axis=0, num_outputs=3) // a list of 3 arrays with shape (1, 2, 1)
- * z = [[[ 1.]
- * [ 2.]]]
- *
- * [[[ 3.]
- * [ 4.]]]
- *
- * [[[ 5.]
- * [ 6.]]]
- *
- * z[0].shape = (1, 2, 1)
- *
- * `squeeze_axis=1` removes the axis with length 1 from the shapes of the output arrays.
- * **Note** that setting `squeeze_axis` to ``1`` removes axis with length 1 only
- * along the `axis` which it is split.
- * Also `squeeze_axis` can be set to true only if ``input.shape[axis] == num_outputs``.
- *
- * Example::
- *
- * z = split(x, axis=0, num_outputs=3, squeeze_axis=1) // a list of 3 arrays with shape (2, 1)
- * z = [[ 1.]
- * [ 2.]]
- *
- * [[ 3.]
- * [ 4.]]
- *
- * [[ 5.]
- * [ 6.]]
- * z[0].shape = (2 ,1 )
- *
- *
- *
- * Defined in src/operator/slice_channel.cc:L107
- * @return org.apache.mxnet.Symbol - */ -def split(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise square-root value of the input.
- *
- * .. math::
- * \textrm{sqrt}(x) = \sqrt{x}
- *
- * Example::
- *
- * sqrt([4, 9, 16]) = [2, 3, 4]
- *
- * The storage type of ``sqrt`` output depends upon the input storage type:
- *
- * - sqrt(default) = default
- * - sqrt(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L669
- * @return org.apache.mxnet.Symbol - */ -def sqrt(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns element-wise squared value of the input.
- *
- * .. math::
- * square(x) = x^2
- *
- * Example::
- *
- * square([2, 3, 4]) = [4, 9, 16]
- *
- * The storage type of ``square`` output depends upon the input storage type:
- *
- * - square(default) = default
- * - square(row_sparse) = row_sparse
- * - square(csr) = csr
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L646
- * @return org.apache.mxnet.Symbol - */ -def square(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Remove single-dimensional entries from the shape of an array.
- * Same behavior of defining the output tensor shape as numpy.squeeze for the most of cases.
- * See the following note for exception.
- *
- * Examples::
- *
- * data = [[[0], [1], [2]]]
- * squeeze(data) = [0, 1, 2]
- * squeeze(data, axis=0) = [[0], [1], [2]]
- * squeeze(data, axis=2) = [[0, 1, 2]]
- * squeeze(data, axis=(0, 2)) = [0, 1, 2]
- *
- * .. Note::
- * The output of this operator will keep at least one dimension not removed. For example,
- * squeeze([[[4]]]) = [4], while in numpy.squeeze, the output will become a scalar.
- * @return org.apache.mxnet.Symbol - */ -def squeeze(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Join a sequence of arrays along a new axis.
- *
- * The axis parameter specifies the index of the new axis in the dimensions of the
- * result. For example, if axis=0 it will be the first dimension and if axis=-1 it
- * will be the last dimension.
- *
- * Examples::
- *
- * x = [1, 2]
- * y = [3, 4]
- *
- * stack(x, y) = [[1, 2],
- * [3, 4]]
- * stack(x, y, axis=1) = [[1, 3],
- * [2, 4]]
- * @return org.apache.mxnet.Symbol - */ -def stack(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Stops gradient computation.
- *
- * Stops the accumulated gradient of the inputs from flowing through this operator
- * in the backward direction. In other words, this operator prevents the contribution
- * of its inputs to be taken into account for computing gradients.
- *
- * Example::
- *
- * v1 = [1, 2]
- * v2 = [0, 1]
- * a = Variable('a')
- * b = Variable('b')
- * b_stop_grad = stop_gradient(3 * b)
- * loss = MakeLoss(b_stop_grad + a)
- *
- * executor = loss.simple_bind(ctx=cpu(), a=(1,2), b=(1,2))
- * executor.forward(is_train=True, a=v1, b=v2)
- * executor.outputs
- * [ 1. 5.]
- *
- * executor.backward()
- * executor.grad_arrays
- * [ 0. 0.]
- * [ 1. 1.]
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L270
- * @return org.apache.mxnet.Symbol - */ -def stop_gradient(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @return org.apache.mxnet.Symbol - */ -def sum(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the sum of array elements over given axes.
- *
- * .. Note::
- *
- * `sum` and `sum_axis` are equivalent.
- * For ndarray of csr storage type summation along axis 0 and axis 1 is supported.
- * Setting keepdims or exclude to True will cause a fallback to dense operator.
- *
- * Example::
- *
- * data = [[[1,2],[2,3],[1,3]],
- * [[1,4],[4,3],[5,2]],
- * [[7,1],[7,2],[7,3]]]
- *
- * sum(data, axis=1)
- * [[ 4. 8.]
- * [ 10. 9.]
- * [ 21. 6.]]
- *
- * sum(data, axis=[1,2])
- * [ 12. 19. 27.]
- *
- * data = [[1,2,0],
- * [3,0,1],
- * [4,1,0]]
- *
- * csr = cast_storage(data, 'csr')
- *
- * sum(csr, axis=0)
- * [ 8. 3. 1.]
- *
- * sum(csr, axis=1)
- * [ 3. 4. 5.]
- *
- *
- *
- * Defined in src/operator/tensor/broadcast_reduce_op_value.cc:L115
- * @return org.apache.mxnet.Symbol - */ -def sum_axis(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Interchanges two axes of an array.
- *
- * Examples::
- *
- * x = [[1, 2, 3]])
- * swapaxes(x, 0, 1) = [[ 1],
- * [ 2],
- * [ 3]]
- *
- * x = [[[ 0, 1],
- * [ 2, 3]],
- * [[ 4, 5],
- * [ 6, 7]]] // (2,2,2) array
- *
- * swapaxes(x, 0, 2) = [[[ 0, 4],
- * [ 2, 6]],
- * [[ 1, 5],
- * [ 3, 7]]]
- *
- *
- * Defined in src/operator/swapaxis.cc:L70
- * @return org.apache.mxnet.Symbol - */ -def swapaxes(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Takes elements from an input array along the given axis.
- *
- * This function slices the input array along a particular axis with the provided indices.
- *
- * Given an input array with shape ``(d0, d1, d2)`` and indices with shape ``(i0, i1)``, the output
- * will have shape ``(i0, i1, d1, d2)``, computed by::
- *
- * output[i,j,:,:] = input[indices[i,j],:,:]
- *
- * .. note::
- * - `axis`- Only slicing along axis 0 is supported for now.
- * - `mode`- Only `clip` mode is supported for now.
- *
- * Examples::
- * x = [4. 5. 6.]
- *
- * // Trivial case, take the second element along the first axis.
- * take(x, [1]) = [ 5. ]
- *
- * x = [[ 1., 2.],
- * [ 3., 4.],
- * [ 5., 6.]]
- *
- * // In this case we will get rows 0 and 1, then 1 and 2. Along axis 0
- * take(x, [[0,1],[1,2]]) = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 3., 4.],
- * [ 5., 6.]]]
- *
- *
- *
- * Defined in src/operator/tensor/indexing_op.cc:L389
- * @return org.apache.mxnet.Symbol - */ -def take(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Computes the element-wise tangent of the input array.
- *
- * The input should be in radians (:math:`2\pi` rad equals 360 degrees).
- *
- * .. math::
- * tan([0, \pi/4, \pi/2]) = [0, 1, -inf]
- *
- * The storage type of ``tan`` output depends upon the input storage type:
- *
- * - tan(default) = default
- * - tan(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L83
- * @return org.apache.mxnet.Symbol - */ -def tan(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the hyperbolic tangent of the input array, computed element-wise.
- *
- * .. math::
- * tanh(x) = sinh(x) / cosh(x)
- *
- * The storage type of ``tanh`` output depends upon the input storage type:
- *
- * - tanh(default) = default
- * - tanh(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_trig.cc:L234
- * @return org.apache.mxnet.Symbol - */ -def tanh(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Repeats the whole array multiple times.
- *
- * If ``reps`` has length *d*, and input array has dimension of *n*. There are
- * three cases:
- *
- * - **n=d**. Repeat *i*-th dimension of the input by ``reps[i]`` times::
- *
- * x = [[1, 2],
- * [3, 4]]
- *
- * tile(x, reps=(2,3)) = [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]
- *
- * - **n>d**. ``reps`` is promoted to length *n* by pre-pending 1's to it. Thus for
- * an input shape ``(2,3)``, ``repos=(2,)`` is treated as ``(1,2)``::
- *
- *
- * tile(x, reps=(2,)) = [[ 1., 2., 1., 2.],
- * [ 3., 4., 3., 4.]]
- *
- * - **n - * shape ``(2,2)`` array is promoted to ``(1,2,2)`` for 3-D replication::
- *
- * tile(x, reps=(2,2,3)) = [[[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]],
- *
- * [[ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.],
- * [ 1., 2., 1., 2., 1., 2.],
- * [ 3., 4., 3., 4., 3., 4.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L751
- * @return org.apache.mxnet.Symbol - */ -def tile(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Returns the top *k* elements in an input array along the given axis.
- *
- * Examples::
- *
- * x = [[ 0.3, 0.2, 0.4],
- * [ 0.1, 0.3, 0.2]]
- *
- * // returns an index of the largest element on last axis
- * topk(x) = [[ 2.],
- * [ 1.]]
- *
- * // returns the value of top-2 largest elements on last axis
- * topk(x, ret_typ='value', k=2) = [[ 0.4, 0.3],
- * [ 0.3, 0.2]]
- *
- * // returns the value of top-2 smallest elements on last axis
- * topk(x, ret_typ='value', k=2, is_ascend=1) = [[ 0.2 , 0.3],
- * [ 0.1 , 0.2]]
- *
- * // returns the value of top-2 largest elements on axis 0
- * topk(x, axis=0, ret_typ='value', k=2) = [[ 0.3, 0.3, 0.4],
- * [ 0.1, 0.2, 0.2]]
- *
- * // flattens and then returns list of both values and indices
- * topk(x, ret_typ='both', k=2) = [[[ 0.4, 0.3], [ 0.3, 0.2]] , [[ 2., 0.], [ 1., 2.]]]
- *
- *
- *
- * Defined in src/operator/tensor/ordering_op.cc:L63
- * @return org.apache.mxnet.Symbol - */ -def topk(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Permutes the dimensions of an array.
- *
- * Examples::
- *
- * x = [[ 1, 2],
- * [ 3, 4]]
- *
- * transpose(x) = [[ 1., 3.],
- * [ 2., 4.]]
- *
- * x = [[[ 1., 2.],
- * [ 3., 4.]],
- *
- * [[ 5., 6.],
- * [ 7., 8.]]]
- *
- * transpose(x) = [[[ 1., 5.],
- * [ 3., 7.]],
- *
- * [[ 2., 6.],
- * [ 4., 8.]]]
- *
- * transpose(x, axes=(1,0,2)) = [[[ 1., 2.],
- * [ 5., 6.]],
- *
- * [[ 3., 4.],
- * [ 7., 8.]]]
- *
- *
- * Defined in src/operator/tensor/matrix_op.cc:L310
- * @return org.apache.mxnet.Symbol - */ -def transpose(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Return the element-wise truncated value of the input.
- *
- * The truncated value of the scalar x is the nearest integer i which is closer to
- * zero than x is. In short, the fractional part of the signed number x is discarded.
- *
- * Example::
- *
- * trunc([-2.1, -1.9, 1.5, 1.9, 2.1]) = [-2., -1., 1., 1., 2.]
- *
- * The storage type of ``trunc`` output depends upon the input storage type:
- *
- * - trunc(default) = default
- * - trunc(row_sparse) = row_sparse
- *
- *
- *
- * Defined in src/operator/tensor/elemwise_unary_op_basic.cc:L607
- * @return org.apache.mxnet.Symbol - */ -def trunc(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Draw random samples from a uniform distribution.
- *
- * .. note:: The existing alias ``uniform`` is deprecated.
- *
- * Samples are uniformly distributed over the half-open interval *[low, high)*
- * (includes *low*, but excludes *high*).
- *
- * Example::
- *
- * uniform(low=0, high=1, shape=(2,2)) = [[ 0.60276335, 0.85794562],
- * [ 0.54488319, 0.84725171]]
- *
- *
- *
- * Defined in src/operator/random/sample_op.cc:L66
- * @return org.apache.mxnet.Symbol - */ -def uniform(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Converts an array of flat indices into a batch of index arrays. The operator follows numpy conventions so a single multi index is given by a column of the output matrix.
- *
- * Examples::
- *
- * A = [22,41,37]
- * unravel(A, shape=(7,6)) = [[3,6,6],[4,5,1]]
- *
- *
- *
- * Defined in src/operator/tensor/ravel.cc:L65
- * @return org.apache.mxnet.Symbol - */ -def unravel_index(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Return the elements, either from x or y, depending on the condition.
- *
- * Given three ndarrays, condition, x, and y, return an ndarray with the elements from x or y,
- * depending on the elements from condition are true or false. x and y must have the same shape.
- * If condition has the same shape as x, each element in the output array is from x if the
- * corresponding element in the condition is true, and from y if false.
- *
- * If condition does not have the same shape as x, it must be a 1D array whose size is
- * the same as x's first dimension size. Each row of the output array is from x's row
- * if the corresponding element from condition is true, and from y's row if false.
- *
- * Note that all non-zero values are interpreted as ``True`` in condition.
- *
- * Examples::
- *
- * x = [[1, 2], [3, 4]]
- * y = [[5, 6], [7, 8]]
- * cond = [[0, 1], [-1, 0]]
- *
- * where(cond, x, y) = [[5, 2], [3, 8]]
- *
- * csr_cond = cast_storage(cond, 'csr')
- *
- * where(csr_cond, x, y) = [[5, 2], [3, 8]]
- *
- *
- *
- * Defined in src/operator/tensor/control_flow_op.cc:L57
- * @return org.apache.mxnet.Symbol - */ -def where(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol - /** - * Return an array of zeros with the same shape, type and storage type
- * as the input array.
- *
- * The storage type of ``zeros_like`` output depends on the storage type of the input
- *
- * - zeros_like(row_sparse) = row_sparse
- * - zeros_like(csr) = csr
- * - zeros_like(default) = default
- *
- * Examples::
- *
- * x = [[ 1., 1., 1.],
- * [ 1., 1., 1.]]
- *
- * zeros_like(x) = [[ 0., 0., 0.],
- * [ 0., 0., 0.]]
- * @return org.apache.mxnet.Symbol - */ -def zeros_like(name : String = null, attr : Map[String, String] = null)(args : org.apache.mxnet.Symbol*)(kwargs : Map[String, Any] = null): org.apache.mxnet.Symbol -} \ No newline at end of file From 16862eb71b72e873900bd38b85b4d48569be6f84 Mon Sep 17 00:00:00 2001 From: Qing Date: Wed, 11 Jul 2018 13:15:20 -0700 Subject: [PATCH 7/9] disable the Gan example for now --- .../mxnetexamples/gan/GanExampleSuite.scala | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala index 08a5a99d692a..be4014b7be11 100644 --- a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala +++ b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala @@ -32,27 +32,35 @@ class GanExampleSuite extends FunSuite with BeforeAndAfterAll{ private val logger = LoggerFactory.getLogger(classOf[GanExampleSuite]) test("Example CI: Test GAN MNIST") { - if (System.getenv().containsKey("SCALA_TEST_ON_GPU") && - System.getenv("SCALA_TEST_ON_GPU").toInt == 1) { - logger.info("Downloading mnist model") - val baseUrl = "https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci" - val tempDirPath = System.getProperty("java.io.tmpdir") - val modelDirPath = tempDirPath + File.separator + "mnist/" - logger.info("tempDirPath: %s".format(tempDirPath)) - Util.downloadUrl(baseUrl + "/mnist/mnist.zip", - tempDirPath + "/mnist/mnist.zip") - // TODO: Need to confirm with Windows - Process("unzip " + tempDirPath + "/mnist/mnist.zip -d " - + tempDirPath + "/mnist/") ! - - val context = Context.gpu() - - val output = GanMnist.runTraining(modelDirPath, context, modelDirPath, 2) - Process("rm -rf " + modelDirPath) ! - - assert(output >= 0.0f) + val disableTest = true + if (disableTest) { + logger.info("Temporarily disable this test due to the Memory leaks") } else { - logger.info("GPU test only, skipped...") + if (System.getenv().containsKey("SCALA_TEST_ON_GPU") && + System.getenv("SCALA_TEST_ON_GPU").toInt == 1) { + logger.info("Downloading mnist model") + val baseUrl = "https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci" + val tempDirPath = System.getProperty("java.io.tmpdir") + val modelDirPath = tempDirPath + File.separator + "mnist/" + logger.info("tempDirPath: %s".format(tempDirPath)) + val tmpFile = new File(tempDirPath + "/mnist/mnist.zip") + if (!tmpFile.exists()) { + FileUtils.copyURLToFile(new URL(baseUrl + "/mnist/mnist.zip"), + tmpFile) + } + // TODO: Need to confirm with Windows + Process("unzip " + tempDirPath + "/mnist/mnist.zip -d " + + tempDirPath + "/mnist/") ! + + val context = Context.gpu() + + val output = GanMnist.runTraining(modelDirPath, context, modelDirPath, 5) + Process("rm -rf " + modelDirPath) ! + + assert(output >= 0.0f) + } else { + logger.info("GPU test only, skipped...") + } } } } From 3e83461b524d761315c7d70940a7bb99fda54391 Mon Sep 17 00:00:00 2001 From: Qing Date: Mon, 23 Jul 2018 14:53:19 -0700 Subject: [PATCH 8/9] add ignore method --- .../org/apache/mxnetexamples/gan/GanExampleSuite.scala | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala index be4014b7be11..21092c9b10b7 100644 --- a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala +++ b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala @@ -23,19 +23,16 @@ import java.net.URL import org.apache.commons.io.FileUtils import org.apache.mxnet.Context import org.apache.mxnetexamples.Util -import org.scalatest.{BeforeAndAfterAll, FunSuite} +import org.scalatest.{BeforeAndAfterAll, FunSuite, Ignore} import org.slf4j.LoggerFactory import scala.sys.process.Process +@Ignore class GanExampleSuite extends FunSuite with BeforeAndAfterAll{ private val logger = LoggerFactory.getLogger(classOf[GanExampleSuite]) test("Example CI: Test GAN MNIST") { - val disableTest = true - if (disableTest) { - logger.info("Temporarily disable this test due to the Memory leaks") - } else { if (System.getenv().containsKey("SCALA_TEST_ON_GPU") && System.getenv("SCALA_TEST_ON_GPU").toInt == 1) { logger.info("Downloading mnist model") @@ -61,6 +58,5 @@ class GanExampleSuite extends FunSuite with BeforeAndAfterAll{ } else { logger.info("GPU test only, skipped...") } - } } } From e163e28be892a3f0a5a9ca2482601f8a0ada4109 Mon Sep 17 00:00:00 2001 From: Qing Date: Mon, 30 Jul 2018 12:44:13 -0700 Subject: [PATCH 9/9] add new download scheme to match the changes --- .../mxnetexamples/gan/GanExampleSuite.scala | 9 +-------- .../neuralstyle/NeuralStyleSuite.scala | 19 +++++-------------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala index 21092c9b10b7..96820ce4e983 100644 --- a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala +++ b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/gan/GanExampleSuite.scala @@ -18,9 +18,6 @@ package org.apache.mxnetexamples.gan import java.io.File -import java.net.URL - -import org.apache.commons.io.FileUtils import org.apache.mxnet.Context import org.apache.mxnetexamples.Util import org.scalatest.{BeforeAndAfterAll, FunSuite, Ignore} @@ -40,11 +37,7 @@ class GanExampleSuite extends FunSuite with BeforeAndAfterAll{ val tempDirPath = System.getProperty("java.io.tmpdir") val modelDirPath = tempDirPath + File.separator + "mnist/" logger.info("tempDirPath: %s".format(tempDirPath)) - val tmpFile = new File(tempDirPath + "/mnist/mnist.zip") - if (!tmpFile.exists()) { - FileUtils.copyURLToFile(new URL(baseUrl + "/mnist/mnist.zip"), - tmpFile) - } + Util.downloadUrl(baseUrl + "/mnist/mnist.zip", tempDirPath + "/mnist/mnist.zip") // TODO: Need to confirm with Windows Process("unzip " + tempDirPath + "/mnist/mnist.zip -d " + tempDirPath + "/mnist/") ! diff --git a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala index 1b657e8ebdac..dc8fc5b8c14d 100644 --- a/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala +++ b/scala-package/examples/src/test/scala/org/apache/mxnetexamples/neuralstyle/NeuralStyleSuite.scala @@ -17,11 +17,8 @@ package org.apache.mxnetexamples.neuralstyle -import java.io.File -import java.net.URL - -import org.apache.commons.io.FileUtils import org.apache.mxnet.Context +import org.apache.mxnetexamples.Util import org.apache.mxnetexamples.neuralstyle.end2end.{BoostInference, BoostTrain} import org.scalatest.{BeforeAndAfterAll, FunSuite} import org.slf4j.LoggerFactory @@ -36,22 +33,16 @@ import scala.sys.process.Process class NeuralStyleSuite extends FunSuite with BeforeAndAfterAll { private val logger = LoggerFactory.getLogger(classOf[NeuralStyleSuite]) - def downloadUrl(url: String, filePath: String) : Unit = { - val tmpFile = new File(filePath) - if (!tmpFile.exists()) { - FileUtils.copyURLToFile(new URL(url), tmpFile) - } - } override def beforeAll(): Unit = { logger.info("Downloading vgg model") val tempDirPath = System.getProperty("java.io.tmpdir") logger.info("tempDirPath: %s".format(tempDirPath)) val baseUrl = "https://s3.us-east-2.amazonaws.com/mxnet-scala/scala-example-ci/NeuralStyle/" - downloadUrl(baseUrl + "IMG_4343.jpg", tempDirPath + "/NS/IMG_4343.jpg") - downloadUrl(baseUrl + "starry_night.jpg", tempDirPath + "/NS/starry_night.jpg") - downloadUrl(baseUrl + "model.zip", tempDirPath + "/NS/model.zip") - downloadUrl(baseUrl + "vgg19.params", tempDirPath + "/NS/vgg19.params") + Util.downloadUrl(baseUrl + "IMG_4343.jpg", tempDirPath + "/NS/IMG_4343.jpg") + Util.downloadUrl(baseUrl + "starry_night.jpg", tempDirPath + "/NS/starry_night.jpg") + Util.downloadUrl(baseUrl + "model.zip", tempDirPath + "/NS/model.zip") + Util.downloadUrl(baseUrl + "vgg19.params", tempDirPath + "/NS/vgg19.params") // TODO: Need to confirm with Windows Process(s"unzip $tempDirPath/NS/model.zip -d $tempDirPath/NS/") !