Wednesday, July 3, 2024
HomeLanguagesJavascriptTensorflow.js tf.data.Dataset.skip() Function

Tensorflow.js tf.data.Dataset.skip() 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.data.Dataset.skip() function is used to create a Dataset that skips count initial elements from this dataset

Syntax:

skip(count)

Parameters

  • count: The number of elements of this dataset that should be skipped to form the new dataset.

Return Value: It returns tf.data.Dataset.

Example 1:

Javascript




// Importing the tensorflow.js library
import * as tf from "@tensorflow/tfjs"
  
const a = tf.data.array(
    [5, 10, 15, 20, 25, 30]).skip(2);
  
await a.forEachAsync(e => console.log(e));


Output:

15
20
25
30

Example 2:

Javascript




// Importing the tensorflow.js library
import * as tf from "@tensorflow/tfjs"
  
const gfg = tf.data.array(
    ['neveropen', 'gfg', 'neveropen'
    'for', 'neveropen']).skip(2);
      
await gfg.forEachAsync(
    neveropen => console.log(neveropen));


Output:

neveropen
for
neveropen

Reference: https://js.tensorflow.org/api/latest/#tf.data.Dataset.skip

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!

Nicole Veronica Rubhabha
Nicole Veronica Rubhabha
A highly competent and organized individual DotNet developer with a track record of architecting and developing web client-server applications. Recognized as a personable, dedicated performer who demonstrates innovation, communication, and teamwork to ensure quality and timely project completion. Expertise in C#, ASP.Net, MVC, LINQ, EF 6, Web Services, SQL Server, MySql, Web development,
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments