Skip to content

Instantly share code, notes, and snippets.

Avatar

Kimikazu Kato hamukazu

View GitHub Profile
@hamukazu
hamukazu / server.py
Last active Nov 22, 2017
Very simple example of bottle and form input
View server.py
import bottle
app = bottle.Bottle()
s = """<p>名前は?</p>
<p>
<form method="GET" action="/get"">
<input type="text" name="a" />
<input type="submit" />
</form>
</p>"""
@hamukazu
hamukazu / Reuters.py
Last active Jun 1, 2017 — forked from herrfz/Reuters.py
Reuters-21578 keyword extraction
View Reuters.py
# Reuters-21578 dataset downloader and parser
#
# Author: Eustache Diemert <eustache@diemert.fr>
# http://scikit-learn.org/stable/auto_examples/applications/plot_out_of_core_classification.html
#
# Modified by @herrfz, get pandas DataFrame from the orig SGML
# License: BSD 3 clause
from __future__ import print_function
View minecraft_dodecahedron.py
#!/usr/bin/env python
import numpy as np
import mcpi
import mcpi.block
import mcpi.minecraft
def line(mc, v1, v2):
v = v2 - v1
norm = np.sqrt((v**2).sum())
View minecraft_koch.py
#!/usr/bin/env python
"This program draws a Koch curve in Minecraft"
import mcpi
import mcpi.block
import mcpi.minecraft
import numpy as np
LIMIT = 7
View minecraft_cone.py
#!/usr/bin/env python
"This program makes a cone in Minecraft"
import mcpi
import mcpi.block
import mcpi.minecraft
import numpy as np
def disk(mc, cx, cy, cz, r):
View pyconjp-tutorial-scikit-learn.md

PyCon JP 2015 チュートリアル「Pythonを使った機械学習入門」のページ

用意するもの

次のものがインストールされているPCを用意してください。

  • OSはWindows/Mac/Ubuntuのいずれか(それ以外のものは講師が対応出来ない可能性がありますので、自己責任でお願いします)
  • Python3.4.0以降のバージョン
  • NumPy, SciPy, matplotlib, scikit-learn
  • テキストエディタやIDEでPythonに対応したもの
View gist:5e17ef74345bf99b0241
{
"metadata": {
"name": "",
"signature": "sha256:89cf919bf95aa5890f6bfdfaeb3326b0387784bdc70d5b96e515bfffdae2d9ab"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
View Use case of Caffe with cifar10
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
View cnn.patch
diff -u -r cnn_orig/convolutional_mlp.py cnn/convolutional_mlp.py
--- cnn_orig/convolutional_mlp.py 2014-08-08 12:15:47.412611962 +0900
+++ cnn/convolutional_mlp.py 2014-08-08 12:18:02.684614501 +0900
@@ -37,6 +37,18 @@
from logistic_sgd import LogisticRegression, load_data
from mlp import HiddenLayer
+from PIL import Image
+
+def pack(m,n,a):
View puzzle_of_vine.clj
(require 'clojure.set)
(defn perms [n s]
(if (zero? n) '(())
(reduce (fn [x y] (let [m (dec n) ss (clojure.set/difference s #{y})]
(concat x (map (fn [z] (cons y z)) (perms m ss)))))
() s)))
(defn solv [a]
(def b (vec a))
(def appeared (set a))