Skip to content

Instantly share code, notes, and snippets.

View xiandong79's full-sized avatar
🎯
Focusing

James Harden xiandong79

🎯
Focusing
View GitHub Profile
@javierluraschi
javierluraschi / using-tensorflow-in-emr-with-sparklyr.md
Last active January 20, 2020 16:53
Using TensorFlow in EMR with sparklyr

A script to demonstrate using TensorFlow in Spark with Amazon EMR and sparklyr.

  1. Create an EMR cluster for sparklyr, connect to EMR and install required tools:
install.packages(tensorflow)
devtools::install_github("rstudio/tfdeploy")
  1. Connect to Spark using sparklyr, copy some data and the mtcars TensorFlow model:
@duckythescientist
duckythescientist / periodic.py
Created July 10, 2015 17:58
Periodically run Python function asynchronously in the background of a script
#!/usr/bin/env python2
from threading import Event, Thread
class Periodic(object):
"""Periodically run a function with arguments asynchronously in the background
Period is a float of seconds.
Don't expect exact precision with timing.
Threading is used instead of Multiprocessing because we need shared memory