Skip to content

Instantly share code, notes, and snippets.

View JasonKessler's full-sized avatar

Jason S. Kessler JasonKessler

View GitHub Profile
@JasonKessler
JasonKessler / monkey_patch_keras_custom_object.py
Last active January 19, 2017 23:12
Loading a model with custom activation function (or custom_objects) in Keras 1.1.0 via monkey patching
import mock, keras
def custom(x):
return x # Replace this with your activation function.
model_json = open('config.json').read()
'''
Trying to run:
@fabianp
fabianp / group_lasso.py
Created December 2, 2011 14:17
group lasso
import numpy as np
from scipy import linalg, optimize
MAX_ITER = 100
def group_lasso(X, y, alpha, groups, max_iter=MAX_ITER, rtol=1e-6,
verbose=False):
"""
Linear least-squares with l2/l1 regularization solver.