Skip to content

Instantly share code, notes, and snippets.

View RyotaBannai's full-sized avatar
🛴
Man's soil is still rich enough to direct his own life.

Ryota Bannai RyotaBannai

🛴
Man's soil is still rich enough to direct his own life.
View GitHub Profile
@RyotaBannai
RyotaBannai / mlp.py
Last active February 5, 2019 04:34 — forked from miloharper/main.py
A two layer neural network written in Python, which trains itself to solve a variation of the XOR problem.
from numpy import exp, array, random, dot, reshape
from autograd import grad
class NeuronLayer():
def __init__(self, neuron_n, inputs_n):
self.weights = 2 * random.random((inputs_n, neuron_n)) - 1
class NeuralNetwork():
def __init__(self, layer1, layer2):
self.layer1 = layer1