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
# Reservoir computing character prediction text generator | |
# Perturb a dynamic reservoir with character inputs, predict next character with linear classifier | |
# ________ | |
# | | | |
# V | random connections with some sparsity | |
#input--->o--->o--->o | | |
# | | | | | |
# V V V | | |
# o--->o--->o-- | |
# | | | |
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 matplotlib import pyplot as plt | |
import matplotlib as mpl | |
import numpy as np | |
def roulette(maxBet,startBet,startCash,betMulti,goalCash,myIt): | |
# My buddy assures me this is a sure thing . . . | |
# maxBet - maximum allowed bet | |
# startCash- your principal | |
# betMulti - mulyiply your bet X this amount if unsuccessful | |
# goalCash - how much you want to leave the table with |
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
# Training a neural XOR circuit | |
# In Marvin Minsky Seymour Papert's in/famous critique of perceptrons () published in 1969, they argued that neural networks | |
# had extremely limited utility, proving that the perceptrons of the time could not even learn | |
# the exclusive OR function. This played some role | |
# Now we can easily teach a neural network an XOR function by incorporating more layers. | |
# Truth table: | |
# Input | Output | |
# 00 | 0 | |
# 01 | 1 | |
# 10 | 1 |
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 matplotlib.pyplot as plt | |
def draw_neural_net(ax, left, right, bottom, top, layer_sizes,Theta0,Theta1): | |
''' | |
Public Gist from craffel | |
https://gist.github.com/craffel/2d727968c3aaebd10359 | |
Draw a neural network cartoon using matplotilb. | |
I (theScinder) modified the function to accept neural network weights and adjust connection line widths accordingly, in order to create an animation of NN learning |