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 / audioHandler.go
Created January 26, 2014 16:13
Handling wav data exammple as a multi-part/form-data
package main
import (
"encoding/json"
"net/http"
"github.com/mjibson/go-dsp/wav"
)
type AudioInfo struct {
Filename string
@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
#!/usr/bin/python
# coding: utf-8
import numpy as np
from numpy import linalg
from sklearn.mixture import GMM
import scipy.linalg
import scipy.sparse
import scipy.sparse.linalg
@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": [
{