Skip to content

Instantly share code, notes, and snippets.

"""From: https://github.com/ermongroup/ddim/blob/main/models/diffusion.py"""
import math
import torch
import torch.nn as nn
def get_timestep_embedding(timesteps, embedding_dim):
"""
This matches the implementation in Denoising Diffusion Probabilistic Models:
From Fairseq.
Build sinusoidal embeddings.
@Miking98
Miking98 / jupyter_to_jekyll.py
Created September 15, 2022 08:02
Files to convert .ipynb -> .md for Jekyll
import os
import re
import subprocess
import argparse
import pathlib
parser = argparse.ArgumentParser()
parser.add_argument('ipynb_path', type=str)
args = parser.parse_args()
@Miking98
Miking98 / jupyter_to_jekyll.py
Created September 14, 2022 10:31
Convert Jupyter notebook -> Markdown file for publishing to Jekyll blog
import os
import re
import subprocess
import argparse
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser()
parser.add_argument('ipynb_file_name', type=str)
args = parser.parse_args()