Skip to content

Instantly share code, notes, and snippets.

View itsnarsi's full-sized avatar

Narsi Reddy itsnarsi

  • Jabra (GN Audio)
  • Denmark/India
View GitHub Profile
@jeasinema
jeasinema / weight_init.py
Last active November 22, 2024 07:17
A simple script for parameter initialization for PyTorch
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
def weight_init(m):
'''
@bkj
bkj / pytorch_lifted_loss.py
Last active April 28, 2022 07:12
pytorch lifted loss
#!/usr/bin/env python
"""
pytorch_lifted_loss.py
"""
import torch
import torch.nn as nn
from torch.autograd import Variable