This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' Dumps the location ids in a sorted set ''' | |
import redis | |
import sys | |
def dump(key, redis_host, redis_port=6379): | |
rconn = redis.StrictRedis(redis_host, port=redis_port) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' Pretty prints an xml file. | |
Usage: | |
python prettyxml.py [filename.xml] | |
or | |
cat filename.xml | python prettyxml.py | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
#sudo apt-get install --yes autoconf | |
WORKING_DIR=`pwd` | |
LIBLBFGS_GIT=https://github.com/chokkan/liblbfgs.git | |
LIBLBFGS_SRC_DIR=./liblbfgs/ | |
LIBLBFGS_INSTALL_DIR=$WORKING_DIR/local/lbfgs/ | |
CRFSUITE_GIT=https://github.com/chokkan/crfsuite.git | |
CRFSUITE_SRC_DIR=./crfsuite/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- takes the leftmost 16 hex-characters of the md5 hash of foo, converts it to base-10, and casts it to a 64-bit number | |
-- Note: this decreases the possible space of hashes! | |
SELECT CAST(conv(substring(md5("foo"), 0, 16), 16, 10) AS BIGINT)"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://databricks.com/session/locality-sensitive-hashing-by-spark | |
https://databricks.com/blog/2017/05/09/detecting-abuse-scale-locality-sensitive-hashing-uber-engineering.html | |
https://github.com/apache/spark/blob/v2.3.0/examples/src/main/python/ml/min_hash_lsh_example.py | |
pip install -u pyspark | |
git clone https://github.com/apache/spark | |
cd spark | |
git checkout v2.3.0 | |
spark-submit --master='local[*]' --driver-memory=4g examples/src/main/python/ml/min_hash_lsh_example.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' MultiLabel classifier example using Keras + Tensorflow. | |
Based on | |
* https://www.depends-on-the-definition.com/guide-to-multi-label-classification-with-neural-networks/ | |
* https://www.depends-on-the-definition.com/classifying-genres-of-movies-by-looking-at-the-poster-a-neural-approach/ | |
* https://keras.io/getting-started/sequential-model-guide/#examples | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
# Insert a USB key. | |
# if needed initialize it with MS/DOS FAT and MBR | |
# Download the Mint ISO image | |
# Convert the ISO -> IMG | |
hdiutil convert -format UDRW -o linuxmint-17.3-cinnamon-64bit linuxmint-17.3-cinnamon-64bit.iso | |
# Run a diskutil list to know the device for the USB key, e.g.: /dev/disk3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#remove old | |
sudo apt-get remove docker docker-engine docker.io | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" |