View a3c_test.py
import tensorflow as tf | |
from tensorflow.contrib import distributions | |
# These are your input features, a random tensor. | |
# There are 128 examples per batch, 1000 time-steps, one observation. | |
# If your code doesn't use batches, remove the first dimension. | |
features = tf.random_normal([128, 1000, 1]) | |
# Put your networks here | |
# policy_mu, policy_sigma = ... |
View a3c.py
import numpy as np | |
import scipy.signal | |
import tensorflow as tf | |
import tensorify | |
@tensorify.tensorflow_op(tf.float32) | |
def discount(x, gamma=1.0, axis=0): | |
y = scipy.signal.lfilter([1], [1, -gamma], x[::-1], axis=axis)[::-1] | |
return y.astype(np.float32) |
View add_name_scope.py
"""Decorators that make TensorFlow programming a bit easier. | |
Quim Llimona, 2017. | |
""" | |
import functools | |
import tensorflow as tf | |
def add_name_scope(name=None): | |
"""Creates a name_scope that contains all ops created by the function. |
View setup.sh
#/bin/bash | |
git clone https://github.com/lemonzi/sphero-osc | |
cd sphero-osc | |
npm install | |
# This is for running it | |
node . |