Skip to content

Instantly share code, notes, and snippets.

View mihir135's full-sized avatar

Mihir Rajput mihir135

  • Ahmedabad, Gujarat
View GitHub Profile
layer name gradient parameters shape mu sigma
0 model.0.conv.conv.weight True 3456 [32, 12, 3, 3] -0.000974 0.0555
1 model.0.conv.bn.weight True 32 [32] 1 0
2 model.0.conv.bn.bias True 32 [32] 0 0
3 model.1.conv.weight True 18432 [64, 32, 3, 3] -4.18e-06 0.0341
4 model.1.bn.weight True 64 [64] 1 0
5 model.1.bn.bias True 64 [64] 0 0
6 model.2.cv1.conv.weight True 2048 [32, 64, 1, 1] 0.00111 0.0735
7 model.2.cv1.bn.weight True 32 [32] 1 0
8
Focus(
(conv): Conv(
(conv): Conv2d(12, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
(bn): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(act): LeakyReLU(negative_slope=0.1, inplace=True)
)
), Conv(
(conv): Conv2d(32, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1), bias=False)
(bn): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(act): LeakyReLU(negative_slope=0.1, inplace=True)
@mihir135
mihir135 / calculate_trainset_mean_std.py
Created April 5, 2020 14:19 — forked from jdhao/calculate_trainset_mean_std.py
This snippet will calculate the per-channel image mean and std in the train image set. It is plain simple and may not be efficient for large scale dataset.
"""
in this script, we calculate the image per channel mean and standard
deviation in the training set, do not calculate the statistics on the
whole dataset, as per here http://cs231n.github.io/neural-networks-2/#datapre
"""
import numpy as np
from os import listdir
from os.path import join, isdir
from glob import glob
@mihir135
mihir135 / cuda_9.0_cudnn_7.0.sh
Created February 17, 2020 12:41 — forked from ashokpant/cuda_9.0_cudnn_7.0.sh
Install CUDA Toolkit v9.0 and cuDNN v7.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v9.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-9-0