Skip to content

Knowledge Transfer

  • PyTorch
  • Keras
  • Flutter
  • TensorFlow
  • Pandas
  • Android
  • Contact Us
December 23, 2021

How to implement softmax and cross-entropy in Python and PyTorch

PyTorchPragati

The softmax activation function transforms a vector of K real values into values between 0 and 1 so that they can be interpreted as probabilities. The input values can be positive, negative, zero, or greater than one.

December 13, 2021

When to use “categorical_accuracy vs sparse_categorical_accuracy” in Keras

KerasPragati

One advantage of using sparse categorical cross-entropy is it saves time in memory as well as computation because it simply uses a single integer for a class, rather than a whole vector.

December 6, 2021

How to deactivate dropout layers while evaluation and prediction mode in Keras?

KerasPyTorchPragati

Forcing your network to learn redundant representations might sound very inefficient. But in practice, it makes things more robust and prevents overfitting. It also makes your network act as if taking the consensus over an ensemble of networks.

October 7, 2021

Calculate Output Size of Convolutional and Pooling layers in CNN.

KerasPragati

As we go deeper in the neural network typically you start off with larger images [32x32x3] then the height and width will gradually trend down as you go deeper in the neural network. Whereas the number of channels generally increases. You see this general trend in a lot of other convolutional neural networks.

September 25, 2021

Create DataLoader with collate_fn() for variable-length input in PyTorch.

PyTorchadmin

A custom collate_fn can be used to customize collation, e.g., padding sequential data to a max length of a batch.collate_fn is called with a list of data samples at each time. It is expected to collate the input samples into a batch for yielding from the data loader iterator. 

September 17, 2021

Feature extraction from an image using pre-trained PyTorch model

PyTorchadmin

The pre-trained model is “frozen” and only the weights of the classifier get updated during training. In this case, the convolutional base extracted all the features associated with each image

September 6, 2021

How to add L1, L2 regularization in PyTorch loss function?

Uncategorizedadmin

In this tutorial, we’ll discuss what regularization is and when and why it may be helpful to add it to our model.

August 21, 2021

Load custom image datasets into PyTorch DataLoader without using ImageFolder.

PyTorchadmin

PyTorch provides many classes to make data loading easy and code more readable. In this tutorial, we will see how to load and preprocess/augment custom datasets.

August 12, 2021

PyTorch Freeze Layer for fixed feature extractor in Transfer Learning

PyTorchadmin

Network would already be able to extract generic features from your dataset. The network will not have to learn to extract generic features from scratch.

August 5, 2021

How to use kernel, bias, and activity Layer Weight regularizers in Keras

Kerasadmin

It is sometimes desirable to use a separate penalty with a different coefficient for each layer of the network.

Posts navigation

Previous 1 2 3 4 … 21 Next

Recent Posts

  • PyTorch Confusion Matrix for multi-class image classification
  • What does model.evaluate() return in keras?
  • Create NumPy array from PyTorch Tensor using detach().numpy()
  • How to use optimizer.zero_grad() in PyTorch
  • Use of ‘model.eval()’ and ‘with torch.no_grad()’ in PyTorch model evaluate
  • Privacy Policy
Copyright © 2022 Knowledge Transfer All Rights Reserved.