This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from keras.models import Sequential | |
from keras.layers import Dense, Dropout, Activation, Flatten | |
from keras.layers import Conv2D, MaxPooling2D | |
from keras.utils import np_utils | |
root_dir = "./image/" | |
categories = ["red_apple", "green_apple"] | |
nb_classes = len(categories) | |
image_size = 32 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
from bottle import route, run | |
import irm | |
import os | |
@route('/light_on') | |
def light_on(): | |
irm.playIR("room_light_on.json") | |
irm.playIR("stand_light_on.json") | |
print("Light On!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
class QLearning: | |
def __init__(self, actions, learning_rate=0.01, reward_decay=0.9, e_greedy=0.9): | |
# actions = [0, 1, 2, 3] | |
self.actions = actions | |
self.alpha = learning_rate | |
self.discount_factor = reward_decay |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu May 5, 2016 | |
@author: jonki | |
https://github.com/jojonki/reinforcement-practice/blob/master/simple-q-learning.py | |
こちらをPython3で動作する様に一部改変しました | |
""" | |
import numpy as np | |
import random |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2016 Adafruit Industries | |
# Author: Tony DiCola | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import grove_gesture_sensor | |
from grove_rgb_lcd import * | |
import time | |
import Adafruit_PCA9685 | |
import grove_i2c_motor_driver | |
pwm = Adafruit_PCA9685.PCA9685() | |
pwm.set_pwm_freq(60) | |
m= grove_i2c_motor_driver.motor_driver() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import grove_gesture_sensor | |
from grove_rgb_lcd import * | |
import time | |
def main(): | |
g=grove_gesture_sensor.gesture() | |
g.init() | |
setText("-\nNewtral") | |
setRGB(255,255,255) #White | |
while True: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2016 Adafruit Industries | |
# Author: Tony DiCola | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/adafruit/Adafruit_Python_PCA9685 を少し書き換えています | |
# Copyright (c) 2016 Adafruit Industries | |
# Author: Tony DiCola | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var http = require('http').Server(app); | |
var io = require('socket.io')(http); | |
var exec = require('child_process').exec; | |
var five = require("johnny-five"); | |
var board = new five.Board(); | |
app.use(express.static('public')); |