Skip to content

Instantly share code, notes, and snippets.

View danijar's full-sized avatar

Danijar Hafner danijar

View GitHub Profile
@danijar
danijar / agents_on_dm_control.py
Last active January 3, 2022 14:18
Training TensorFlow Agents PPO on dm_control environments.
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.
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.

Keybase proof

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:

@danijar
danijar / !seamless_focus_movement.md
Last active June 29, 2022 23:36
Seamless focus switching between Vim splits, Vim tabs, and Tmux panes.

No plugins needed!