Skip to content

Instantly share code, notes, and snippets.

View frinkleko's full-sized avatar
🌸
Isekai travelling

Xinjie Shen frinkleko

🌸
Isekai travelling
View GitHub Profile
@frinkleko
frinkleko / SPE.py
Last active March 29, 2024 13:57
Toy implementation of SPE: https://openreview.net/pdf?id=xAqcJ9XoTf
import numpy as np
from scipy.linalg import eigh
def soft_partition(eigenvectors, eigenvalues, num_partitions):
# Apply a weighted sum of eigenvectors in an eigenvalue-dependent manner
partitions = np.linspace(np.min(eigenvalues), np.max(eigenvalues), num_partitions)
encodings = np.zeros_like(eigenvectors)
for i, val in enumerate(partitions[:-1]):
start, end = partitions[i], partitions[i+1]
mask = (eigenvalues >= start) & (eigenvalues < end)
@frinkleko
frinkleko / latex_in_office.md
Created July 15, 2023 06:44
A Prefect and Elegant way to use latex equation in Word, PPT...

NO! Not Support

In latest version of office software, basic latex grammar for simple math expression is supported. The usual way to show math equation in PPT is typing it in Word, then click insert eqauation, then click transforming, finally copy and paste it in PPT.

That's already annoying. However, some fabulous equations or symbols can't be used in Word.

image-20230715143344621

Solution