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 / 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 / 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 / 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 / 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 / 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 / purecmaes.py
Last active November 12, 2019 10:14
An implementation of CMA-ES (https://arxiv.org/abs/1604.00772)
import numpy as np
def rosenbrock(x):
end = x.shape[0]
a = 100.0
b = 1.0
return np.sum(a * np.power((x[1:] - np.power(x[:end-1], 2)), 2) + np.power((x[:end-1] - b), 2))
def cmaes(dim, f):
# User defined parameters