No plugins needed!
I hereby claim:
- I am danijar on github.
- I am danijar (https://keybase.io/danijar) on keybase.
- I have a public key whose fingerprint is 2907 D9B0 3FDD 28B2 6FBB 41B7 E4EB 8875 D9AB FF13
To claim this, I am signing this object:
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 tensorflow as tf | |
import matplotlib.pyplot as plt | |
def gaussian_blur(image, diameter): | |
padding = [[0, 0]] + [[(diameter) // 2, (diameter - 1) // 2]] * 2 + [[0, 0]] | |
diameter = tf.to_float(diameter) | |
filter_ = tf.range(-(diameter - 1) // 2, (diameter - 1) // 2 + 1) | |
filter_ = tf.exp(-0.5 * filter_ ** 2 / (diameter / 4) ** 2) # 2 stds. |
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 argparse | |
import os | |
import agents | |
import gym | |
import gym.spaces | |
import numpy as np | |
import tensorflow as tf | |
from dm_control import suite # Must be imported after TensorFlow. |
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
# Full example for my blog post at: | |
# https://danijar.com/building-variational-auto-encoders-in-tensorflow/ | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import tensorflow as tf | |
from tensorflow.examples.tutorials.mnist import input_data | |
tfd = tf.contrib.distributions |
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 minitaur_config(): | |
# General | |
algorithm = ppo.PPOAlgorithm | |
num_agents = 10 | |
eval_episodes = 30 | |
use_gpu = False | |
# Environment | |
env = 'MinitaurBulletEnv-v0' | |
max_length = 1000 | |
steps = 1e7 # 10M |
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
python -c "import gym,time;d=10000;e=gym.make('Ant-v1');s=time.time();e.reset();[e.reset() if e.step(e.action_space.sample())[2] else 0 for _ in range(d)];print(d/(time.time()-s),'FPS')" |
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 division | |
from __future__ import print_function | |
import numpy as np | |
import tensorflow as tf | |
class GRU(tf.contrib.rnn.RNNCell): |
NewerOlder