Skip to content

Instantly share code, notes, and snippets.

View danielstockton's full-sized avatar

Daniel Stockton danielstockton

View GitHub Profile
@fprieur
fprieur / autoreload-Gunicorn
Last active April 16, 2023 14:28
Auto Reload Gunicorn On File Change Event
pip install watchdog -U
# now there is a command called "watchmedo", you'll like it...
# in terminal #1, run:
gunicorn app:myapp --pid=gunicorn.pid
# in terminal #2, run:
watchmedo shell-command \
--patterns="*.py;*.html;*.css;*.js" \
--recursive \
@ntavish
ntavish / nn.py
Created July 15, 2011 18:15
Neural network demo
#!/usr/bin/python
# Back-Propagation Neural Networks
#
# Written in Python. See http://www.python.org/
# Placed in the public domain.
# Neil Schemenauer <nas@arctrix.com>
#
# Changes:
# 2009-01-30 Fix dsigmoid() to use correct derivative rather than an
# approximation. Suggested by Andrew Lionel Blais.
@yogthos
yogthos / gist:898782
Created April 1, 2011 20:22
backprapagation neural net
(ns nn)
(defstruct network :ai :ah :ao :wi :wo :ci :co)
(defn rand-in-range [a b]
(+ (* (- b a) (rand)) a))
(defn make-matrix
([i j] (make-matrix i j 0.0))
([i j fill] (repeat i (repeat j fill))))