Skip to content

Instantly share code, notes, and snippets.

View tyliec's full-sized avatar
:octocat:
"furiously typing on keyboard"

Tyler Chong tyliec

:octocat:
"furiously typing on keyboard"
View GitHub Profile
@tyliec
tyliec / perceptron.py
Created February 7, 2019 22:53 — forked from Thomascountz/perceptron.py
Perceptron in Python v.1
import numpy as np
class Perceptron(object):
def __init__(self, no_of_inputs, threshold=100, learning_rate=0.01):
self.threshold = threshold
self.learning_rate = learning_rate
self.weights = np.zeros(no_of_inputs + 1)
def predict(self, inputs):