Skip to content

Instantly share code, notes, and snippets.

View yoyolicoris's full-sized avatar
🏝️
γ¬γγŸγ—

YCY yoyolicoris

🏝️
γ¬γγŸγ—
View GitHub Profile
@yoyolicoris
yoyolicoris / scan_ssm.ipynb
Last active June 30, 2025 21:08
Notebook for Block-based Fast Differentiable IIR in PyTorch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
🌞 Morning 263 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Žβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 30.0%
πŸŒ† Daytime 374 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 42.6%
πŸŒƒ Evening 128 commits β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 14.6%
πŸŒ™ Night 112 commits β–ˆβ–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 12.8%
@yoyolicoris
yoyolicoris / differentiable_lfilter.py
Last active August 25, 2022 12:59
This lfilter can propogate gradient to filter coefficients.
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchaudio.functional import lfilter as torch_lfilter
from torch.autograd import Function, gradcheck
class lfilter(Function):
@staticmethod
import numpy as np
import networkx as nx
from scipy.spatial import Delaunay
def W(x):
return (x + np.pi) % (2 * np.pi) - np.pi
def mcf_sparse(x, y, psi, capacity=None):
points = np.vstack((x, y)).T
num_points = points.shape[0]
import numpy as np
import networkx as nx
def W(x):
return (x + np.pi) % (2 * np.pi) - np.pi
def mcf(x: np.ndarray, capacity=None):
assert x.ndim == 2, "Input x should be a 2d array!"
# construct index for each node