by Michael Stolzer | Nov 22, 2023 | How-To/Tips
PyTorch is a free-to-use machine-learning library for building/creating and training neural networks. Mean absolute error (MAE) is the average absolute dissimilarity between calculated values and actual values. It is used to estimate the regression model’s...				
					
			
					
				
															
					
					 by Michael Stolzer | Nov 22, 2023 | How-To/Tips
Cosine similarity is utilized to find the similarity of two tensors/vectors. PyTorch provides a “torch.nn” module that has a “CosineSimilarity()” function to calculate the cosine similarity between two particular tensors. This function returns...				
					
			
					
				
															
					
					 by Michael Stolzer | Nov 22, 2023 | How-To/Tips
The norm of a matrix or vector is a computation of its length/magnitude. In PyTorch, a vector is simply a 1D tensor that has only one dimension whereas a matrix is a 2D tensor that has two dimensions i.e. rows and columns. Sometimes, users may want to calculate the...				
					
			
					
				
															
					
					 by Michael Stolzer | Nov 22, 2023 | How-To/Tips
Sine is a basic trigonometric function. While working with tensors in PyTorch, users may want to calculate the sine of each element in the specific tensor. PyTorch provides a “torch.sin()” method to perform this operation. This method accepts a specific...				
					
			
					
				
															
					
					 by Michael Stolzer | Nov 22, 2023 | How-To/Tips
The normal distribution is often utilized in statistics and probability where data is symmetrically distributed around the mean. It shows that data near the mean more frequently occurred than data far from the mean. Sometimes, users may be required to generate random...