Skip to content

Instantly share code, notes, and snippets.

@ultraist
ultraist / zch_sentence.rb
Created February 2, 2012 15:49
句読点のない文字列を文単位に区切る
# -*- coding: utf-8 -*-
# 句読点のない文字列を文単位に区切る
#
# 基本的にはルールベースでルールが適用できない場合は機械学習器で判定する。
# これは青空文庫のデータ( http://www.udp.jp/misc/aozora-data/ )から学習した。
# * ruby 1.8の場合は $KCODE='u'としないと動かない
=begin
s = <<TEXT
昼飯のスパゲティナポリタンを眺めながら
@kiyukuta
kiyukuta / autoencoder.py
Last active January 23, 2020 06:16
Minimum implementation of denoising autoencoder.Error function is cross-entropy of reconstruction.Optimizing by SGD with mini-batch.Dataset is available at http://deeplearning.net/data/mnist/mnist.pkl.gz
#coding: utf8
"""
1. Download this gist.
2. Get the MNIST data.
wget http://deeplearning.net/data/mnist/mnist.pkl.gz
3. Run this code.
python autoencoder.py 100 -e 1 -b 20 -v
"""
import numpy
import argparse