Skip to content

Instantly share code, notes, and snippets.

View ikegami-yukino's full-sized avatar

IKEGAMI Yukino ikegami-yukino

View GitHub Profile
@esehara
esehara / oogiri.py
Created April 25, 2015 04:40
メカ大喜利マン ver 0.1
# -*- coding: utf-8 -*-
from gensim.models import word2vec
import MeCab
import random
model = word2vec.Word2Vec.load("oogiri_gensim.model")
tagger = MeCab.Tagger("-Ochasen")
def word_and_kind_parse(line):
line_word = line.split("\t")
if len(line_word) < 2:
@Bollegala
Bollegala / ADAMvsAdaGrad.py
Created March 10, 2015 18:33
ADAM vs AdaGrad
"""
This program compares ADAM vs AdaGrad. You can modify the function f and its gradient grad_f
in the code, run the two algorithms and compare their convergence. For the simple function
f(x1, x2) = (x1 - 2) ** 2 + (x1 + 3) ** 2, (alpha = 0.1 and tolerence 1e-3)
AdaGrad converged at 2023 iterations, whereas ADAM required only 83!
"""
import numpy
@raine
raine / .gitconfig
Created February 27, 2015 10:12
git add with grep
[alias]
grep-add = "!sh -c 'git ls-files -m -o --exclude-standard | grep $1 | xargs git add' -"
grep-add-patch = "!sh -c 'git add -p `git ls-files -m -o --exclude-standard | grep $1`' -"
@neubig
neubig / lstm-lm.py
Last active August 23, 2017 09:18
This is a minimal implementation of training for a language model using long short-term memory (LSTM) neural networks
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is a simplified implementation of the LSTM language model (by Graham Neubig)
#
# LSTM Neural Networks for Language Modeling
# Martin Sundermeyer, Ralf Schlüter, Hermann Ney
# InterSpeech 2012
#
# The structure of the model is extremely simple. At every time step we
@rezoo
rezoo / caffe.md
Last active November 4, 2021 15:28

Caffe tutorial

この文章ではCNN実装であるCaffeを用いて,特徴ベクトルの抽出やパラメータの学習を行うための方法について説明する.

Caffeでサポートされている機能

以下の作業を行いたいのであれば,Caffeを用いることが望ましい.

  • CNNを利用した画像の多クラス分類
  • CNNによる特徴ベクトルの抽出
  • CNNの転移学習
  • Stacked Auto Encoder
@Mekajiki
Mekajiki / Hiragana2Phoneme.java
Last active October 8, 2023 22:48
ひらがなを音声認識アプリケーションJuliusで使われている音素表現(.htkdic)に変換する
package net.mekajiki;
import com.ibm.icu.text.Transliterator;
import java.util.ArrayList;
import java.util.List;
public class Hiragana2Phoneme {
public static String hiragana2Phoneme(String text) {
return romaji2Phoneme(hiragana2Romaji(text));
}
@aflc
aflc / edit_distance.cpp
Last active May 4, 2019 18:38
fast implementation of the edit distance (levenshtein distance).
// Copyright (c) 2013 Hiroyuki Tanaka
// Released under the MIT license
#include <stdint.h>
#include <cstdlib>
#include <cstring>
#include <string>
#include <map>
#include <vector>
#include <iostream>
{
"IAB1": "Arts & Entertainment",
"IAB1-1": "Books & Literature",
"IAB1-2": "Celebrity Fan/Gossip",
"IAB1-3": "Fine Art",
"IAB1-4": "Humor",
"IAB1-5": "Movies",
"IAB1-6": "Music",
"IAB1-7": "Television",
"IAB2": "Automotive",
@ttezel
ttezel / gist:4138642
Last active July 27, 2024 14:46
Natural Language Processing Notes

#A Collection of NLP notes

##N-grams

###Calculating unigram probabilities:

P( wi ) = count ( wi ) ) / count ( total number of words )

In english..

@stober
stober / softmax.py
Created March 1, 2012 03:05
Softmax in Python
#! /usr/bin/env python
"""
Author: Jeremy M. Stober
Program: SOFTMAX.PY
Date: Wednesday, February 29 2012
Description: Simple softmax function.
"""
import numpy as np
npa = np.array