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 math import sqrt | |
from typing import OrderedDict | |
import torch | |
from torch import nn | |
from torch.nn import functional as F | |
class MultivariateEmbedding(nn.Module): | |
def __init__(self, | |
embeddings: nn.ModuleDict, |
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
# docker build -t dlkit -f dlkit.dockerfile . | |
# docker run -itd --gpus all -p 8888:8888 -p 6006:6006 --ipc host -v ~/workspace/dlkit1:/workspace --name dlkit1 dlkit | |
FROM pytorch/pytorch:2.2.1-cuda12.1-cudnn8-runtime | |
ENV SHELL=/bin/bash | |
WORKDIR /workspace | |
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple |
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 script for labeling where in a audio file is sounding. | |
Dependenicy: | |
pip install torch torchaudio | |
""" | |
import torch | |
from torch.nn import functional as F | |
import torchaudio |
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 | |
class Sampler: | |
def __init__(self, | |
top_k: int, | |
top_p: float, | |
temperature: float, | |
repetition_penalty: float): | |
self.top_k = top_k |
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 \ |
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
# 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
# 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
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__() |
NewerOlder