One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
""" | |
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) |
% 1. Title: Iris Plants Database | |
% | |
% 2. Sources: | |
% (a) Creator: R.A. Fisher | |
% (b) Donor: Michael Marshall (MARSHALL%PLU@io.arc.nasa.gov) | |
% (c) Date: July, 1988 | |
% | |
% 3. Past Usage: | |
% - Publications: too many to mention!!! Here are a few. | |
% 1. Fisher,R.A. "The use of multiple measurements in taxonomic problems" |
# coding=utf8 | |
import PIL | |
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
def text2png(text, fullpath, color = "#000", bgcolor = "#FFF", fontfullpath = None, fontsize = 13, leftpadding = 3, rightpadding = 3, width = 200): | |
REPLACEMENT_CHARACTER = u'\uFFFD' | |
NEWLINE_REPLACEMENT_STRING = ' ' + REPLACEMENT_CHARACTER + ' ' |
from bs4 import BeautifulSoup as bs | |
from pyquery import PyQuery as pq | |
from lxml.html import fromstring | |
import re | |
import requests | |
import time | |
def Timer(): |
""" | |
Use a Counter to find the most common words in "The Wonderful Wizard of Oz" by | |
L. Frank Baum. | |
Available in (mostly) plain text at: | |
https://archive.org/stream/wonderfulwizardo00baumiala/wonderfulwizardo00baumiala_djvu.txt | |
Note: This code also counts the words in the header, so it's not a *realistic* | |
applicaton, but more of a demonstration of python's Counter. |
import tensorflow as tf | |
import numpy as np | |
corpus_raw = 'He is the king . The king is royal . She is the royal queen ' | |
# convert to lower case | |
corpus_raw = corpus_raw.lower() | |
words = [] | |
for word in corpus_raw.split(): |
def sigmoid(X): | |
'''Compute the sigmoid function ''' | |
#d = zeros(shape=(X.shape)) | |
den = 1.0 + e ** (-1.0 * X) | |
d = 1.0 / den | |
return d |