Skip to content

Instantly share code, notes, and snippets.

View peace098beat's full-sized avatar

Tomoyuki Nohara peace098beat

View GitHub Profile
@peace098beat
peace098beat / Qlearning3.py
Last active October 8, 2015 08:59
[QLearning3] 自力でQ学習を実装
# coding: utf-8
"""
Q学習-最良経路を学習するスクリプト書いた (powered by Python)
http://d.hatena.ne.jp/Kshi_Kshi/20111227/1324993576
Greedy法:学習結果をGreedy法で行動選択
11:00-
"""
@peace098beat
peace098beat / map-qt.py
Created October 5, 2015 09:13
[map-qt.py ver2] textの追加
# -*- coding:utf-8 -+-
"""
Q-Learning
強化学習で迷路を探索する
Pythonで迷路探索の学習コード。しかしPygameが必要。
http://qiita.com/hogefugabar/items/74bed2851a84e978b61c
PySideで動かす。
"""
@peace098beat
peace098beat / action.py
Created October 5, 2015 04:58
[強化学習] QLearn
# -*- coding:utf-8 -+-
"""
action.py
"""
import const
class Action:
def __init__(self, direction, possibility):
@peace098beat
peace098beat / gui_FileListWidget.py
Created September 9, 2015 09:06
[PySide] ドラッグドロップでファイル一覧を表示するQListViewウィジェット
#! encoding:utf-8
"""
gui_fileListWidget.py
Description:
ドラッグアンドドロップでファイルリストを表示するウィジェット
本当のデータはmodelが格納している。
Delegeteはリストのindex毎にModeからデータを読み出している。
Example:
@peace098beat
peace098beat / QListViewSmaple.py
Created September 9, 2015 07:03
[PySide] QListViewSmaple
#! coding:utf-8
"""
QListViewを使って、ファイルをリストする
PySideでリストをカスタマイズするぞ! ~基礎編「model/viewアーキテクチャ」~
http://www.dfx.co.jp/dftalk/?p=14388
PySideでリストをカスタマイズするぞ! ~応用編「delegate」~
http://www.dfx.co.jp/dftalk/?p=16745
@peace098beat
peace098beat / style_FiSig.css
Created September 7, 2015 11:11
[PySIde] FiSig スタイルシートデフォルト
/*fisig_stylesheet_a1.css*/
/******* QWidget ********/
QWidget
{
color: #b1b1b1;
background-color:#3a3a3a;
}
@peace098beat
peace098beat / main.py
Created September 7, 2015 11:10
[PySide] CSSの使い方
#! coding:utf-8
# app_main.py
import os
import sys
from PySide import QtGui, QtUiTools
from qcss13 import qcss13
## Import UI File
UI_FILE_NAME = '/qss13.ui'
@peace098beat
peace098beat / mpl_stylesheet.py
Created September 7, 2015 11:02
[Style] Matplotlib Style Sheet
import matplotlib as mpl
### MATPLOTLIBRC FORMAT
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overwritten in your next install.
# If you want to keep a permanent local copy that will not be
# overwritten, place it in HOME/.matplotlib/matplotlibrc (unix/linux
@peace098beat
peace098beat / adboost.py
Created August 18, 2015 05:52
AdaBoost
#! coding:utf-8
# ****************************************** #
#
# adboost.py
#
# ****************************************** #
from __future__ import division
from numpy import *
@peace098beat
peace098beat / adaboost.py
Last active August 29, 2015 14:27 — forked from tristanwietsma/adaboost.py
AdaBoost Python implementation of the AdaBoost (Adaptive Boosting) classification algorithm.
from __future__ import division
from numpy import *
class AdaBoost:
def __init__(self, training_set):
self.training_set = training_set
self.N = len(self.training_set)
self.weights = ones(self.N)/self.N
self.RULES = []