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
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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
# derivs | |
# cross entropy -1/p deriv of -log(p) | |
# softmax | |
# p * (1 - p) if i == j if this is the node we picked | |
# -p * p if i != j otherwise | |
# | |
# chain rule for both functions dsoftmax * dcross_entropy | |
# p * (1 - p) * (-1/p) = p - 1 | |
# -p * p * (-1/p) = p |
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
""" | |
This script runs a policy gradient algorithm | |
""" | |
from gym.envs import make | |
from modular_rl import * | |
import argparse, sys, cPickle | |
from tabulate import tabulate | |
import shutil, os, logging | |
import gym |
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
""" | |
This script runs a policy gradient algorithm | |
""" | |
from gym.envs import make | |
from modular_rl import * | |
import argparse, sys, cPickle | |
from tabulate import tabulate | |
import shutil, os, logging | |
import gym |
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
[ignore] | |
.*/node_modules/fbjs/.* | |
[include] | |
[libs] | |
[options] | |
module.name_mapper.extension='css' -> '<PROJECT_ROOT>/flow/CSSModule.js.flow' | |
module.name_mapper.extension='styl' -> '<PROJECT_ROOT>/flow/CSSModule.js.flow' |
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
[2016-06-25 11:30:22,674] Creating monitor directory /tmp/tmp_EkGLw/monitor | |
[2016-06-25 11:30:22,924] Starting new video recorder writing to /tmp/tmp_EkGLw/monitor/openaigym.video.0.22978.video000000.mp4 | |
[2016-06-25 11:30:22,932] Starting new video recorder writing to /tmp/tmp_EkGLw/monitor/openaigym.video.1.22978.video000000.mp4 | |
[2016-06-25 11:30:22,934] Starting new video recorder writing to /tmp/tmp_EkGLw/monitor/openaigym.video.2.22978.video000000.mp4 | |
[2016-06-25 11:30:22,940] Starting new video recorder writing to /tmp/tmp_EkGLw/monitor/openaigym.video.3.22978.video000000.mp4 | |
[xcb] Unknown request in queue while dequeuing | |
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called | |
[xcb] Aborting, sorry about that. | |
python: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed. | |
[1] 22978 abort (core dumped) python examples/run_a3c.py --name Acrobot-v0 --learning_rate 0.05 4 |
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
from __future__ import absolute_import | |
from __future__ import print_function | |
from __future__ import absolute_import | |
import warnings | |
from skimage.color import rgb2gray | |
from skimage.transform import resize | |
from skimage import img_as_ubyte |
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
Determining if the pthread_create exist failed with the following output: | |
Change Dir: /home/dom/src/ViZDoom/CMakeFiles/CMakeTmp | |
Run Build Command:"/usr/bin/make" "cmTC_0b041/fast" | |
/usr/bin/make -f CMakeFiles/cmTC_0b041.dir/build.make CMakeFiles/cmTC_0b041.dir/build | |
make[1]: Entering directory '/home/dom/src/ViZDoom/CMakeFiles/CMakeTmp' | |
Building C object CMakeFiles/cmTC_0b041.dir/CheckSymbolExists.c.o | |
/usr/bin/cc -o CMakeFiles/cmTC_0b041.dir/CheckSymbolExists.c.o -c /home/dom/src/ViZDoom/CMakeFiles/CMakeTmp/CheckSymbolExists.c | |
Linking C executable cmTC_0b041 | |
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0b041.dir/link.txt --verbose=1 |
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 tensorflow as tf | |
def main(): | |
files = ['model-' + str(x) for x in range(20000, 70000, 10000)] | |
for f in files: | |
with tf.Graph().as_default(): | |
sess = tf.Session() | |
saver = tf.train.import_meta_graph('./test_graph_size/' + f + '.meta') | |
saver.restore(sess, './test_graph_size/' + f) | |
print(sess.graph_def.ByteSize()) |
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
def rgb2y_resize(input_shape, new_height, new_width, session): | |
img = tf.placeholder(tf.float32, shape=input_shape) | |
reshaped = tf.reshape(img, [1] + list(input_shape)) | |
rgb2y = tf.image.rgb_to_grayscale(reshaped) | |
bilinear = tf.image.resize_bilinear(rgb2y, [new_height, new_width]) | |
squeezed = tf.squeeze(bilinear) | |
return lambda x: session.run(squeezed, feed_dict={img: x}) |