Skip to content

Instantly share code, notes, and snippets.

View kevashcraft's full-sized avatar

Kevin Ashcraft kevashcraft

View GitHub Profile
@davidthewatson
davidthewatson / precise_crouton_i3.sh
Created December 9, 2015 19:11
Install Ubuntu Precise on Chromebook, crouton, with i3
wget -O ~/Downloads/crouton http://goo.gl/fd3zc
sudo sh -e ~/Downloads/crouton -t x11,audio,keyboard,extension -n i3precise
sudo enter-chroot -n i3precise
sudo apt-get install i3
echo "exec i3" > ~/.xinitrc
sudo apt-get install git vim python python-pip python-dev python-software-properties sshfs
sudo pip install virtualenv virtualenvwrapper
@jakebellacera
jakebellacera / multiple-gulp-streams.js
Created May 1, 2015 02:25
How to run multiple streams in a single gulp task.
var es = require("event-stream");
var gulp = require("gulp");
// Important! If these tasks need to be ran sequentially, then specify the
// task(s) that need to be ran prior to these ones as a dependency.
gulp.task("move-files", function() {
return es.merge([
gulp.src("foo").pipe(gulp.dest("dist/")),
gulp.src("bar").pipe(gulp.dest("dist/")),
gulp.src("baz").pipe(gulp.dest("dist/")),
@damienpontifex
damienpontifex / tf-experiment-template.py
Last active March 9, 2021 09:43
A template for a custom tensorflow estimator and experiment with python3 typings for desired parameter types
import argparse
import psutil
import tensorflow as tf
from typing import Dict, Any, Callable, Tuple
## Data Input Function
def data_input_fn(data_param,
batch_size:int=None,
shuffle=False) -> Callable[[], Tuple]:
"""Return the input function to get the test data.
@amatellanes
amatellanes / sublime.sh
Last active October 26, 2021 20:34
Install Sublime Text 3 on Ubuntu 14.04 LTS (Trusty Tahr)
sudo add-apt-repository ppa:webupd8team/sublime-text-3;
sudo apt-get update;
sudo apt-get install sublime-text-installer;
sudo ln -s /usr/lib/sublime-text-3/sublime_text /usr/local/bin/sublime;
@ilblackdragon
ilblackdragon / seq2seq.py
Last active May 22, 2022 21:42
Example of Seq2Seq with Attention using all the latest APIs
import logging
import numpy as np
import tensorflow as tf
from tensorflow.contrib import layers
GO_TOKEN = 0
END_TOKEN = 1
UNK_TOKEN = 2
@koaning
koaning / tf.py
Created March 9, 2017 16:13
tensorflow layer example
import tensorflow as tf
import numpy as np
import uuid
x = tf.placeholder(shape=[None, 3], dtype=tf.float32)
nn = tf.layers.dense(x, 3, activation=tf.nn.sigmoid)
nn = tf.layers.dense(nn, 5, activation=tf.nn.sigmoid)
encoded = tf.layers.dense(nn, 2, activation=tf.nn.sigmoid)
nn = tf.layers.dense(encoded, 5, activation=tf.nn.sigmoid)
nn = tf.layers.dense(nn, 3, activation=tf.nn.sigmoid)
@keeferrourke
keeferrourke / install-google-fonts.sh
Last active May 22, 2023 12:38
A bash script to install all Google Fonts, system wide, on debian based systems (ex. Ubuntu)
#!/bin/sh
# Written by: Keefer Rourke <https://krourke.org>
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git>
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git
sudo apt-get install fonts-cantarell ttf-ubuntu-font-family git
srcdir="/tmp/google-fonts"
pkgdir="/usr/share/fonts/truetype/google-fonts"
giturl="git://github.com/google/fonts.git"
@siemanko
siemanko / tf_lstm.py
Last active July 26, 2023 06:57
Simple implementation of LSTM in Tensorflow in 50 lines (+ 130 lines of data generation and comments)
"""Short and sweet LSTM implementation in Tensorflow.
Motivation:
When Tensorflow was released, adding RNNs was a bit of a hack - it required
building separate graphs for every number of timesteps and was a bit obscure
to use. Since then TF devs added things like `dynamic_rnn`, `scan` and `map_fn`.
Currently the APIs are decent, but all the tutorials that I am aware of are not
making the best use of the new APIs.
Advantages of this implementation: