Skip to content

Instantly share code, notes, and snippets.

View kenzotakahashi's full-sized avatar

Kenzo Takahashi kenzotakahashi

  • Tokyo, Japan
View GitHub Profile
@kenzotakahashi
kenzotakahashi / policy_gradient.py
Last active August 6, 2018 05:22
Policy Gradient
"""
REINFORCE(Policy Gradient)
"""
import collections
import gym
import numpy as np
import tensorflow as tf
from keras.models import Model
"""
REINFORCE with Baseline
"""
import collections
import gym
import numpy as np
import tensorflow as tf
from keras.models import Model
@kenzotakahashi
kenzotakahashi / constructWallOutline.js
Last active April 3, 2018 07:39
Construct outlines of walls.
function magnitude(vx, vy) {
return Math.sqrt(vx**2 + vy**2)
}
function slope(x1, y1, x2, y2) {
return (y2 - y1) / (x2 - x1)
}
function isParallel(l1, l2) {
const [[x1,y1],[x2,y2]] = l1
const { GraphQLServer } = require('graphql-yoga')
const mongoose = require('mongoose')
require('dotenv').config()
const resolvers = require('./resolvers')
mongoose.connect(process.env.MONGODB_URI)
const db = mongoose.connection
db.on("error", console.error.bind(console, "connection error"))
db.once("open", function(callback){
console.log("Connection Succeeded")