Skip to content

Instantly share code, notes, and snippets.

@AI-WAIFU
AI-WAIFU / xy_yx.py
Created November 12, 2023 11:42
x->y therefore y->x
import transformers
import numpy as np
import torch
import torch
import itertools
import torch.nn as nn
import torch.nn.functional as f
import csv
import random
from x_transformers import TransformerWrapper, Decoder, Encoder
@AI-WAIFU
AI-WAIFU / diffusion.py
Created July 29, 2023 18:15
Epsilon Diffusion + DDIM
import jax
import jax.numpy as jnp
import equinox as eqx
import matplotlib.pyplot as plt
import optax
import functools
#Data parameters
MEANS = (jnp.array([-0.5,0.5]),jnp.array([0.5,-0.5]))
VARIANCES = [jnp.eye(2)*0.1]*2
@AI-WAIFU
AI-WAIFU / bivae.py
Created June 18, 2023 20:37
Illustration of a basic bi-vae implementation which is essentially 2 VAEs glued together to share the same latent space
import equinox as eqx
import equinox.nn as nn
import jax
import jax.numpy as jnp
import optax
import matplotlib.pyplot as plt
#VAE parameters
H = 400 #Hidden network size
L = 2 #Latent space size
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.