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
@itsnarsi
itsnarsi / weight_init.py
Created August 17, 2018 18:34 — forked from jeasinema/weight_init.py
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):
'''
from singa import layer
from singa import tensor
from singa import device
# Device to opencl
dev = device.create_opencl_device()
# Create tensor
x = tensor.Tensor((1,3, 32, 32), dev)
x.uniform(-1, 1)