Skip to content

Instantly share code, notes, and snippets.

View sdwfrost's full-sized avatar

Simon Frost sdwfrost

View GitHub Profile
@sdwfrost
sdwfrost / git_create_orphan.sh
Created November 28, 2016 10:13 — forked from seanbuscay/git_create_orphan.sh
Create an orphan branch in a repo.
cd repository
git checkout --orphan orphan_name
git rm -rf .
rm '.gitignore'
echo "#Title of Readme" > README.md
git add README.md
git commit -a -m "Initial Commit"
git push origin orphan_name
@sdwfrost
sdwfrost / neighbor-joining-experiments.ipynb
Created January 20, 2017 13:32 — forked from gregcaporaso/neighbor-joining-experiments.ipynb
initial experiments with implementing neighbor joining for scikit-bio
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sdwfrost
sdwfrost / ebov_tmrca.ipynb
Created February 17, 2017 10:51
TMRCA analysis of BEAST EBOV trees from Dudas et al.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sdwfrost
sdwfrost / color-turtles.js
Created April 24, 2017 07:54
Tweaking turtles.js example from asx
// Import the lib/ mmodules via relative paths
const Color = AS.Color
const ColorMap = AS.ColorMap
// import Color from '../../src/Color.js'
// import DataSet from '../../src/DataSet.js'
// import Mouse from '../../src/Mouse.js'
const Model = AS.Model
const util = AS.util
const modules = {Color, ColorMap, Model, util }
"""
This is a batched LSTM forward and backward pass
"""
import numpy as np
import code
class LSTM:
@staticmethod
def init(input_size, hidden_size, fancy_forget_bias_init = 3):
@sdwfrost
sdwfrost / batch-lstm.R
Created May 17, 2017 11:53 — forked from georgeblck/batch-lstm.R
An efficient, batched LSTM in R
###
### This is a batched LSTM forward and backward pass. Written by Andrej Karpathy (@karpathy)
### BSD License
### Re-written in R by @georgeblck
###
rm(list=ls(all=TRUE))
LSTM.init <- function(input_size, hidden_size, fancy_forget_bias_init = 3){
# Initialize parameters of the LSTM (both weights and biases in one matrix)
@sdwfrost
sdwfrost / lstm.py
Created May 17, 2017 11:54 — forked from pranv/lstm.py
An Efficient, Batched, Stateful LSTM layer in Numpy
import numpy as np
from utils import orthogonal, tanh, sigmoid, dtanh, dsigmoid
class LSTM(object):
"""Long Short Term Memory Unit
Parameters
----------
# Example for my blog post at:
# https://danijar.com/introduction-to-recurrent-networks-in-tensorflow/
import functools
import sets
import tensorflow as tf
def lazy_property(function):
attribute = '_' + function.__name__
@sdwfrost
sdwfrost / morris-lecar.ipynb
Created November 7, 2017 19:36
Simulation of a stochastic Morris-Lecar model
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sdwfrost
sdwfrost / pomp_integrator.ipynb
Created November 29, 2017 13:19
Discrete SIR model using the DiffEq integrator interface
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.