Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Fabian Pedregosa fabianp

🏠
Working from home
View GitHub Profile
View jaxopt.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View flax_resnet_pytorch.py
# 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,
View flax_resnet_groupnorm.py
# 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,
View backtrack.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View SAGA-dask.ipynb
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 Mar 19, 2018
Python implementation of the Frank-Wolfe algorithm
View frank_wolfe.py
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)
View basic_saga.ipynb
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 Aug 21, 2017
Sparse Proximal SAGA
View spsaga.py
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:
View ellipse.ipynb
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 Jun 10, 2016
1D total variation (also known as fussed lasso) proximal operator
View tv1d.py
from numba import njit
@njit
def prox_tv1d(w, stepsize):
"""
Parameters
----------
w: array
vector of coefficieents