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 | |
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 = ... |
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 | |
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) |
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
"""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. |
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
#/bin/bash | |
git clone https://github.com/lemonzi/sphero-osc | |
cd sphero-osc | |
npm install | |
# This is for running it | |
node . |