Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112
For older versions of Spark and ipython, please, see also previous version of text.
#!/bin/sh | |
# Install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Apple hides old versions of stuff at https://developer.apple.com/download/more/ | |
# Install the latest XCode (8.0). | |
# We used to install the XCode Command Line Tools 7.3 here, but that would just upset the most recent versions of brew. | |
# So we're going to install all our brew dependencies first, and then downgrade the tools. You can switch back after | |
# you have installed caffe. | |
# Install CUDA toolkit 8.0 release candidate | |
# Register and download from https://developer.nvidia.com/cuda-release-candidate-download |
#!/bin/sh | |
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}') | |
# Get Xcode CLI tools | |
# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex | |
# https://developer.apple.com/downloads/index.action | |
TOOLS=clitools.dmg | |
if [ ! -f "$TOOLS" ]; then | |
if [ "$OSX_VERS" -eq 7 ]; then | |
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg |
$( document ).ready(function() { | |
$('.markdown p img').unwrap().wrap('<figure></figure>').after(function() { | |
return '<figcaption>'+this.alt+'</figcaption>'; | |
}); | |
}); |
Tested with Apache Spark 2.1.0, Python 2.7.13 and Java 1.8.0_112
For older versions of Spark and ipython, please, see also previous version of text.
import numpy as np | |
import tensorflow as tf | |
from tensorflow.python.framework import dtypes | |
# 1. Setting up initial values | |
x = np.zeros((7, 7, 3)) | |
x[:, :, 0] = np.mat( | |
"0 0 0 0 0 0 0;0 0 1 0 1 0 0;0 2 1 0 1 2 0;0 0 2 0 0 1 0;0 2 0 1 0 0 0;0 0 0 1 2 2 0;0 0 0 0 0 0 0" | |
).A |