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
# toy example from https://www.kdnuggets.com/2017/04/simple-understand-gradient-descent-algorithm.html | |
import numpy as np | |
import random | |
import matplotlib.pyplot as plt | |
LEARNING_RATE_M = 1e-8 | |
LEARNING_RATE_B = 1e-2 | |
# sq ft , price |
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
0 - rwd:269.0, loss:-14.074104309082031 | |
1 - rwd:206.0, loss:7.945431232452393 | |
2 - rwd:236.0, loss:-2.8392391204833984 | |
3 - rwd:228.75, loss:-41.76856231689453 | |
4 - rwd:250.8, loss:-11.660385131835938 | |
5 - rwd:231.5, loss:11.052635192871094 | |
6 - rwd:217.14285714285714, loss:5.223728179931641 | |
7 - rwd:214.5, loss:-6.977025985717773 | |
8 - rwd:205.88888888888889, loss:-6.304763317108154 | |
9 - rwd:207.5, loss:-2.8461992740631104 |
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 | |
from keras.models import Sequential | |
from keras.callbacks import TensorBoard | |
from keras.layers import * | |
from keras.optimizers import * | |
N=10 | |
INPUT_LEN = 4 | |
OUTPUT_LEN = 2 |
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
# OpenGym MountainCar-v0 | |
# ------------------- | |
# | |
# This code demonstrates debugging of a basic Q-network (without target network) | |
# in an OpenGym MountainCar-v0 environment. | |
# | |
# Made as part of blog series Let's make a DQN, available at: | |
# https://jaromiru.com/2016/10/12/lets-make-a-dqn-debugging/ | |
# | |
# author: Jaromir Janisch, 2016 |
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
conda install -c anaconda numpy scipy pillow mpi4py | |
conda install -c conda-forge matplotlib | |
pip install tensorflow keras gym jupyter |
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
<?xml version="1.0"?> | |
<robot name="bot"> | |
<!-- colors ................................................................. --> | |
<material name="red"> | |
<color rgba="0.8 0 0 1"/> | |
</material> | |
<material name="green"> | |
<color rgba="0 0.8 0 0.75"/> |
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
[user] | |
name = Keith Gould | |
email = keithmgould@gmail.com | |
[core] | |
excludesfile = ~/.gitignore_global | |
[credential] | |
helper = osxkeychain | |
[alias] | |
b = branch | |
c = commit |
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
"------------------------------------ | |
" Look and Feel | |
"------------------------------------ | |
set guifont=Monaco:h11 | |
set background=dark | |
" show line numbers | |
set number | |
set ruler |
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 pdb | |
import gym | |
import numpy as np | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
from tensorflow.python.ops import random_ops | |
def _initializer(shape, dtype=tf.float32, partition_info=None): | |
return random_ops.random_normal(shape) |
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 datetime | |
import tensorflow as tf | |
class Policy(): | |
def __init__(self, session): | |
self.session = session | |
self.actions = tf.placeholder(tf.float32) | |
self.advantages = tf.placeholder(tf.float32) | |
self.observations = tf.placeholder(tf.float32, shape=[None, 4]) |
NewerOlder