Found 10476 Articles for Python

How can Tensorflow be used with flower dataset to continue training the model?

AmitDiwan
Updated on 19-Feb-2021 17:55:53

161 Views

To continue training the model on the flower dataset, the ‘fit’ method is used. To this method, the number of epochs (number of times the data is trained to build the model) is also specified. Some of the sample images are also displayed on the console.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the below code. Google Colab or ... Read More

How can Tensorflow be used to configure the flower dataset for performance?

AmitDiwan
Updated on 19-Feb-2021 17:51:07

177 Views

The flower dataset would have given a certain percentage of accuracy when a model is created. If it is required to configure the model for performance, a function is defined that performs the buffer prefetch for the second time, and then it is shuffled. This function is called on the training dataset to improve the performance of the model.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We ... Read More

How to Match patterns and strings using the RegEx module in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:42:22

255 Views

IntroductionThe RegEx module stands for Regular expressions. If you have already worked on programming, you would have come across this term several times already. We use the Regular expressions to search and replace, it is used in various text editors, search engines, word processors, etc.In other words, it helps match a certain pattern that you are looking for.A good example for this would be how your collage website allows you to use only your university mail and none of the other extensions.Getting StartedThe regular expression module comes packaged within Python. You do not need to download and install it separately.In ... Read More

How can Datatset.map be used in Tensorflow to create a dataset of image, label pairs?

AmitDiwan
Updated on 19-Feb-2021 17:46:59

229 Views

The (image, label) pair is created by converting a list of path components, and then encoding the label to an integer format. The ‘map’ method helps in creating a dataset that corresponds to the (image, label) pair.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the below code. Google Colab or Colaboratory helps run Python code over the browser and ... Read More

How can Tensorflow be used to create a pair using a file path for the flower dataset?

AmitDiwan
Updated on 19-Feb-2021 17:42:19

323 Views

To create an (image, label) pair, the path is first converted into list of path components. Then, the second to last value is added to the directory. Then, label is encoded into an integer format. The compressed string is converted to a tensor, and is then reshaped to the required size.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the ... Read More

How can Tensorflow be used with tf.data for finer control using Python?

AmitDiwan
Updated on 19-Feb-2021 17:40:17

201 Views

The ‘tf.Data’ helps in customizing the model building pipeline, by shuffling the data in the dataset so that all types of data get evenly distributed (if possible).Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, containing images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the below code. Google Colab or Colaboratory helps run Python code over the browser and requires zero configuration and free access to GPUs (Graphical Processing Units). ... Read More

How to encrypt and decrypt data in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:39:10

18K+ Views

IntroductionWhat is cryptography? Cryptography deals with the conversion of plain text into cipher text which is called encryption of data and cipher text back to plain text which is called decryption of data.We will be using the fernet module in the cryptography package to encrypt and decrypt data using Python. While using the fernet module, a unique key is generated without which you cannot read or manipulate the encrypted data.Now that you know what we will be dealing with, let’s get started.Getting StartedThe cryptography module does not come packaged with Python, which means you will have to install it using ... Read More

How to create powerpoint files using Python

S Vijay Balaji
Updated on 11-Feb-2021 06:36:51

16K+ Views

IntroductionWe’ve all had to make PowerPoint presentations at some point in our lives. Most often we’ve used Microsoft’s PowerPoint or Google Slides.But what if you don’t have membership or access to the internet? Or what if you just wanted to do it the “programmers” way?Well, worry not for Python’s got your back!In this article you’ll learn how to create a PowerPoint file and add some content to it with the help of Python. So let’s get started!Getting StartedThroughout this walkthrough, we’ll be using the python-pptx package. This package supports different python versions ranging from 2.6 to 3.6.So, make sure you ... Read More

How to control your mouse and keyboard using the pynput library in Python

S Vijay Balaji
Updated on 11-Feb-2021 06:34:27

5K+ Views

IntroductionThe pynput library allows you to control and monitor/listen to your input devices such as they keyboard and mouse.The pynput.mouse allows you control and monitor the mouse, while the pynput.keyboard allows you to control and monitor the keyboard.In this article, we will be moving the cursor to a specific position, automate clicks, and simulate keystrokes from the keyboard.Without further ado, let’s get started.Getting StartedSince the pynput module does not come packaged with Python, you will have to manually download and install it using the pip package manager.To do this, launch your terminal and use the command below.pip install pynputOnce the ... Read More

How can Tensorflow be used with the flower dataset to compile and fit the model?

AmitDiwan
Updated on 19-Feb-2021 17:37:46

184 Views

The flower dataset can be compiled and fit to the model using the ‘compile’ and ‘fit’ methods respectively. To the ‘fit’ method, the training dataset as well as the validation dataset are passed as parameters. The number of epochs is also defined in the ‘fit’ method.Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?We will be using the flowers dataset, which contains images of several thousands of flowers. It contains 5 sub-directories, and there is one sub-directory for every class.  We are using the Google Colaboratory to run the below code. Google Colab or ... Read More

Advertisements