Skip to content

Instantly share code, notes, and snippets.

View fabianp's full-sized avatar
🏠
Working from home

Fabian Pedregosa fabianp

🏠
Working from home
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fabianp
fabianp / frank_wolfe.py
Created March 19, 2018 18:40
Python implementation of the Frank-Wolfe algorithm
import numpy as np
from scipy import sparse
# .. for plotting ..
import pylab as plt
# .. to generate a synthetic dataset ..
from sklearn import datasets
n_samples, n_features = 1000, 10000
A, b = datasets.make_regression(n_samples, n_features)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fabianp
fabianp / spsaga.py
Created August 21, 2017 22:02
Sparse Proximal SAGA
import numpy as np
from scipy import sparse
from datetime import datetime
from numba import njit
@njit
def deriv_logistic(p, b):
"""Derivative of the logistic loss"""
p *= b
if p > 0:
@fabianp
fabianp / ellipse.ipynb
Created November 21, 2016 14:25
plotly ellipse
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fabianp
fabianp / tv1d.py
Created June 10, 2016 06:43
1D total variation (also known as fussed lasso) proximal operator
from numba import njit
@njit
def prox_tv1d(w, stepsize):
"""
Parameters
----------
w: array
vector of coefficieents