Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""l-bfgs-b L1-Logistic Regression solver""" | |
# Author: Vlad Niculae <vlad@vene.ro> | |
# Suggested by Mathieu Blondel | |
from __future__ import division, print_function | |
import numpy as np | |
from scipy.optimize import fmin_l_bfgs_b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Fitting a gaussian to an empirical weighted measure""" | |
# author: vlad niculae <v.niculae@uva.nl> | |
# license: bsd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.special import logsumexp, softmax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
http://www.cs.technion.ac.il/~ronrubin/Publications/KSVD-OMP-v2.pdf | |
parametrization by error is still in progress | |
""" | |
from time import time | |
import numpy as np | |
from scipy import linalg | |
import matplotlib.pyplot as pl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""wrapped hyperbolic distributions | |
following https://arxiv.org/abs/1902.02992 | |
""" | |
# author: vlad niculae <v.niculae@uva.nl> | |
# license: bsd 3-clause | |
import torch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" trying to understand the determinant of sphere-to-cyl """ | |
import numpy as np | |
import jax.numpy as jnp | |
from jax import jacfwd | |
# map from cylinder to sphere | |
def phi(zr): | |
d = zr.shape[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Example input and output. | |
$ python conf.py seed=42 lr=.1 | |
project: ??? | |
seed: 42 | |
lr: 0.1 | |
epochs: ??? | |
p_drop: 0.5 | |
baseconf: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Approximating the cross-entropy between two Power Sphericals. | |
Uses a second-order Taylor expansion to approximate E[log(1+z)]. | |
""" | |
# author: vlad n <vlad@vene.ro> | |
# license: mit | |
# documentation: https://hackmd.io/@vladn/SJ93wMevK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Dual p-norms illustrated. | |
For any norm |.|, the dual norm is defined as |y|_* = max{ <x, y> for |x| <= 1 }. | |
The figure shows the unit balls of the p-norm, for p = 1.5, 2, and 3. | |
We compute the dual norm at a dual vector y (short black arrow), rotating | |
uniformly around the origin over time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Base: | |
def say(self, val): | |
print("base says", val) | |
class A(Base): | |
def say(self, val): | |
print("say A") |
NewerOlder