Skip to content

Instantly share code, notes, and snippets.

@suzusuzu
suzusuzu / gif.go
Last active December 18, 2016 00:11
gif
package main
import (
"bytes"
"encoding/binary"
"fmt"
"os"
)
func main() {
@suzusuzu
suzusuzu / ungif.go
Last active December 18, 2016 01:23
ungif
package main
import (
"fmt"
"os"
)
func main() {
if len(os.Args) != 3 {
import numpy as np
import chainer
import math
import argparse
def ngram_sentences(sentences, n=1):
parse = lambda words, n : list(zip(*(words[i:] for i in range(n))))
arr = []
for sentence in sentences:
arr.extend(parse(sentence, n))
@suzusuzu
suzusuzu / gpytorch_iris.ipynb
Created October 7, 2019 10:49
gpytorch_iris.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suzusuzu
suzusuzu / caratheodory.ipynb
Created October 5, 2019 23:07
caratheodory.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suzusuzu
suzusuzu / kernel_estimation_entropy.ipynb
Created October 3, 2019 12:52
kernel_estimation_entropy.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suzusuzu
suzusuzu / gpclust_demo.ipynb
Last active October 7, 2019 16:35
gpclust_demo.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suzusuzu
suzusuzu / pytorch_gradient_descent.ipynb
Last active October 7, 2019 16:36
pytorch_gradient_descent.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suzusuzu
suzusuzu / higher_order_svd.ipynb
Last active November 4, 2019 07:13
Higher Order SVD(HOSVD)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@suzusuzu
suzusuzu / gaussian_mean_shift.py
Last active November 11, 2019 19:37
An implementation of Gaussian Mean Shift Procedure
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
import matplotlib.animation as animation
def gaussian_kernel(x, sigma):
return 1 / (np.sqrt(2*np.pi)*sigma) * np.exp(-(x**2)/(2*(sigma**2)))
def x_update(x, xi, sigma):
return np.sum(gaussian_kernel(xi - x, sigma) * x) / np.sum(gaussian_kernel(xi - x, sigma))