- Trending Categories
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](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
12K+ Views
To compute the cosine similarity between two tensors, we use the CosineSimilarity() function provided by the torch.nn module. It returns the cosine similarity value computed along dim.dim is an optional parameter to this function along which cosine similarity is computed.For 1D tensors, we can compute the cosine similarity along dim=0 ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
5K+ Views
torch.clamp() is used to clamp all the elements in an input into the range [min, max]. It takes three parameters: the input tensor, min, and max values. The values less than the min are replaced by the min and the values greater than the max are replaced by the max.If ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
2K+ Views
Identity matrix, also known as Unit matrix, is a "n ☓ n" square matrix with 1's on the main diagonal and 0's elsewhere. It is the multiplicative identity of square matrices. because any square matrix multipliedUnit matrix is also called the identity matrix. Unit matrix is used as the multiplicative ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
4K+ Views
Mean absolute error is computed as the mean of the sum of absolute differences between the input and target (predicted and actual) values. To compute the mean absolute error in PyTorch, we apply the L1Loss() function provided by the torch.nn module. It creates a criterion that measures the mean absolute ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
690 Views
A ceiling value of a number is the smallest integer greater than or equal to the number. To find the ceiling of the elements of a torch tensor, we use the torch.ceil() function. This function takes a torch tensor as input parameter and returns a torch tensor with the ceil ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
1K+ Views
The contrast of an image refers to the amount of color differentiation that exists between the various features of an image. To adjust the contrast of an image, we apply adjust_contrast(). It's one of the functional transforms provided by the torchvision.transforms module. This module contains many important functional transformations that ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
1K+ Views
The brightness of an image is a measure of its intensity after the image has been captured. To adjust the brightness of an image, we apply adjust_brightness(). It's one of the functional transforms provided by the torchvision.transforms module. This module contains many important functional transformations that can be used to ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
1K+ Views
A matrix in PyTorch is a 2-dimension tensor having elements of the same dtype. We can shuffle a row by another row and a column by another column. To shuffle rows or columns, we can use simple slicing and indexing as we do in Numpy.If we want to shuffle rows, ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
4K+ Views
The torchvision.utils package provides us with the make_grid() function to create a grid of images. The images should be torch tensors. It accepts 4D mini-batch Tensor of shape (B ☓ C ☓ H ☓ W) or a list of tensor images, all of the same size.Here, B is batch size, ... Read More
![Shahid Akhtar Khan](https://www.tutorialspoint.com/assets/profiles/394091/profile/60_2508042-1636180991.jpg)
Shahid Akhtar Khan
1K+ Views
The torchvision.io package provides functions to perform different IO operations. To compute the area of a bounding box or a set of bounding boxes, torchvision.io package provides the box_area() function. This function takes the bounding boxes as an input parameter and returns the area of each box.The bounding boxes should ... Read More