Skip to content

Instantly share code, notes, and snippets.

View digantamisra98's full-sized avatar
🇺🇸
Stygian Montreal Drift

Xa9aX ツ digantamisra98

🇺🇸
Stygian Montreal Drift
View GitHub Profile
@redknightlois
redknightlois / mish_init.py
Created July 15, 2020 14:54
Variance based initialization method for Mish activation
def init_weights(m, variance=1.0):
def _calculate_fan_in_and_fan_out(tensor):
dimensions = tensor.dim()
if dimensions < 2:
return 1, 1
if dimensions == 2: # Linear
fan_in = tensor.size(1)
fan_out = tensor.size(0)
@TengdaHan
TengdaHan / ddp_notes.md
Last active May 10, 2024 14:48
Multi-node-training on slurm with PyTorch

Multi-node-training on slurm with PyTorch

What's this?

  • A simple note for how to start multi-node-training on slurm scheduler with PyTorch.
  • Useful especially when scheduler is too busy that you cannot get multiple GPUs allocated, or you need more than 4 GPUs for a single job.
  • Requirement: Have to use PyTorch DistributedDataParallel(DDP) for this purpose.
  • Warning: might need to re-factor your own code.
  • Warning: might be secretly condemned by your colleagues because using too many GPUs.
@thomasbrandon
thomasbrandon / cifar-10-squeezenet-mishcuda.ipynb
Created October 3, 2019 06:48
MishCuda test on cifar-10 squeezenet
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mjdietzx
mjdietzx / residual_network.py
Last active March 26, 2024 06:33
Clean and simple Keras implementation of residual networks (ResNeXt and ResNet) accompanying accompanying Deep Residual Learning: https://blog.waya.ai/deep-residual-learning-9610bb62c355.
"""
Clean and simple Keras implementation of network architectures described in:
- (ResNet-50) [Deep Residual Learning for Image Recognition](https://arxiv.org/pdf/1512.03385.pdf).
- (ResNeXt-50 32x4d) [Aggregated Residual Transformations for Deep Neural Networks](https://arxiv.org/pdf/1611.05431.pdf).
Python 3.
"""
from keras import layers
from keras import models
@viveksck
viveksck / fractal-dimension.py
Created March 14, 2017 13:07 — forked from rougier/fractal-dimension.py
Fractal dimension computing
# -----------------------------------------------------------------------------
# From https://en.wikipedia.org/wiki/Minkowski–Bouligand_dimension:
#
# In fractal geometry, the Minkowski–Bouligand dimension, also known as
# Minkowski dimension or box-counting dimension, is a way of determining the
# fractal dimension of a set S in a Euclidean space Rn, or more generally in a
# metric space (X, d).
# -----------------------------------------------------------------------------
import scipy.misc
import numpy as np