Skip to content

Instantly share code, notes, and snippets.

View EricSchles's full-sized avatar

Eric Schles EricSchles

View GitHub Profile
import sys
from PIL import Image, ImageDraw
try:
import cv
except ImportError:
print 'Could not import cv, trying opencv'
import opencv.cv as cv
<!doctype html>
<html>
<script src="http://cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js"></script>
<script src="http://cdn.jsdelivr.net/syncanojs/3.1.3beta/syncano.min.js"></script>
<script src="http://cdn.jsdelivr.net/jquery/2.1.1/jquery.min.js"></script>
<head></head>
<body>
@EricSchles
EricSchles / solver.py
Created June 10, 2018 03:04 — forked from dutc/solver.py
code improvement exercise: solver.py
from numpy.random import random
from numpy import array, isclose, zeros_like, sign
from numpy.linalg import lstsq
def solve(func, values, atol=0.1):
while True:
result = func(values)
if isclose(result, 0, atol=atol):
break
values -= sign(result) * random(values.size)
@EricSchles
EricSchles / poormansdag.ipynb
Created July 18, 2018 19:49 — forked from mariusvniekerk/poormansdag.ipynb
How to make a simple task execution engine in basically no code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@EricSchles
EricSchles / poormansdag.ipynb
Created July 18, 2018 19:49 — forked from mariusvniekerk/poormansdag.ipynb
How to make a simple task execution engine in basically no code
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@EricSchles
EricSchles / Output
Created April 15, 2019 20:31 — forked from macournoyer/Output
A Neural Network framework in 25 LOC
$ python xor.py
Training:
Epoch 0 MSE: 1.765
Epoch 100 MSE: 0.015
Epoch 200 MSE: 0.005
* Target MSE reached *
Evaluating:
1 XOR 0 = 1 ( 0.904) Error: 0.096
0 XOR 1 = 1 ( 0.908) Error: 0.092
1 XOR 1 = 0 (-0.008) Error: 0.008