Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • TypeScript
  • Vue.js
  • D3.js
  • Collect.js
  • Underscore.js
  • Moment.js
  • Ember.js
  • Tensorflow.js
  • Fabric.js
  • JS Formatter
  • JavaScript
  • Web Technology
Open In App
Next Article:
TensorFlow.js Layers Basic Complete Reference
Next article icon

Tensorflow.js tf.layers.activation() Function

Last Updated : 12 Dec, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

Introduction: 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. Tensorflow.js tf.layers.activation() function is used to applied to function to all the element of our input layer . we can also apply function to the input data with dense layer. 

Syntax: 

tf.layers.activation(args);    

Parameters: Below are the parameters accepted by this function:

  • args: It is object type with fields:
    • activation: It is name of the function which is applied to the all the input element.
    • inputShape: It is the shape of input layer of model. It is used in the creation of the input layer.
    • batchInputShape: It is used in making of input layer. It defined the batch's shape for the samples in input layer.
    • batchSize:  It is used in making of input layer. It is used as supplementary of batchInputShape in construction of  input layer.
    • dtype: It defined the data-type of layer. It is used for the first layer of model.
    • name: It declare string that is the  name for the input layer.
    • trainable: It declare the layer is trainable by the function or not. It is  boolean data-type.
    • weight: It is the tensor that is the initial data for the layer.
    • inputDType: It is the data-type for the input data in the layer.

Returns: Activation

Below are some examples for this function:

Example 1: In this example,  we will make activation layer and check the return value. 

JavaScript
import * as tf from "@tensorflow/tfjs"  // Creating config for the activation layer const config = {     activation: 'sigmoid',     inputShape: 5,     dtype: 'int32',     name: 'activationLayer' };  // Defining the activation layer  const activationLayer = tf.layers.activation(config);  // printing return of activation layer  console.log(activationLayer); 

Output: 

{   "_callHook": null,   "_addedWeightNames": [],   "_stateful": false,   "id": 38,   "activityRegularizer": null,   "inputSpec": null,   "supportsMasking": true,   "_trainableWeights": [],   "_nonTrainableWeights": [],   "_losses": [],   "_updates": [],   "_built": false,   "inboundNodes": [],   "outboundNodes": [],   "name": "ActivationLayer",   "trainable_": true,   "initialWeights": null,   "_refCount": null,   "fastWeightInitDuringBuild": false,   "activation": {} }

Example 2: In this example, we will create our activation layer with some configuration and train our input data with activation layer. 

JavaScript
import * as tf from "@tensorflow/tfjs"  // Configuration file for the activation layer  const geek_config = {     activation: 'sigmoid',     inputShape: 5,     dtype: 'int32',     name: 'activationLayer' };  const geek_activation = tf.layers.activation(geek_config); const geek_inputLayer = tf.layers.dense({units: 1});  // Our Input layer for the model const geek_input = tf.input({shape: [7]});  // Making structure for the model  const geek_output = geek_inputLayer.apply(geek_input); const geek_result = geek_activation.apply(geek_output);  // Making Model from structure   const config2 = {inputs: geek_input, outputs: geek_result} const model = tf.model(config2);  // Collect both outputs and print separately. const config3 = tf.randomUniform([4, 7]) const  geek_activationResult = model.predict(confg3); geek_activationResult.print(); 

Output: 

Tensor     [[0.4178988],      [0.2027801],      [0.2813435],      [0.2546847]]

Reference: https://js.tensorflow.org/api/latest/#layers.activation


Next Article
TensorFlow.js Layers Basic Complete Reference

S

satyam00so
Improve
Article Tags :
  • JavaScript
  • Web Technologies
  • Tensorflow.js

Similar Reads

  • Introduction To TensorFlow.js
    TensorFlow.js is the popular library of JavaScript that helps us add machine learning functions to web applications. Tensor is the datatype which is used in the TensorFlow. Now, let us understand the TensorFlow.js and its components. What is TensorFlow.js?TensorFlow.js is the JavaScript library that
    4 min read
  • Tensorflow.js Introduction
    TensorFlow.js brings machine learning to the browser and Node.js. It allows developers to build and run ML models directly in JavaScript and access AI for web applications. What is Tensorflow.js ?TensorFlow.js is a JavaScript library for training and deploying machine learning models on web applicat
    2 min read
  • Tensorflow.js Tensors

    • Tensorflow.js tf.tensor() 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 .tensor() function is used to create a new tensor with the help of value, shape, and data type. Syntax :   tf.tensor( value, shape
      3 min read

    • Tensorflow.js tf.scalar() 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 .scalar() function is used to create a scalar type of tensor means. A scalar is a zero-dimension array and is also called a rank-0
      2 min read

    • TenserFlow.js Tensors Creation Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. Tensors are the core data structure that is the generalization of vectors and matrices. It is potentially higher in dimensions. The Creation is used to create t
      1 min read

    • Tensorflow.js tf.Tensor class .buffer() Method
      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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf.
      1 min read

    • Tensorflow.js tf.Tensor class .bufferSync() Method
      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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf.
      1 min read

    • TensorFlow.js Tensors Classes Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. Tensor Class is used to show the main Tensor-related classes in TensorFlow.js and the methods we expose to them. tf.Tensor Class: Tensorflow.js tf.Tensor class
      1 min read

    • Tensorflow.js tf.booleanMaskAsync() 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 .booleanMaskAsync() function is used to implement boolean mask to the stated input tensor. Syntax :   tf.booleanMas
      2 min read

    • Tensorflow.js tf.concat() 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.concat() function is used to concatenate the list of specified Tensors along the given axis. Syntax: tf.concat (tensors, axis)P
      2 min read

    • TensorFlow.js Tensors Transformations Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. The tensor transformation is used to describe some common Tensor transformations for reshaping and type-casting. TensorFlow.js Tensors Transformations Methods:
      1 min read

    • Tensorflow.js tf.booleanMaskAsync() 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 .booleanMaskAsync() function is used to implement boolean mask to the stated input tensor. Syntax :   tf.booleanMas
      2 min read

    • Tensorflow.js tf.concat() 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.concat() function is used to concatenate the list of specified Tensors along the given axis. Syntax: tf.concat (tensors, axis)P
      2 min read

    • TensorFlow.js Slicing and Joining Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. The Tensor Slicing and Joining are used to slice or extract parts of a tensor or join multiple tensors together. TensorFlow.js Slicing and Joining functions: Te
      1 min read

    • Tensorflow.js tf.einsum() 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 .einsum () function is used to Tensor contraction over specified indices and outer product. Syntax :  tf.eins
      3 min read

    • Tensorflow.js tf.multinomial() 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 .multinomial() function is used to generate a tf.Tensor along with inputs that are dragged out of a multinomial dis
      2 min read

    • TensorFlow.js Tensor Random Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Tensor Random functions: TensorFlow.js tf.multinomial() FunctionTensorFlow.js tf.rand() FunctionTensorFlow.js tf.randomGamma() FunctionTensorFlow.
      1 min read

    Tensorflow.js Models

    • Tensorflow.js tf.sequential() Function
      When you want to create a model which does not have multiple input and output and it will be developed layer by layer then we will go for a sequential model of deep learning. Basically there two types of models functional and sequential model. So in this article, we are going to see the Sequential m
      2 min read

    • Tensorflow.js tf.model() 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 tf.model() function is used to create a model which contains layers and layers that are provided in form of input a
      2 min read

    • Tensorflow.js tf.input() Function
      The models in deep learning are collections of connected Layers which can be trained, evaluate, and can be used to predict something. To perform this operation you need to instantiate an input to the models. In this post, We are going to know about how the input factory function works. The tf.input(
      2 min read

    • Tensorflow.js tf.loadGraphModel() Function
      Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .loadGraphModel() function is used to Load a graph model given a URL to the model definition. Syntax: tf.loadGraphModel (mo
      2 min read

    • Tensorflow.js tf.io.http() 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 .io.http() function is used to generate an IOHandler subset which transmits model artifacts to the HTTP server. Mor
      2 min read

    • TensorFlow.js Models Loading Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Models Loading Functions: TensorFlow.js tf.loadGraphModel() FunctionTensorFlow.js tf.loadLayersModel() FunctionTensorFlow.js tf.io.browserDownload
      1 min read

    • Tensorflow.js tf.io.copyModel() 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 copyModel() function is used to copy a model away from one URL towards a new one. Moreover, this method supports co
      3 min read

    • Tensorflow.js tf.io.listModels() 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 .listModels() function is used to record each and every models accumulated in the registered repository means. More
      2 min read

    • Tensorflow.js tf.io.moveModel() 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 .moveModel() function is used to move a model away from one URL towards a new one. Moreover, this method favors mov
      3 min read

    • TensorFlow.js Models Management Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Models Management Functions: TensorFlow.js tf.io.copyModel() FunctionTensorFlow.js tf.io.listModels() FunctionTensorFlow.js tf.io.moveModel() Func
      1 min read

    • Tensorflow.js tf.GraphModel Class
      Introduction: 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. Tensorflow.js tf.GraphModel class is used to build an acyclic graph from SavedModel and made it inference execution. tf.
      2 min read

    • Tensorflow.js tf.GraphModel class .save() Method
      Introduction: 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 .save() function is used to save the structure and/or the weights of the stated GraphModel.  Note: An
      2 min read

    • Tensorflow.js tf.GraphModel class .predict() Method
      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 .predict() function is used to implement the implication in favor of input tensors. Syntax: predict(inputs, config?
      2 min read

    • Tensorflow.js tf.GraphModel class .execute() Method
      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 .execute() method is used to implement implication in favor of the given model for the stated input tensors. Syntax
      2 min read

    • TensorFlow.js Models Classes Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Models Classes Functions: TensorFlow.js tf.Functional ClassTensorFlow.js tf.GraphModel ClassTensorFlow.js class .loadSync() MethodTensorFlow.js cl
      1 min read

    Tensorflow.js Layers

    • Tensorflow.js tf.layers.elu() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or Node.js. The tf.lay
      2 min read

    • Tensorflow.js tf.leakyRelu() Function
      Tensorflow.js is an open-source library which is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .leakyRelu() function is used to find the leaky rectified linear of the stated tensor input and is done elem
      2 min read

    • TensorFlow.js Layers Advanced Activation Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Layers Advance Activation Functions: TensorFlow.js tf.layers.elu() FunctionTensorFlow.js tf.layers.leakyReLU() FunctionTensorFlow.js tf.layers.pre
      1 min read

    • Tensorflow.js tf.layers.activation() Function
      Introduction: 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. Tensorflow.js tf.layers.activation() function is used to applied to function to all the element of our input layer . we
      3 min read

    • TensorFlow.js Layers Basic Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Layers Basic functions: TensorFlow.js tf.layers.activation() FunctionTensorFlow.js tf.layers.dense() FunctionTensorFlow.js tf.layers.dropout() Fun
      1 min read

    • Tensorflow.js tf.layers.conv1d() Function
      Tensorflow.js is a javascript library developed by Google to run and train machine learning models in the browser or in Node.js. Tensorflow.js tf.layers.conv1d() function is used to create convolution layer. It is used to applied 1d convolution to the input data. The convolutional layer is used to m
      4 min read

    • TensorFlow.js Layers Convolutional Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Layers Convolutional functions: TensorFlow.js tf.layers.conv1d() FunctionTensorFlow.js tf.layers.conv2d() FunctionTensorFlow.js tf.layers.conv2dTr
      1 min read

    • Tensorflow.js tf.layers.add() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or Node.js. The tf.lay
      2 min read

    • TensorFlow.js Layers Merge Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Layers Merge functions: TensorFlow.js tf.layers.add() FunctionTensorFlow.js tf.layers.average() FunctionTensorFlow.js tf.layers.concatenate() Func
      1 min read

    • Tensorflow.js tf.layers.globalAveragePooling1d() Function
      Tensorflow.js is a Google-developed open-source toolkit for executing machine learning models and deep learning neural networks in the browser or on the node platform. It also enables developers to create machine learning models in JavaScript and utilize them directly in the browser or with Node.js.
      2 min read

    • TensorFlow.js Layers Pooling Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Layers Functions TensorFlow.js tf.layers.averagePooling1d() FunctionTensorFlow.js tf.layers.averagePooling2d() FunctionTensorFlow.js tf.layers.ave
      1 min read

    • TensorFlow.js Layers Noise Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Layers Recruitment Functions: TensorFlow.js tf.layers.alphaDropout() FunctionTensorFlow.js tf.layers.gaussianDropout() FunctionTensorFlow.js tf.la
      1 min read

    • Tensorflow.js tf.layers.bidirectional() 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 tf.layers.bidirectional function is a bidirectional wrapper for RNNs layer. Syntax: tf.layers.bidirectional(
      2 min read

    • Tensorflow.js tf.layers.timeDistributed() 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.layers.timeDistributed() function is used to apply the wrap of a layer to every temporal slice of a specified input. The given
      3 min read

    • TensorFlow.js Layers Classes Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Layers Classes functions: TensorFlow.js tf.layers.Layer() FunctionTensorFlow.js .apply() FunctionTensorflow.js tf.layers countParams() MethodTenso
      1 min read

    • Tensorflow.js tf.layers.zeroPadding2d() 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.layers.zeroPadding2d( ) function is used for adding rows and columns for zeros at the top, bottom, left, and right side of and
      3 min read

    • TensorFlow.js Layers Noise Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Layers Recruitment Functions: TensorFlow.js tf.layers.alphaDropout() FunctionTensorFlow.js tf.layers.gaussianDropout() FunctionTensorFlow.js tf.la
      1 min read

    • Tensorflow.js tf.layers.masking() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or Node.js. The tf.lay
      2 min read

    Tensorflow.js Operations

    • TensorFlow.js Operations Arithmetic Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Arithmetic Functions: TensorFlow.js tf.add() FunctionTensorFlow.js tf.sub() FunctionTensorFlow.js tf.mul() FunctionTensorFlow.js tf.div
      1 min read

    • TensorFlow.js Operations Basic Math Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Basic Math Functions: TensorFlow.js tf.abs() FunctionTensorFlow.js tf.acos() FunctionTensorFlow.js tf.acosh() FunctionTensorFlow.js tf.
      1 min read

    • TensorFlow.js Operations Matrices Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Matrices Functions: TensorFlow.js tf.dot() FunctionTensorFlow.js tf.matMul() FunctionTensorFlow.js tf.norm() FunctionTensorFlow.js tf.o
      1 min read

    • TensorFlow.js Operations Convolution Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Convolution Functions: TensorFlow.js tf.avgPool3d() FunctionTensorFlow.js tf.conv1d() FunctionTensorFlow.js tf.conv2d() FunctionTensorF
      1 min read

    • TensorFlow.js Operations Reduction Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Reduction Functions: TensorFlow.js tf.all() FunctionTensorFlow.js tf.any() FunctionTensorFlow.js tf.argMax() FunctionTensorFlow.js tf.a
      1 min read

    • TensorFlow.js Operations Normalization Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Normalization Functions: TensorFlow.js tf.batchNorm() FunctionTensorFlow.js tf.localResponseNormalization() FunctionTensorFlow.js tf.lo
      1 min read

    • TensorFlow.js Operations Images Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Images Functions: TensorFlow.js tf.image.cropAndResize() FunctionTensorFlow.js tf.image.flipLeftRight() FunctionTensorFlow.js tf.image.
      1 min read

    • TensorFlow.js Operations Logical Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Logical Functions: TensorFlow.js tf.equal() FunctionTensorFlow.js tf.greater() FunctionTensorFlow.js tf.greaterEqual() FunctionTensorFl
      1 min read

    • TensorFlow.js Operations Evaluation Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Evaluation Functions: TensorFlow.js tf.confusionMatrix() FunctionTensorFlow.js tf.inTopKAsync() FunctionTensorFlow.js tf.topk() Functio
      1 min read

    • Tensorflow.js tf.cumsum() Function
      TensorFlow.js is a library for machine learning in JavaScript. It helps developers to develop ML models in JavaScript, and use ML directly in the browser or in Node.js. The tf.cumsum() function is used to compute the cumulative sum of a tf.Tensor along the specified axis. The meaning of exclusive cu
      2 min read

    • TensorFlow.js Operations Slicing and Joining Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Slicing and Joining Functions: TensorFlow.js tf.gatherND() FunctionTensorFlow.js tf.meshgrid() FunctionTensorFlow.js tf.scatterND() Fun
      1 min read

    • TensorFlow.js Operations Spectral Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Spectral Functions: TensorFlow.js tf.spectral.fft() FunctionTensorFlow.js tf.spectral.ifft() FunctionTensorFlow.js tf.spectral.irfft()
      1 min read

    • Tensorflow.js tf.unsortedSegmentSum() 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 .unsortedSegmentSum() function is used to calculate the sum through the parts of a tf.Tensor. Syntax:   tf.unsorted
      2 min read

    • Tensorflow.js tf.movingAverage() Function
      Introduction: 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 .movingAverage() function is used to determine the moving average of a variable. Note: In absence of
      2 min read

    • Tensorflow.js tf.dropout() 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.dropout() function is used to compute the dropout. You can read more about dropout from https://www.geeksforgeeks.org/dropout-i
      2 min read

    • TensorFlow.js Operations Signal Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Signal Functions: TensorFlow.js tf.signal.frame() FunctionTensorFlow.js tf.signal.hammingWindow() FunctionTensorFlow.js tf.signal.hannW
      1 min read

    • Tensorflow.js tf.linalg.bandPart() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf.
      2 min read

    • Tensorflow.js tf.linalg.gramSchmidt() 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.linalg.gramSchmidt() function is used to orthogonalize the vectors using the Gram-Schimdt process. Syntax: tf.linalg.gramSchmid
      1 min read

    • Tensorflow.js tf.linalg.qr() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in N
      2 min read

    • TensorFlow.js Operations Sparse Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Operations Signal Functions: TensorFlow.js tf.sparseFillEmptyRows() FunctionTensorFlow.js tf.sparseReshape() FunctionTensorFlow.js tf.sparseSegmen
      1 min read

    Tensorflow.js Training

    • Tensorflow.js tf.grad() 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.grad() function is used to return the gradient of the specified function f(x) with respect to x. Syntax:   tf.grad (f) Paramete
      2 min read

    • Tensorflow.js tf.grads() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf.
      1 min read

    • Tensorflow.js tf.customGrad() 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.customGrad() function is used to return the gradient of a specified custom function "f". Here the custom function gives {value:
      3 min read

    • TensorFlow.js Training Gradients Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Training Gradients Functions: TensorFlow.js tf.grad() FunctionTensorFlow.js tf.grads() FunctionTensorFlow.js tf.customGrad() FunctionTensorFlow.js
      1 min read

    • Tensorflow.js tf.train.sgd() 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 .train.sgd() function is used to build a tf.SGDOptimizer which utilizes stochastic gradient descent. Syntax: tf.tra
      1 min read

    • Tensorflow.js tf.train.momentum() 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.train.momemtum() function is used to create a tf.MomentumOptimizer that uses momentum gradient decent algorithm.  Syntax: tf.tr
      3 min read

    • Tensorflow.js tf.train.adagrad() 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.train.adagrad() function us used to create a tf.AdagradOptimizer that uses Adaptive Gradient Algorithm(adagrad).  Syntax: tf.tr
      2 min read

    • TensorFlow.js Training Optimizers Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Training Optimizers Functions: TensorFlow.js tf.train.sgd() FunctionTensorFlow.js tf.train.momentum() FunctionTensorFlow.js tf.train.adagrad() Fun
      1 min read

    • Tensorflow.js tf.losses.absoluteDifference() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The Ten
      2 min read

    • Tensorflow.js tf.losses.computeWeightedLoss() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The Ten
      2 min read

    • Tensorflow.js tf.losses.cosineDistance() 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.losses.cosineDistance() function is used to Compute the cosine distance loss between two tensors. Syntax: tf.losses.cosineDista
      2 min read

    • TensorFlow.js Training Losses Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Training Losses Functions: TensorFlow.js tf.losses.absoluteDifference() FunctionTensorFlow.js tf.losses.computeWeightedLoss() FunctionTensorFlow.j
      1 min read

    • Tensorflow.js tf.train.Optimizer Class
      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.train.Optimizer() class is used to extend Serializable class. This tf.train.Optimizer() class contains three inbuilt functions
      3 min read

    • Tensorflow.js tf.train.Optimizer class .minimize() Method
      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 .minimize() method executes the given function f() and tries to minimize the scalar output of f() by computing the gradients of y
      3 min read

    • TensorFlow.js Training Classes Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Training Classes Functions: TensorFlow.js tf.train.Optimizer ClassTensorFlow.js tf.train.Optimizer class .minimize() MethodTensorFlow.js tf.train.
      1 min read

    Tensorflow.js Performance

    • Tensorflow.js tf.time() Function
      Tensorflow.js is an open-source library that was developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The tf.time() function is used to execute the stated function, f() as well as return a promise in order that determine
      2 min read

    • Tensorflow.js tf.nextFrame() Function
      Introduction: 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 .nextFrame() function is used to return a promise which determines at which a requestAnimationFrame
      2 min read

    • Tensorflow.js tf.profile() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf.
      1 min read

    • TensorFlow.js Performance Memory Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Performance Memory Functions: TensorFlow.js tf.tidy() FunctionTensorFlow.js tf.dispose() FunctionTensorFlow.js tf.keep() FunctionTensorFlow.js tf.
      1 min read

    Tensorflow.js Environment

    • Tensorflow.js tf.Environment Class
      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.Environment() class includes assessed flags and the registered platform. It is every time utilized like a global singleton and
      3 min read

    • Tensorflow.js tf.disposeVariables() 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 .disposeVariables() function is used to dispose every single variable stored in the backend engine. Syntax: tf.disp
      1 min read

    • Tensorflow.js tf.enableDebugMode() 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 .enableDebugMode() function is used to enable the debug mode that would register data regarding every single execut
      2 min read

    • Tensorflow.js tf.enableProdMode() 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 .enableProdMode() function is used to enable the mode of production that deactivates the exactness restraints in su
      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.env() 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 .env() function is used to return the present environment i.e. a global entity. Moreover, the environment object in
      1 min read

    • TensorFlow.js Environment Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. TensorFlow.js Environment Functions TensorFlow.js tf.Environment ClassTensorFlow.js tf.disposeVariables() FunctionTensorFlow.js tf.enableDebugMode() FunctionTen
      1 min read

    Tensorflow.js Constraints

    • Tensorflow.js tf.metrics.binaryAccuracy() 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.metrics.binaryAccuracy() function is used to calculate how often predictions match binary labels. And the function takes two te
      2 min read

    • Tensorflow.js tf.metrics.binaryCrossentropy() Function
      Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .metrics.binaryCrossentropy() function is binary crossentropy metric function which uses binary tensors and returns tf.Tens
      1 min read

    • Tensorflow.js tf.metrics.categoricalAccuracy() 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.metrics.categoricalAccuracy() function is used to return categorical accuracy between two tensor. It takes two tensor as a para
      2 min read

    • Tensorflow.js tf.metrics.categoricalCrossentropy() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf.
      2 min read

    • Tensorflow.js tf.metrics.cosineProximity() 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. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf.
      2 min read

    • Tensorflow.js tf.metrics.meanAbsoluteError() 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.metrics.meanAbsoluteError() is used to calculate mean absolute error. The mean absolute error is defined as the mean of absolut
      2 min read

    • Tensorflow.js tf.metrics.meanAbsolutePercentageError() Function
      Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .metrics.meanAbsolutePercentageError() function is a loss or else a metric function i.e. mean absolute percentage error whi
      2 min read

    • Tensorflow.js tf.metrics.meanSquaredError() 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 Tensorflow tf.metrics.meanSquaredError() function is a Loss or metric function used to  Computes the mean squared error between y_
      2 min read

    • Tensorflow.js tf.metrics.precision() Function
      Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .metrics.precision() function is used to calculate the precision of the expectancy with reference to the names. Syntax:   t
      2 min read

    • Tensorflow.js tf.metrics.recall() 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.metrics.recall() function is used to compute the recall of the predictions with respect to the labels. 'Recall' is one of the m
      2 min read

    • Tensorflow.js tf.metrics.sparseCategoricalAccuracy() Function
      Tensorflow.js is an open-source library developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .metrics.sparseCategoricalAccuracy() function is sparse categorical accuracy metric function which uses indices and logits
      1 min read

    • TensorFlow.js Metrics Complete Reference
      TensorFlow.js is an open-source JavaScript library designed by Google to develop Machine Learning models and deep learning neural networks. Metrics functions are used to manipulate the matrices. TensorFlow.js Metrics functions: TensorFlow.js tf.metrics.binaryAccuracy() FunctionTensorFlow.js tf.metri
      1 min read

geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences