Tensorflow.js tf.argMin() Function Last Updated : 18 May, 2021 Comments Improve Suggest changes Like Article Like Report Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.argMin() function is used to return the indices for the minimum values of the specified Tensor along an axis. The output result has the same shape as input with the dimension along axis removed. Syntax: tf.argMin (x, axis) Parameters: This function accepts two parameters which are illustrated below: x: The input tensor.axis: The specified dimension(s) to reduce. It is an optional parameter and its default value is 0. Return Value: It returns a Tensor of the indices of the minimum values along an axis. Example 1: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Initializing a some tensors const a = tf.tensor1d([0, 1]); const b = tf.tensor1d([5, 3]); const c = tf.tensor1d([6, 3, 5, 2]); // Calling the .argMin() function over // the above tensors a.argMin().print(); b.argMin().print(); c.argMin().print(); Output: Tensor 0 Tensor 1 Tensor 3 Example 2: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Initializing a some tensors const a = tf.tensor1d([0, 1]); const b = tf.tensor2d([9, 5, 2, 8], [2, 2]); const c = tf.tensor1d([6, 4, 7]); // Initializing a axis parameters const axis1 = -1; const axis2 = -2; const axis3 = 0; // Calling the .argMin() function over // the above tensors a.argMin(axis1).print(); b.argMin(axis2).print(); c.argMin(axis3).print(); Output: Tensor 0 Tensor [1, 0] Tensor 1 Reference: https://js.tensorflow.org/api/latest/#argMin Comment More infoAdvertise with us Next Article Tensorflow.js tf.argMin() Function K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.argMax() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.argMax() function is used to return the indices for the maximum values of the specified Tensor along an axis. The output result 2 min read Tensorflow.js tf.asin() Function Tensorflow.js is an open-source library that is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .asin() function is used to find the asin of the stated tensor elementwise. Syntax: Â tf.asin(x) Parameters: 2 min read Tensorflow.js tf.asinh() Function Tensorflow.js is an open-source library that is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .asinh() function is used to find the inverse hyperbolic sin of the stated tensor input and is done elements 2 min read Tensorflow.js tf.engine() Function Tensorflow.js is an open-source library that is developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .engine() function is used to return the global engine which saves the path of every single tensor as well as backe 2 min read Tensorflow.js tf.atan() Function Tensorflow.js is an open-source library that is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .atan() function is used to find the atan of the stated tensor input and is done element wise. Syntax : Â tf. 2 min read Like