This file contains 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
from typing import List | |
from itertools import chain | |
import torch | |
from torch import nn | |
class MLP(nn.Module): | |
def __init__(self, | |
hidden_sizes: List[int], | |
act_fn: nn.Module = nn.ReLU, |
This file contains 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
# http://proceedings.mlr.press/v80/wehrmann18a/wehrmann18a.pdf | |
from collections import OrderedDict | |
from typing import Tuple | |
import torch | |
from torch import nn | |
from torch.nn import functional as F | |
This file contains 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
\documentclass[border=1pt,tikz]{standalone} | |
\usepackage{listofitems} | |
\usepackage{tikz} | |
\usetikzlibrary{arrows} | |
\usetikzlibrary{backgrounds} | |
\newcounter{attributecount} | |
\NewDocumentCommand{\attribute}{mm} { | |
\draw[black, fill={#1}, rounded corners=6, thick] (0.1, \value{attributecount}+0.12) rectangle (3.9, \value{attributecount}+0.98) node at (2, \value{attributecount}+0.5) {#2}; |
This file contains 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
""" | |
* A simple multi-head classifier implementation. | |
+-----------------+ | |
+--------------+ | logits_dict | | |
| hidden | +-----------------+ | |
+------+-------+ ^ | |
| | | |
v +--------------------+--------------------+ | |
+--------------+ | | | | |
| joint_layer | +---------------+ +---------------+ +---------------+ |
This file contains 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
from typing import List | |
from itertools import chain | |
import torch | |
from torch import nn | |
class Transpose(nn.Module): | |
def __init__(self, *args): | |
super().__init__() |
This file contains 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
from typing import List | |
from itertools import chain | |
import torch | |
from torch import nn | |
class Transpose(nn.Module): | |
def __init__(self, *args): | |
super().__init__() |
This file contains 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
# https://arxiv.org/pdf/2102.12994.pdf | |
from typing import Dict | |
from itertools import permutations | |
import torch | |
from torch import nn | |
from math import sqrt | |
class FMFM(nn.Module): |
This file contains 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
# https://arxiv.org/pdf/1810.11921.pdf | |
from typing import Dict | |
from itertools import product | |
import torch | |
from torch import nn | |
import torch.nn.functional as F | |
class AutoInt(nn.Module): | |
def __init__(self, |
This file contains 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 torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torchaudio | |
import numpy as np | |
def get_fourier_basis(win_length, window_func=torch.hann_window): | |
# Create kernels for STFT, initialized to Fourier basis | |
n_basis = win_length // 2 + 1 |
This file contains 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
#ifndef _META_NUMERIC_ | |
#define _META_NUMERIC_ | |
#include <iostream> | |
#include <string> | |
namespace metanumeric { | |
#define UNARY_ASGN_OPTS \ |
OlderNewer