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
def main(): | |
"""Run PPO until the environment throws an exception.""" | |
config = tf.ConfigProto() | |
config.gpu_options.allow_growth = True # pylint: disable=E1101 | |
with tf.Session(config=config): | |
# Take more timesteps than we need to be sure that | |
# we stop due to an exception. | |
ppo2.learn(policy=policies.CnnPolicy, | |
env=DummyVecEnv([make_env]), | |
nsteps=4096, |
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
TF_BUILD_INFO = {container_type: "cpu", command: "bazel build -c opt --jobs 1 --local_resources 2048,0.5,1.0 --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-mavx2 --copt=-mfma tensorflow/tools/pip_package:build_pip_package", source_HEAD: "d4c31b59469fa0e5ebad3408353e7d7476842734", source_remote_origin: "https://github.com/tensorflow/tensorflow.git", OS: "Linux", kernel: "4.9.87-linuxkit-aufs", architecture: "x86_64", processor: "Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz", processor_count: "4", memory_total: "2046660 kB", swap_total: "1048572 kB", Bazel_version: "Build label: 0.12.0", Java_version: "1.8.0_162", Python_version: "2.7.12", gpp_version: "g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609", swig_version: "", NVIDIA_driver_version: "", CUDA_device_count: "0", CUDA_device_names: "", CUDA_toolkit_version: ""} | |
Loading: | |
Loading: 0 packages loaded | |
Loading: 0 packages loaded | |
currently loading: tensorflow/tools/pip_package | |
Analyzing: target //tensorflow/tools/pip_package:build_pip_package (3 packages load |
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
TF_BUILD_INFO = {container_type: "cpu", command: "bazel build -c opt --jobs 1 --local_resources 2048,0.5,1.0 --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 --copt=-mavx2 --copt=-mfma tensorflow/tools/pip_package:build_pip_package", source_HEAD: "d4c31b59469fa0e5ebad3408353e7d7476842734", source_remote_origin: "https://github.com/tensorflow/tensorflow.git", OS: "Linux", kernel: "4.9.87-linuxkit-aufs", architecture: "x86_64", processor: "Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz", processor_count: "4", memory_total: "2046660 kB", swap_total: "1048572 kB", Bazel_version: "Build label: 0.12.0", Java_version: "1.8.0_162", Python_version: "2.7.12", gpp_version: "g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609", swig_version: "", NVIDIA_driver_version: "", CUDA_device_count: "0", CUDA_device_names: "", CUDA_toolkit_version: ""} | |
Loading: | |
Loading: 0 packages loaded | |
Loading: 0 packages loaded | |
currently loading: tensorflow/tools/pip_package | |
Analyzing: target //tensorflow/tools/pip_package:build_pip_package (3 packages load |
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
FROM openai/retro-agent:tensorflow | |
# Needed for OpenCV. | |
RUN apt-get update && \ | |
apt-get install -y libgtk2.0-dev && \ | |
rm -rf /var/lib/apt/lists/* | |
# --- running from https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/docker/Dockerfile.devel | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential \ | |
curl \ |
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
exports.handler = function(context, event, callback) { | |
var SquareConnect = require('square-connect'); | |
var Twilio = require('twilio'); | |
var accessToken = context.accessToken; | |
var locationId = context.locationId; | |
var messageBody = event.message; | |
var number = event.number; | |
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
export TAG_NAME=jerk-agent:v7 | |
export DOCKER_REGISTRY="retrocontestxxx.azurecr.io" | |
docker login $DOCKER_REGISTRY \ | |
--username "retrocontestxxx" \ | |
--password "xxx"&& | |
docker build -f jerk-agent.docker -t $DOCKER_REGISTRY/$TAG_NAME . && | |
retro-contest run --agent $DOCKER_REGISTRY/$TAG_NAME \ |
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/env python | |
""" | |
A scripted agent called "Just Enough Retained Knowledge". | |
""" | |
import random | |
import gym | |
import numpy as np |
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
def best_sequence(self): | |
""" | |
Get the prefix of the trajectory with the best | |
cumulative reward. | |
""" | |
max_cumulative = max(self.reward_history) | |
for i, rew in enumerate(self.reward_history): | |
if rew == max_cumulative: | |
return self.action_history[:i+1] | |
raise RuntimeError('unreachable') |
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
checkoutApi.createCheckout(locationId, checkoutRequest).then(function(data) { | |
let twiml = new Twilio.twiml.MessagingResponse(); | |
twiml.message('Awe-some! finish up checking out here: '+ data.checkout.checkout_page_url); | |
callback(null, twiml); | |
} |
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
export TAG_NAME=$1 | |
export DOCKER_REGISTRY="retrocontestxxx.azurecr.io" | |
git add jerk_agent.py | |
git commit -m "running $TAG_NAME locally" | |
mkdir results/${TAG_NAME//:} | |
cp jerk_agent.py results/${TAG_NAME//:}/jerk_agent.py |