Author: admin

  • torch.nn in PyTorch

    PyTorch provides the torch.nn module to help us in creating and training of the neural network. We will first train the basic neural network on the MNIST dataset without using any features from these models. We will use only the basic PyTorch tensor functionality and then we will incrementally add one feature from torch.nn at…

  • PyTorch Packages

    PyTorch is an optimized tensor library for deep learning using CPUs and GPUs. PyTorch has a rich set of packages which are used to perform deep learning concepts. These packages help us in optimization, conversion, and loss calculation, etc. Let’s get a brief knowledge of these packages. S.No Name Description 1. Torch The torch package…

  • Installation of PyTorch

    For installation, first, you have to choose your preference and then run the install command. You can start installation locally or with a cloud partner. In the below diagram, Stable shows the most currently supported and tested version of PyTorch (1.1), which is suitable for many users. If you want the latest 1.1 builds but…

  • What is Pytorch?

    PyTorch is a small part of a computer software which is based on Torch library. It is a Deep Learning framework introduced by Facebook. PyTorch is a Machine Learning Library for Python programming language which is used for applications such as Natural Language Processing. The high-level features which are provided by PyTorch are as follows: PyTorch was developed to provide high flexibility and speed…

  • PyTorch Tutorial

    PyTorch Tutorial is designed for both beginners and professionals. Our Tutorial provides all the basic and advanced concepts of Deep learning, such as deep neural network and image processing. PyTorch is a framework of deep learning, and it is a Python machine learning package based on Torch. This tutorial is designed in such a way…

  • NumPy Filter Array

    Filtering Arrays Getting some elements out of an existing array and creating a new array out of them is called filtering. In NumPy, you filter an array using a boolean index list. A boolean index list is a list of booleans corresponding to indexes in the array. If the value at an index is True that element is contained in the…

  • NumPy Splitting Array

    Splitting NumPy Arrays Splitting is reverse operation of Joining. Joining merges multiple arrays into one and Splitting breaks one array into multiple. We use array_split() for splitting arrays, we pass it the array we want to split and the number of splits. ExampleGet your own Python Server Split the array in 3 parts: import numpy as np arr = np.array([1, 2, 3, 4, 5, 6])…

  • NumPy Joining Array

    Joining NumPy Arrays Joining means putting contents of two or more arrays in a single array. In SQL we join tables based on a key, whereas in NumPy we join arrays by axes. We pass a sequence of arrays that we want to join to the concatenate() function, along with the axis. If axis is not explicitly…

  • NumPy Array Iterating

    Iterating Arrays Iterating means going through elements one by one. As we deal with multi-dimensional arrays in numpy, we can do this using basic for loop of python. If we iterate on a 1-D array it will go through each element one by one. ExampleGet your own Python Server Iterate on the elements of the following 1-D…

  • NumPy Array Reshaping

    Reshaping arrays Reshaping means changing the shape of an array. The shape of an array is the number of elements in each dimension. By reshaping we can add or remove dimensions or change number of elements in each dimension. Reshape From 1-D to 2-D ExampleGet your own Python Server Convert the following 1-D array with…