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
| """ Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
| import numpy as np | |
| import cPickle as pickle | |
| import gym | |
| # hyperparameters | |
| H = 200 # number of hidden layer neurons | |
| batch_size = 10 # every how many episodes to do a param update? | |
| learning_rate = 1e-4 | |
| gamma = 0.99 # discount factor for reward |
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
| #!/usr/bin/python3 | |
| from sys import exit | |
| from sys import stdout | |
| from sys import path as syspath | |
| from os import path as osp | |
| from os import stat, makedirs | |
| import argparse | |
| from shutil import copyfile |
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 gym | |
| import numpy as np | |
| from collections import deque | |
| from gym import wrappers | |
| # Create the Cart-Pole game environment | |
| env = gym.make('CartPole-v0') | |
| env = wrappers.Monitor(env, '/tmp/cartpole-experiment-1') | |
| def relu(x): |
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
| /* | |
| * one.c -- Lua core, libraries, and interpreter in a single file (Lua 5.3) | |
| */ | |
| /* default is to build the full interpreter */ | |
| #ifndef MAKE_LIB | |
| #ifndef MAKE_LUAC | |
| #ifndef MAKE_LUA | |
| #define MAKE_LUA | |
| #endif |
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 cdk = require("@aws-cdk/core"); | |
| import { Vpc, Port } from "@aws-cdk/aws-ec2"; | |
| import { | |
| Cluster, | |
| ContainerImage, | |
| AwsLogDriver, | |
| FargatePlatformVersion, | |
| NetworkMode, | |
| CfnService, | |
| } from "@aws-cdk/aws-ecs"; |
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 { App, Construct, Stack, StackProps, CfnParameter, CfnCondition, Fn } from '@aws-cdk/core'; | |
| import * as sns from '@aws-cdk/aws-sns'; | |
| export interface DemoProps { } | |
| export class Demo extends Construct { | |
| constructor(scope: Construct, id: string) { | |
| super(scope, id) | |
| const stack = Stack.of(this); |
OlderNewer