Skip to content

Instantly share code, notes, and snippets.

View manuelschmidt's full-sized avatar

Manuel Schmidt manuelschmidt

  • Dortmund, Germany
View GitHub Profile
/**
* @file kde.c
* @author Carl Boettiger, <[email protected]>
* @section DESCRIPTION
* Estimates the kernel density p(x) at a given value x from
* an array of sample points. Uses the default algorithm from
* the R langauge's 'density' function. Requires the GSL statistics
* library.
*
* @section LICENCE
@manuelschmidt
manuelschmidt / timeseries_cnn.py
Created January 18, 2018 06:31 — forked from jkleint/timeseries_cnn.py
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential
@manuelschmidt
manuelschmidt / kulback_leibler_divergence.py
Created January 3, 2018 14:29 — forked from swayson/kulback_leibler_divergence.py
Numpy and scipy ways to calculate KL Divergence.
"""
Specifically, the Kullback–Leibler divergence from Q to P, denoted DKL(P‖Q), is
a measure of the information gained when one revises one's beliefs from the
prior probability distribution Q to the posterior probability distribution P. In
other words, it is the amount of information lost when Q is used to approximate
P.
"""
import numpy as np
from scipy.stats import entropy
@manuelschmidt
manuelschmidt / HomographyDecomposition.as
Created December 14, 2017 07:02 — forked from inspirit/HomographyDecomposition.as
Decompose Homography into Rotation matrix & Translation vector
var intrinsic:Vector.<Number> = new Vector.<Number>(9, true);
var intrinsicInverse:Vector.<Number> = new Vector.<Number>(9, true);
var R:Vector.<Number> = new Vector.<Number>( 9, true );
var t:Vector.<Number> = new Vector.<Number>( 3, true );
// SVD routine
var svd:SVD = new SVD();
// input homography[9] - 3x3 Matrix