Skip to content

Instantly share code, notes, and snippets.

@sthware
sthware / nn_from_scratch.py
Last active December 22, 2016 07:51
A partially-refactored, variable-name-expanded, heavily commented version of Britz's "Neural Network from scratch" code.
#!/usr/bin/env python
## NAME
## Neural Network from scratch
##
## DESCRIPTION
## A partially-refactored, variable-name-expanded, heavily commented version
## of Denny Britz's code. Original blog post:
## http://www.wildml.com/2015/09/implementing-a-neural-network-from-scratch/
##
@karpathy
karpathy / min-char-rnn.py
Last active May 6, 2024 16:42
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)

Offline Python Package Install Notes

Two common cases which make the install of Python packages harder due to networking issues are: a) Install behind a Proxy b) Install without access to the internet

(a) Install behind a Proxy

In the case where the target machine connects to the internet over a network proxy, export the following environment vars, as appropriate - http_proxy and https_proxy. Eg:

@n3wtron
n3wtron / simple_mjpeg_streamer_http_server
Last active December 22, 2023 13:32
Simple Python Motion Jpeg (mjpeg server) from webcam. Using: OpenCV,BaseHTTPServer
#!/usr/bin/python
'''
Author: Igor Maculan - n3wtron@gmail.com
A Simple mjpg stream http server
'''
import cv2
import Image
import threading
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
from SocketServer import ThreadingMixIn