Skip to content

Instantly share code, notes, and snippets.

View tonysy's full-sized avatar
🎯
Focusing

Songyang Zhang tonysy

🎯
Focusing
View GitHub Profile
@ryin
ryin / tmux_local_install.sh
Last active July 13, 2024 00:42
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@takuma7
takuma7 / opencv-fourcc-on-mac-os-x.md
Last active April 3, 2024 07:29
OpenCV Video Writer on Mac OS X
@jfpuget
jfpuget / LU_decomposition.ipynb
Created January 27, 2016 18:51
A Speed Comparison Of C, Julia, Python, Numba, and Cython on LU Factorization
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@mjdietzx
mjdietzx / waya-dl-setup.sh
Last active March 13, 2024 15:08
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
@MatthiasWinkelmann
MatthiasWinkelmann / extract.py
Last active March 5, 2024 06:19
Extract PNG images from the cifar-100/cifar-10 pickled dataset
# This extracts png images from the
# packed/pickle'd cifar-100 dataset
# available at http://www.cs.toronto.edu/~kriz/cifar.html
#
# No Rights Reserved/ CC0
# Say thanks @whereismatthi on Twitter if it's useful
#
# probably requires python3
# definitely requires PyPNG: pip3 install pypng
@fmassa
fmassa / compute_flops.py
Created June 28, 2020 13:34
Utility functions used to compute flops in DETR.
# this is the main entrypoint
# as we describe in the paper, we compute the flops over the first 100 images
# on COCO val2017, and report the average result
import torch
import time
import torchvision
import numpy as np
import tqdm