Implementation of gMLP, an all-MLP replacement for Transformers, in Pytorch - g-mlp-pytorch/setup.py at main · lucidrains/g-mlp-pytorch
from g_mlp_pytorch import gMLP from g_mlp_pytorch.autoregressive_wrapper import AutoregressiveWrapper import random import tqdm import gzip import numpy as np import torch import torch.optim as optim from torch.nn import functional as F from torch.utils.data import DataLoader, Dataset # constants ...
33 changes: 29 additions & 4 deletions 33 g_mlp_pytorch/g_mlp_pytorch.py Original file line numberDiff line numberDiff line change @@ -29,6 +29,11 @@ def dropout_layers(layers, prob_survival): layers = [layer for (layer, drop) in zip(layers, to_drop) if not drop] return ...