Skip to content

Instantly share code, notes, and snippets.

import re
import json
import requests
from pprint import pformat
from time import sleep
from gpiozero import Energenie
lamp = Energenie(1)
QUERY_URL='https://www.govtrack.us/api/v2/role?current=true&role_type=president'
@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!