start new:
tmux
start new with session name:
tmux new -s myname
# Example Huffman coding implementation | |
# Distributions are represented as dictionaries of { 'symbol': probability } | |
# Codes are dictionaries too: { 'symbol': 'codeword' } | |
def huffman(p): | |
'''Return a Huffman code for an ensemble with distribution p.''' | |
assert(sum(p.values()) == 1.0) # Ensure probabilities sum to 1 | |
# Base case of only two symbols, assign 0 or 1 arbitrarily | |
if(len(p) == 2): |
""" | |
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) |
""" | |
Author: Shubhanshu Mishra | |
Posted this on the keras issue tracker at: https://github.com/fchollet/keras/issues/108 | |
Implementing a linear regression using Keras. | |
""" | |
from keras.models import Sequential | |
from keras.layers.core import Dense, Activation | |
model = Sequential() |
from turtle import Turtle | |
from random import randint | |
grass = Turtle() | |
grass.color('#007b0c') | |
sky = Turtle() | |
sky.color('#e5e5ff') | |
sky.pensize(100) | |
sky.speed(0) |