This file contains hidden or 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
# Arbitary binary tree (integers) | |
### 1 | |
### 2 3 | |
### 6 4 5 | |
## {1:{"left":2,"right":{3:{"left":4,"right":5}}}} | |
## Goal: -> '{1:{left:2,right:{3:{left:4,right:5}}}}' | |
# 1 | |
# 2 3 | |
## '{1:{left:2,right:3}}' |
This file contains hidden or 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
// You can edit this code! | |
// Click here and start typing. | |
package main | |
import "fmt" | |
func main() { | |
fmt.Println("Hello, 世界") | |
f := who() | |
g := who() |
This file contains hidden or 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 foo(a, b): | |
"""Please document me. | |
What am I supposed to do? | |
Rename anything you see fit. | |
Also, I think I have bugs. Please debug me. | |
""" | |
bar = {} | |
for x in a: | |
bar[x] = True |
This file contains hidden or 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/sh | |
cli=/Applications/Karabiner.app/Contents/Library/bin/karabiner | |
$cli set general.dont_remap_internal 1 | |
/bin/echo -n . | |
$cli set remap.commandL2optionL 1 | |
/bin/echo -n . | |
$cli set general.dont_remap_apple_pointing 1 | |
/bin/echo -n . |
This file contains hidden or 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 gym | |
import numpy as np | |
from gym.wrappers.monitoring import Monitor | |
env = gym.make('CartPole-v0') | |
env = Monitor(env, 'tmp/cart-pole-hill-climb-1', force=True) | |
print("Action space: {0}".format(env.action_space)) | |
print("Observation space: {0}\n\tLow: {1}\n\tHigh: {2}".format( | |
env.observation_space, |
This file contains hidden or 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 gym | |
import numpy as np | |
from gym.wrappers.monitoring import Monitor | |
env = gym.make('CartPole-v0') | |
env = Monitor(env, 'tmp/cart-pole-hill-climb-2', force=True) | |
print("Action space: {0}".format(env.action_space)) | |
print("Observation space: {0}\n\tLow: {1}\n\tHigh: {2}".format( | |
env.observation_space, |
This file contains hidden or 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 gym | |
import numpy as np | |
from gym.wrappers.monitoring import Monitor | |
MC_POLICY_EVAL_EP = 10 | |
BASE_NOISE_FACTOR = 0.5 | |
NUM_POLICY_EVAL = 500 | |
env = gym.make('CartPole-v0') |
This file contains hidden or 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 gym | |
import numpy as np | |
from gym.wrappers.monitoring import Monitor | |
MC_POLICY_EVAL_EP = 10 | |
BASE_NOISE_FACTOR = 0.1 | |
NUM_POLICY_EVAL = 500 | |
env = gym.make('CartPole-v0') | |
env = Monitor(env, 'tmp/cart-pole-hill-climb-4', force=True) |
This file contains hidden or 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
# Source: http://rl-gym-doc.s3-website-us-west-2.amazonaws.com/mlss/lab1.html | |
import gym | |
import numpy as np | |
from gym.spaces import Discrete, Box | |
from gym.wrappers.monitoring import Monitor | |
# ================================================================ | |
# Policies | |
# ================================================================ |
This file contains hidden or 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
# Source: http://rl-gym-doc.s3-website-us-west-2.amazonaws.com/mlss/lab1.html | |
import gym | |
import numpy as np | |
from gym.spaces import Discrete, Box | |
from gym.wrappers.monitoring import Monitor | |
# ================================================================ | |
# Policies | |
# ================================================================ |