Skip to content

Instantly share code, notes, and snippets.

@tam17aki
tam17aki / kernel_kmeans.py
Last active April 7, 2023 07:33 — forked from mblondel/kernel_kmeans.py
Kernel K-means.
# -*- coding: utf-8 -*-
"""Clustering with Kernel K-means."""
# Author: Mathieu Blondel <mathieu@mblondel.org>
# Author: Akira Tamamori
# License: BSD 3 clause
import matplotlib.pyplot as plt
import numpy as np
from sklearn.base import BaseEstimator, ClusterMixin
@tam17aki
tam17aki / audio_tools.py
Created July 26, 2020 04:31 — forked from kastnerkyle/audio_tools.py
Audio tools for numpy/python. Constant work in progress.
raise ValueError("DEPRECATED/FROZEN - see https://github.com/kastnerkyle/tools for the latest")
# License: BSD 3-clause
# Authors: Kyle Kastner
# Harvest, Cheaptrick, D4C, WORLD routines based on MATLAB code from M. Morise
# http://ml.cs.yamanashi.ac.jp/world/english/
# MGC code based on r9y9 (Ryuichi Yamamoto) MelGeneralizedCepstrums.jl
# Pieces also adapted from SPTK
from __future__ import division
import numpy as np
@tam17aki
tam17aki / init-ivy.el
Created July 26, 2019 08:17 — forked from takaxp/init-ivy.el
My configs for ivy-mode (0.12.0)
;; Configurations for ivy-mode (load "/path/to/init-ivy.el" nil t)
;; This elisp may require:
;; smex.el, all-the-icons.el, flyspell-correct-ivy.el, counsel-world-clock.el
;; counsel-gtalgs.el, all-the-icons-ivy.el, counsel-projectile.el
;; prescient.el, counsel-selected.el, counsel-osx-app.el, ivy-dired-history.el
;; magit.el, org-recent-headings.el, ivy-posframe.el
;; 2019-07-26 published.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'ivy)
(require 'counsel)
@tam17aki
tam17aki / trim.py
Last active July 3, 2019 11:52 — forked from r9y9/a.py
juliusのセグメンテーション結果に基づいて音声をトリミングする
import numpy as np
import os
from nnmnkwii.datasets import jsut
import librosa
import librosa.display
from matplotlib import pyplot as plt
from nnmnkwii.io import hts
from os.path import exists
@tam17aki
tam17aki / capsLayer.py
Created November 28, 2017 03:48 — forked from debarko/capsLayer.py
CapsNet Capsule Definition
# It only has two dependencies numpy and tensorflow
import numpy as np
import tensorflow as tf
from config import cfg
# Class defining a Convolutional Capsule
# consisting of multiple neuron layers
#