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
| """ | |
| REINFORCE(Policy Gradient) | |
| """ | |
| import collections | |
| import gym | |
| import numpy as np | |
| import tensorflow as tf | |
| from keras.models import Model |
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
| """ | |
| REINFORCE with Baseline | |
| """ | |
| import collections | |
| import gym | |
| import numpy as np | |
| import tensorflow as tf | |
| from keras.models import Model |
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
| 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 |
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
| 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") |
OlderNewer