Skip to content

Instantly share code, notes, and snippets.

View matthiasplappert's full-sized avatar

Matthias Plappert matthiasplappert

View GitHub Profile
import numpy as np
import gym
env = gym.make('FetchReach-v0')
# Simply wrap the goal-based environment using FlattenDictWrapper
# and specify the keys that you would like to use.
env = gym.wrappers.FlattenDictWrapper(
env, dict_keys=['observation', 'desired_goal'])
import numpy as np
import gym
env = gym.make('FetchReach-v0')
obs = env.reset()
done = False
def policy(observation, desired_goal):
# Here you would implement your smarter policy. In this case,
@matthiasplappert
matthiasplappert / ddpg_train.py
Created March 22, 2016 19:02
A quick sketch of computing the gradient and updating the actor in the Deep DPG algorithm (Lillicrap et al., 2015)
from keras import backend as K
actor = None # the following code assumes that actor and critic are Graph networks
critic = None
action_input_name = 'input_action'
output_name = 'output'
batch_size = 64
# Temporarily connect to a large, combined model so that we can compute the gradient and monitor
# the performance of the actor as evaluated by the critic.
@matthiasplappert
matthiasplappert / ENV.md
Last active August 29, 2015 14:03 — forked from schickling/ENV.md

This script automatically sets up my vim environment on any machine. For example in a docker container or an EC2 instance.

Dependencies

  • wget
  • vim
  • git

Usage

@matthiasplappert
matthiasplappert / uikonf2014-slides.md
Last active November 28, 2018 13:04
UIKonf 2014 Slides

Keybase proof

I hereby claim:

  • I am matthiasplappert on github.
  • I am mplappert (https://keybase.io/mplappert) on keybase.
  • I have a public key whose fingerprint is BC81 5B1C 87B4 4B43 9C1D 3811 20F2 600F 217E C448

To claim this, I am signing this object:

@matthiasplappert
matthiasplappert / gist:9493050
Last active August 29, 2015 13:57
QuickLook Debugging for `UIView`
@interface UIView (MPAdditions)
@end
@implementation UIView (MPAdditions)
- (id)debugQuickLookObject {
if (self.bounds.size.width < 0.0f || self.bounds.size.height < 0.0f) {
return nil;
}
import java.io.File;
import java.io.IOException;
public final class Test {
private Test() {
}
public static void main(String[] args) {
try {
#!/bin/sh
java -classpath your/path/to/checkstyle/checkstyle-5.5/checkstyle-5.5-all.jar com.puppycrawl.tools.checkstyle.Main -c your/path/to/checkstyle_swt1.xml -r src/
menge = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
menge.each do |x|
if x != 0 then
menge.each do |y|
if y != 0 then
if ((x * y) % menge.length == 0) then
print x.to_s + " * " + y.to_s + " % " + menge.length.to_s + " = 0\n"
end
end
end