This file contains 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 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") |
This file contains 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 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 sklearn.model_selection import train_test_split | |
import torch | |
import torch.nn as nn | |
from torch.autograd import Variable | |
np.random.seed(1337) | |
MAX_LEN = 30 |
OlderNewer