Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
import pyeliza | |
class Eliza: | |
aliases = 'eliza' | |
description = 'Virtual therapist' | |
_therapist = pyeliza.eliza() | |
def execute(self, expression, context): | |
''' | |
>>> from mock import Mock |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
module HMM | |
using Distributions | |
import Distributions.rand | |
import Distributions.fit | |
immutable HiddenMarkovModel{TP, K} | |
theta::Vector{TP} | |
A::Matrix{Float64} |
# Copyright (C) 2013 Istituto per l'Interscambio Scientifico I.S.I. | |
# You can contact us by email ([email protected]) or write to: | |
# ISI Foundation, Via Alassio 11/c, 10126 Torino, Italy. | |
# | |
# This work is licensed under a Creative Commons 4.0 | |
# Attribution-NonCommercial-ShareAlike License | |
# You may obtain a copy of the License at | |
# http://creativecommons.org/licenses/by-nc-sa/4.0/ | |
# | |
# This program was written by Andre Panisson <[email protected]> at |
# Complex transforms | |
# Sign argument | |
# -1 = Complex to Complex reverse FFT | |
# 1 = Complex to Complex forward FFT | |
# ffts_plan_t *ffts_init_1d(size_t N, int sign); | |
# Create a plan for a forward 1D FFT of size 16 | |
N = 2^16 | |
Direction = 1 | |
ffts_plan = ccall((:ffts_init_1d, "libffts"), Ptr{Void}, (Csize_t, Cint), N, Direction) |
""" | |
A deep neural network with or w/o dropout in one file. | |
License: Do What The Fuck You Want to Public License http://www.wtfpl.net/ | |
""" | |
import numpy, theano, sys, math | |
from theano import tensor as T | |
from theano import shared | |
from theano.tensor.shared_randomstreams import RandomStreams |
import theano | |
import theano.tensor as T | |
import numpy as np | |
import cPickle | |
import random | |
import matplotlib.pyplot as plt | |
class RNN(object): | |
def __init__(self, nin, n_hidden, nout): |
The idea is based on a gist by @jimbojsb.
You can use Pygments or Highlight.
brew install python
# Authors: Kyle Kastner | |
# License: BSD 3-clause | |
import theano.tensor as T | |
import numpy as np | |
import theano | |
class rmsprop(object): | |
""" | |
RMSProp with nesterov momentum and gradient rescaling |
# Stacked LSTMs | |
# Author: Kyle Kastner | |
# Based on script from /u/siblbombs | |
# License: BSD 3-Clause | |
import tensorflow as tf | |
from tensorflow.models.rnn import rnn | |
from tensorflow.models.rnn.rnn_cell import LSTMCell | |
import numpy as np | |
import time |