Skip to content

Instantly share code, notes, and snippets.

⊂(´・◡・⊂ )∘˚˳°

Jason Tam JasonTam

⊂(´・◡・⊂ )∘˚˳°
Block or report user

Report or block JasonTam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
carlthome / tfcompile.ipynb
Last active Sep 4, 2019
Example of how to use XLA AOT via tfcompile to build a Keras model into a shared library.
View tfcompile.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
caraboides /
Last active Aug 29, 2019
Simple script to backup MongoDB to S3, without waste diskspace for temp files. And a way to restore from the latest snapshot.
set -e
S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz
/usr/bin/aws s3 mb $S3PATH
eladnava /
Last active Sep 19, 2019
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
# Make sure to:
# 1) Name this file `` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x
# 7) Test it out via ./
wpm /
Last active Dec 3, 2018
A simple example of how to integrate the Spark parallel computing framework and the scikit-learn machine learning toolkit. This script randomly generates test and train data sets, trains an ensemble of decision trees using boosting, and applies the ensemble to the test set. The ensemble training is done in parallel.
from pyspark import SparkContext
import numpy as np
from sklearn.cross_validation import train_test_split, Bootstrap
from sklearn.datasets import make_classification
from sklearn.metrics import accuracy_score
from sklearn.tree import DecisionTreeClassifier
def run(sc):
You can’t perform that action at this time.