Skip to content

Instantly share code, notes, and snippets.

View kingsj0405's full-sized avatar
🏠
Working at home

Sejong Yang kingsj0405

🏠
Working at home
View GitHub Profile
@kingsj0405
kingsj0405 / latency.markdown
Created September 22, 2022 04:06 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@kingsj0405
kingsj0405 / vgg_feature_extractor.py
Last active February 3, 2021 05:48 — forked from alper111/vgg_perceptual_loss.py
PyTorch implementation of VGG perceptual loss
# Forked from vgg perceptual loss
# https://gist.github.com/alper111/8233cdb0414b4cb5853f2f730ab95a49
import torch
import torchvision
class VGGFeatureExtractor(torch.nn.Module):
def __init__(self, resize=True):
super(VGGFeatureExtractor, self).__init__()
blocks = []
@kingsj0405
kingsj0405 / iframe-github.md
Created May 14, 2020 03:06 — forked from lostsh/iframe-github.md
Iframe gist
@kingsj0405
kingsj0405 / extract_ILSVRC.sh
Created February 10, 2020 11:16 — forked from BIGBALLON/extract_ILSVRC.sh
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/