Skip to content

Instantly share code, notes, and snippets.

@Hi-king
Hi-king / train.py
Last active September 17, 2015 07:53
Learning NeuralNet with chainer
#!/usr/bin/env python
import random
import argparse
import numpy
import chainer
import chainer.optimizers
class SmallClassificationModel(chainer.FunctionSet):
def __init__(self):
@Hi-king
Hi-king / gist:5538864
Created May 8, 2013 07:42
gist x migiue
// ==UserScript==
// @name gist_title
// @namespace gist
// @include http://gist.github.com/*
// @include https://gist.github.com/*
// @version 1
// ==/UserScript==
(function(){
var migiuetext = document.createElement("div");
@Hi-king
Hi-king / file0.txt
Created September 2, 2013 09:53
.gitignoreでホワイトリストを使う ref: http://qiita.com/Hi-king/items/a8485557095692f1bf13
## .gitignore ##
# ignore all
*
*/
# allow any
!*.py
!*.bash
@Hi-king
Hi-king / crop.py
Last active January 24, 2019 04:14
chainerで画像分類するための補助スクリプト
!/usr/bin/python
# -*- coding: utf-8 -*-
import cv2
import argparse
import os
import numpy
parser = argparse.ArgumentParser()
parser.add_argument("source_dir")
parser.add_argument("target_dir")
@Hi-king
Hi-king / plot.py
Created January 31, 2019 14:16
seabornで破線プロット
import numpy
import seaborn
import pandas
from matplotlib import pyplot
n = 100
x = numpy.linspace(0, 4, n)
y1 = numpy.sin(2 * numpy.pi * x)
y2 = numpy.cos(2 * numpy.pi * x)