Skip to content

Instantly share code, notes, and snippets.

View akshaychawla's full-sized avatar

Akshay Chawla akshaychawla

  • Vicarious Inc.
  • working from home
View GitHub Profile
@gyglim
gyglim / tensorboard_logging.py
Last active August 23, 2023 21:29
Logging to tensorboard without tensorflow operations. Uses manually generated summaries instead of summary ops
"""Simple example on how to log scalars and images to tensorboard without tensor ops.
License: BSD License 2.0
"""
__author__ = "Michael Gygli"
import tensorflow as tf
from StringIO import StringIO
import matplotlib.pyplot as plt
import numpy as np
@akshaychawla
akshaychawla / cscheduler.py
Last active December 22, 2023 11:56
Learning rate schedulers for PyTorch. (1) Cosine annealing with warmup and (2) Linear with warmup
"""
Useful learning rate schedulers
Warmup
CosineAnnealingLRWarmup
"""
import torch
import math
import functools
def _cosine_decay_warmup(iteration, warmup_iterations, total_iterations):