- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Shahid Akhtar Khan has Published 216 Articles
Shahid Akhtar Khan
436 Views
To define a simple artificial neural network (ANN), we could use the following steps −StepsFirst we import the important libraries and packages. We try to implement a simple ANN in PyTorch. In all the following examples, the required Python library is torch. Make sure you have already installed it.import torch ... Read More
Shahid Akhtar Khan
686 Views
There are many datasets available in Pytorch related to computer vision tasks. The torch.utils.data.Dataset provides different types of datasets. The torchvision.datasets is a subclass of torch.utils.data.Dataset and has many datasets related to images and videos. PyTorch also provides us a torch.utils.data.DataLoader which is used to load multiple samples from a ... Read More
Shahid Akhtar Khan
1K+ Views
We apply the BCELoss() method to compute the binary cross entropy loss between the input and target (predicted and actual) probabilities. BCELoss() is accessed from the torch.nn module. It creates a criterion that measures the binary cross entropy loss. It is a type of loss function provided by the torch.nn ... Read More
Shahid Akhtar Khan
888 Views
Making some of the random elements of an input tensor zero has been proven to be an effective technique for regularization during the training of a neural network. To achieve this task, we can apply torch.nn.Dropout(). It zeroes some of the elements of the input tensor.An element will be zeroed ... Read More
Shahid Akhtar Khan
2K+ Views
We can rescale an n-dimensional input Tensor such that the elements lie within the range [0, 1] and sum to 1. To do this, we can apply the Softmax() function. We can rescale the n-dimensional input tensor along a particular dimension. The size of the output tensor is the same ... Read More
Shahid Akhtar Khan
3K+ Views
To apply a rectified linear unit (ReLU) function element-wise on an input tensor, we use torch.nn.ReLU(). It replaces all the negative elements in the input tensor with 0 (zero), and all the non-negative elements are left unchanged. It supports only real-valued input tensors. ReLU is used as an activation function ... Read More
Shahid Akhtar Khan
2K+ Views
We can apply a 2D Average Pooling over an input image composed of several input planes using the torch.nn.AvgPool2d() module. The input to a 2D Average Pooling layer must be of size [N, C, H, W] where N is the batch size, C is the number of channels, H and ... Read More
Shahid Akhtar Khan
434 Views
The torch.nn.ConstantPad2D() pads the input tensor boundaries with constant value. The size of the input tensor must be in 3D or 4D in (C, H, W) or (N, C, H, W) format respectively. Where N, C, H, W represents the mini batch size, number of channels, height and width respectively. ... Read More
Shahid Akhtar Khan
2K+ Views
The torch.nn.ZeroPad2D() pads the input tensor boundaries with zeros. It takes the size of padding (padding) as a parameter. The size of padding may be an integer or a tuple. The padding may be the same for all boundaries or different for each boundary.The padding may be an integer or ... Read More
Shahid Akhtar Khan
4K+ Views
We can apply a 2D Max Pooling over an input image composed of several input planes using the torch.nn.MaxPool2d() module. The input to a 2D Max Pool layer must be of size [N, C, H, W] where N is the batch size, C is the number of channels, H and ... Read More
To Continue Learning Please Login
Login with Google