This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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.