Recent Posts by Brijesh
How to use class weight in CrossEntropyLoss for an imbalanced dataset?
how to create a loss function for an imbalanced dataset in which minority class proportionally to its underrepresentation. You will use PyTorch to define the loss function and class weights to help the model learn from the imbalanced data.
How to initialize weight and bias in PyTorch?
We’re gonna check instant m if it’s convolution layer then we can initialize with a variety of different initialization techniques we’re just gonna do the kaiming_uniform_ on the weight of that specific module and we’re only gonna do if it’s a conv2d.
How to apply Gradient Clipping in PyTorch
The value for the gradient vector norm or preferred range can be configured by trial and error, by using common values used in the literature, or by first observing common vector norms or ranges via experimentation and then choosing a sensible value.
How to Scale data into the 0-1 range using Min-Max Normalization.
min-max scaling, is the simplest and consists method in rescaling. The range of features to scale in [0, 1] or [−1, 1]. The impact is that we end up with smaller standard deviations, which can suppress the effect of outliers.