Tested with
Python 2.7, OS X 10.11.3 El Capitan, Apache Spark 1.6.0 & Hadoop 2.6
Download Apache Spark and build it or download the pre-built version.
| #!/usr/bin/env python | |
| """ | |
| Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction. | |
| """ | |
| from __future__ import print_function, division | |
| import numpy as np | |
| from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten | |
| from keras.models import Sequential |
| # | |
| # mnist_cnn_bn.py date. 5/21/2016 | |
| # date. 6/2/2017 check TF 1.1 compatibility | |
| # | |
| from __future__ import absolute_import | |
| from __future__ import division | |
| from __future__ import print_function | |
| import os |
Tested with
Python 2.7, OS X 10.11.3 El Capitan, Apache Spark 1.6.0 & Hadoop 2.6
Download Apache Spark and build it or download the pre-built version.
| #!/usr/bin/env bash | |
| ENV_PATH="$(dirname "$(dirname "$(which pip)")")" | |
| SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)" | |
| BAD_ENV_PATHS="/usr/local" | |
| echo "Ensure the root of the broken virtualenv:" | |
| echo " $ENV_PATH" |
| # Mathieu Blondel, September 2010 | |
| # License: BSD 3 clause | |
| import numpy as np | |
| from numpy import linalg | |
| import cvxopt | |
| import cvxopt.solvers | |
| def linear_kernel(x1, x2): | |
| return np.dot(x1, x2) |