Standardize the Flower Dataset Using TensorFlow

AmitDiwan
Updated on 19-Feb-2021 17:31:27

180 Views

Data standardization refers to the act of scaling the dataset to a level so that all the features can be represented using equivalent units. The rescaling layer is built using the ‘Rescaling’ method which is present in Keras module. The layer is applied to the entire dataset using the ‘map’ 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 ... Read More

Visualize Flower Dataset Using TensorFlow in Python

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

264 Views

The flower dataset can be visualized with the help of the ‘matplotlib’ library. The ‘imshow’ method is used to display the image on the console. The entire dataset is iterated over, and only the first few images are displayed.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 ... Read More

Load Flower Dataset and Work with It Using TensorFlow

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

215 Views

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.  Read More: What is TensorFlow and how Keras work with TensorFlow to create Neural Networks?Once the flower dataset has been downloaded using the ‘get_file’ method, it will be loaded into the environment to work with it. The loader parameters are explicitly mentioned and the loaded data is split into training and validation set.We are using the Google Colaboratory to run the below code. Google Colab or Colaboratory helps run Python code over the ... Read More

Download Flower Dataset Using TensorFlow

AmitDiwan
Updated on 19-Feb-2021 17:20:43

416 Views

The flower dataset can be downloaded using a google API that basically links to the flower dataset. The ‘get_file’ method can be used to pass the API as a parameter. Once this is done, the data gets downloaded into the environment.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 ... Read More

Add New Element in XML Using PowerShell

Chirag Nagrekar
Updated on 19-Feb-2021 13:18:54

9K+ Views

Suppose we have a XML file as shown below.           Gambardella, Matthew       XML Developer's Guide       Computer       44.95       2000-10-01       An in-depth look at creating applications with XML.     We need to add a new node. So we will first load the XML file and then operate on it as shown below.The below command will save the XML file to the variable.$xmlfile = [XML](Get-Content C:\Temp\SampleXML.xml)The below command will create a new XML element$newelement = $xmlfile.CreateElement("book")Once the element is created we need ... Read More

Run Invoke-Command in PowerShell Workflow

Chirag Nagrekar
Updated on 19-Feb-2021 13:15:55

1K+ Views

To run Invoke-Command in PowerShell Workflow we need to use the InlineScript block because Invoke-Command is not supported directly in the workflow. The below example is without using the InlineScript block we get an error.ExampleWorkflow TestInvokeCommand{    Invoke-Command -ComputerName LabMachine2k16 -ScriptBlock{       Get-Service WINRM    } }Output −At line:2 char:5 +    Invoke-Command -ComputerName LabMachine2k16 -ScriptBlock{ +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cannot call the 'Invoke-Command' command. Other commands from this module have been packaged as workflow activities, but this command was specifically excluded. This is likely because the command requires an interactive Windows PowerShell session, or has behavior not suited ... Read More

Remove Windows Service with PowerShell

Chirag Nagrekar
Updated on 19-Feb-2021 13:13:54

6K+ Views

We need to remove the window service named TestService using PowerShell. If you are using PowerShell 6.0 or above version, you can directly use a cmdlet Remove-Service command as shown below.In this example, we have a service name called TestService.Remove-Service Testservice -Confirm:$false -VerboseIf you are using the PowerShell framework version (5.1 or below), you need to use the registry. Services are stored in the registry at the below location.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\To delete the service, we need to remove that service key with the command as shown below.Get-Item HKLM:\SYSTEM\CurrentControlSet\Services\TestService | Remove-Item -Force -Verbose Here we are using the Service name TestService and you need to reboot the server ... Read More

Parallel and Sequence Execution in PowerShell Workflow

Chirag Nagrekar
Updated on 19-Feb-2021 13:08:19

1K+ Views

PowerShell workflows are the best way to design the script to execute on more than one node parallel which saves extensive time for the output to produce but we always don’t want to run all the commands parallel but also need some of them to run sequentially and we can design both Parallel and Sequence commands using PowerShell Workflow.Workflow TestWorkflow{    parallel{       Command1       Command2    }    Sequence{       Command3       Command4    } } TestWorkflowIn the above code, Command1, Command2 will be executed parallelly in any order while command3 ... Read More

Use the ForEach Loop Parallelly in PowerShell

Chirag Nagrekar
Updated on 19-Feb-2021 13:05:09

10K+ Views

There are two ways to use the foreach loop parallelly in PowerShell.Using Foreach-Object -Parallel command (Supports in PowerShell 7.0 or above)Using Foreach -Parallel in Workflow (Supports PowerShell 5.1 or below)Suppose we have Servers.txt and which contains 10 Servers. When we use the Parallel for loop, it isn’t guaranteed which server loop will pick first as shown below with two examples.Using Foreach-Object-Parallel command. (not Foreach -Parallel)This Foreach-Object -Parallel command feature is newly added to the PowerShell version 7.0 or above.Example$servers = Get-Content C:\Temp\Servers.txt $servers | foreach-Object -parallel{    Write-output "Working on $_" }OutputPS C:\> C:\Temp\Test1.ps1 Working on IndiaServer003 Working on IndiaServer002 Working on IndiaServer001 Working on ... Read More

What is the PowerShell Workflow

Chirag Nagrekar
Updated on 19-Feb-2021 13:01:31

483 Views

PowerShell workflow is built on the .Net based Windows Workflow Foundation (WWF) and it has a separate Workflow engine to execute the code because it translates code into XAML for the WWF framework.PowerShell workflow is series of steps that is mainly used forRunning activities parallelly on more than one machine.Long-running scripts.Structuring steps (Which steps will execute parallel and which in sequence)Frequently used tasks.Resuming the script from where it was terminated due to system failure or any other interruption by defining checkpoints.The PowerShell workflow was introduced in PowerShell 3.0 and discontinued for windows in the Core version (6.0 onwards) and only ... Read More

Advertisements