Skip to content

Instantly share code, notes, and snippets.

View lorentzbf's full-sized avatar
🎯
Focusing

Zhaoyang Du lorentzbf

🎯
Focusing
View GitHub Profile
@hatzel
hatzel / scheduler_visualize.py
Created October 25, 2019 09:56
Quickly Visualize PyTorch Learning Schedulers
import torch
from torch.optim.lr_scheduler import CosineAnnealingLR
from torch.optim import SGD
import matplotlib.pyplot as plt
STEPS = 100
optimizer = SGD([torch.tensor(1)], lr=1)
# Use a scheduler of your choice below.
# Great for debugging your own schedulers!
@frkd-dev
frkd-dev / time_perf.c
Last active April 13, 2022 08:53
Measure performance for different time functions
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <time.h>
#include <sys/time.h>
/*
Build:
gcc -o time_perf time_perf.c