Skip to content

Instantly share code, notes, and snippets.

View r9y9's full-sized avatar
:shipit:
( ˘ω˘ ) zzz

Ryuichi Yamamoto r9y9

:shipit:
( ˘ω˘ ) zzz
View GitHub Profile
@r9y9
r9y9 / nmf.go
Created February 16, 2014 07:59
Non-negative Matrix Factorization (NMF) in Golang
package main
import (
"fmt"
. "github.com/r9y9/go.matrix"
)
// Minimize |Y - HU|^2 st H, U > 0
func NMFEuclid(Y *DenseMatrix, numBasis, numIter int) (*DenseMatrix, *DenseMatrix) {
H := Numbers(Y.Rows(), numBasis, 1.0)
package main
import (
"fmt"
"math"
)
func HermitePolynomialsProb(x float64, n int) float64 {
norm := float64(factorial(n))
y := 0.0
@r9y9
r9y9 / cwt_demo.go
Created June 1, 2014 04:47
ウェーブレット変換のデモコード
package main
import (
"fmt"
"github.com/mjibson/go-dsp/fft"
"math"
"math/cmplx"
)
// Morlet represents the Morlet wavelet function.
@r9y9
r9y9 / istft.go
Created June 20, 2014 16:17
Inverse short time fourier transform using gossp
package main
import (
"flag"
"fmt"
"github.com/r9y9/gossp/io"
"github.com/r9y9/gossp/stft"
"github.com/r9y9/gossp/window"
"log"
)
@r9y9
r9y9 / parse_pkl.go
Created July 10, 2014 16:39
Parsing pkl in Go
package main
import (
"fmt"
pkl "github.com/dgryski/og-rek"
"log"
"os"
)
func main() {
@r9y9
r9y9 / parse_yaml.go
Created July 10, 2014 16:39
Parsing yaml in Go
package main
import (
"fmt"
"gopkg.in/yaml.v1"
"io/ioutil"
"log"
)
type Config struct {
@r9y9
r9y9 / pylearn2_amazon_linux_ami_with_nvidia_setup.sh
Created July 20, 2014 14:59
Pylearn2 setup script for Amazon Linux AMI with NVIDIA GRID GPU Driver
#!/bin/bash
# Pylearn2 setup script for Amazon Linux AMI with NVIDIA GRID GPU Driver.
# http://goo.gl/3KeXXW
# not tested
sudo yum update -y
sudo yum install -y emacs tmux python-pip
sudo yum install -y python-devel git blas-devel lapack-devel
@r9y9
r9y9 / Coursera Digital Signal Processing Homework Week #2.json
Created August 3, 2014 14:22
Coursera Digital Signal Processing Homework Week #2
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@r9y9
r9y9 / user.behaviors
Created August 26, 2014 01:34
user behaviors of LightTable
;; User behaviors
;; -----------------------------
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You can
;; modify these diffs to either add or subtract functionality.
;;
;; Behaviors are added to tags, objects with those tags then automatically gain
;; whatever logic the behavior imparts. To see a list of user-level behaviors,
;; start typing a word related to the functionality you want in between the square
;; brackets (e.g. "theme").
@r9y9
r9y9 / build.sh
Last active August 29, 2015 14:06
JuliaTokyo #2 で使う資料に載せるコード。BinDeps.jl の使用例
#!/bin/bash
function install_libsndfile() {
name=libsndfile-1.0.25.tar.gz
wget -O $name http://www.mega-nerd.com/libsndfile/files/$name
tar xzvf $name
cd `basename $name ".tar.gz"`
./configure --prefix=$PWD/..