Skip to content

Instantly share code, notes, and snippets.

View vene's full-sized avatar
🏴
ahoy

Vlad Niculae vene

🏴
ahoy
View GitHub Profile
@vene
vene / lr_admm.py
Last active May 4, 2024 18:29
LR ADMM
""" Fit logistic regression by ADMM. """
# Author: Vlad Niculae <v.niculae@uva.nl>
# License: MIT
import numpy as np
from sklearn.datasets import load_breast_cancer
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
from scipy.linalg import cho_factor, cho_solve
@vene
vene / rpchol_torch.py
Last active August 11, 2025 16:14
Randomized pivoted Cholesky in pytorch: low-memory versoin
# Author: Vlad Niculae <v.niculae@uva.nl>
# License: MIT
# Memory-efficient randomized pivoted Cholesky factorization
# Algorithm 2.3 from Epperly et al, https://arxiv.org/abs/2410.03969
import torch
torch.set_printoptions(precision=2, linewidth=120, sci_mode=False)
class LazyKernelMatrix:
@vene
vene / permnumber.py
Created August 24, 2025 18:53
Permutation numbering system using the factorial base
"""Permutation numbering system
https://www.numdam.org/item/?id=BSMF_1888__16__176_0
"""
# Author: Vlad Niculae <v.niculae@uva.nl>
# License: MIT
import numpy as np