Skip to content

Instantly share code, notes, and snippets.

name: "Encoder"
input: "data"
input_dim: None
input_dim: 3
input_dim: None
input_dim: None
layer {
name: "centered"
@lucastheis
lucastheis / scalars.ipynb
Last active November 12, 2015 15:57
Don't mix integers with floats in Theano.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lucastheis
lucastheis / crossvalidation.ipynb
Created August 29, 2015 08:44
Bias of standard error in leave-one-out cross-validation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from multiprocessing import Process, Pool, Queue
def f(q0):
for i in range(100):
q0.put(i)
def g(q0, q1):
while True:
q1.put(q0.get())
@lucastheis
lucastheis / gram_matrix.py
Last active August 29, 2015 14:25
Gram matrix in Theano
import theano as th
import theano.tensor as tt
def gaussian_kernel(x, y, sigma=1.):
return tt.exp(-tt.sum(tt.square(x - y)) / sigma**2)
def gram_matrix(X, Y, kernel):
M = X.shape[0]
N = Y.shape[0]
@lucastheis
lucastheis / Removing skewness.ipynb
Created February 23, 2015 08:43
Removing skewness
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lucastheis
lucastheis / setup.py
Created November 28, 2013 19:34
Demonstrates the problem with matplotlib resetting the random seed.
#!/usr/bin/env python
from distutils.core import setup, Extension
modules = [
Extension('_test',
language='c++',
sources=[
'test.cpp'])]
import sys
from numpy import *
from numpy.random import *
from matplotlib.pyplot import *
from scipy.stats import *
p17 = .05
p18 = .03
@lucastheis
lucastheis / marginal_likelihood.py
Last active December 20, 2015 07:39
Log-normal vs. normal test.
__author__ = 'Lucas Theis <lucas@theis.io>'
__license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>'
import sys
from numpy import *
from numpy.random import *
from matplotlib.pyplot import *
from scipy.special import gammaln
from scipy.stats import norm, invgamma
#!/usr/bin/env python
"""
Manage and display experimental results.
"""
__license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>'
__author__ = 'Lucas Theis <lucas@theis.io>'
__docformat__ = 'epytext'
__version__ = '0.4.3'