This file contains 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
from keras import backend as K, initializers, regularizers, constraints | |
from keras.engine.topology import Layer | |
def dot_product(x, kernel): | |
""" | |
Wrapper for dot product operation, in order to be compatible with both | |
Theano and Tensorflow | |
Args: |
This file contains 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
# Keras==1.0.6 | |
from keras.models import Sequential | |
import numpy as np | |
from keras.layers.recurrent import LSTM | |
from keras.layers.core import TimeDistributedDense, Activation | |
from keras.preprocessing.sequence import pad_sequences | |
from keras.layers.embeddings import Embedding | |
from sklearn.cross_validation import train_test_split | |
from keras.layers import Merge | |
from keras.backend import tf |
This file contains 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
#!/bin/bash | |
### USAGE | |
### | |
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7 | |
### ./ElasticSearch.sh will fail because no version was specified (exit code 1) | |
### | |
### CLI options Contributed by @janpieper | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch |
This file contains 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
These code snippets have been tested on R 3.1.0 and Mac OS 10.9.3. They presumably do *not* work on R 2.X! | |
## Enter these commands in the Mac OS Terminal | |
# use faster vecLib library | |
cd /Library/Frameworks/R.framework/Resources/lib | |
ln -sf /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Versions/Current/libBLAS.dylib libRblas.dylib | |
# return to default settings | |
cd /Library/Frameworks/R.framework/Resources/lib |
This file contains 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
# Housekeeping: clear workspace and load packages | |
rm(list=ls(all=TRUE)) | |
library(lubridate) | |
library(RgoogleMaps) | |
library(ggmap) | |
library(mapproj) | |
library(ggplot2) | |
library(plyr) | |
# Load 2011 GDELT data from http://eventdata.psu.edu/data.dir/GDELT.html |