You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by du...@apache.org on 2016/10/24 22:45:30 UTC
incubator-systemml-website git commit: [SYSTEMML-1054] Refactor Get
Started Page with CSS Updates
Repository: incubator-systemml-website
Updated Branches:
refs/heads/master 00263c7e3 -> ec7ae8df5
[SYSTEMML-1054] Refactor Get Started Page with CSS Updates
Closes #12.
Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml-website/commit/ec7ae8df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml-website/tree/ec7ae8df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml-website/diff/ec7ae8df
Branch: refs/heads/master
Commit: ec7ae8df56ffc4a4463b2d8787d9929f5599d387
Parents: 00263c7
Author: Jason Azares <ja...@gmail.com>
Authored: Mon Oct 24 15:42:40 2016 -0700
Committer: Mike Dusenberry <mw...@us.ibm.com>
Committed: Mon Oct 24 15:42:40 2016 -0700
----------------------------------------------------------------------
.../apache/partials/banners/banner_social.html | 2 -
_src/_sass/_layout.scss | 30 +-
_src/_sass/_modules.scss | 23 ++
_src/get-started.html | 347 ++++++++++---------
_src/tutorials.html | 3 -
5 files changed, 207 insertions(+), 198 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-systemml-website/blob/ec7ae8df/_src/_includes/themes/apache/partials/banners/banner_social.html
----------------------------------------------------------------------
diff --git a/_src/_includes/themes/apache/partials/banners/banner_social.html b/_src/_includes/themes/apache/partials/banners/banner_social.html
index cf64b5a..1cb3ab8 100644
--- a/_src/_includes/themes/apache/partials/banners/banner_social.html
+++ b/_src/_includes/themes/apache/partials/banners/banner_social.html
@@ -1,7 +1,5 @@
<section class="full-stripe full-stripe--alternate full-stripe--center">
- <h2 class="full-stripe--heading-center">Get Involved</h2>
<div class="ml-container">
- <h2 class="full-stripe--heading-center">Get Involved</h2>
<ul class="link-list bullet-pointless">
<li><a class="icon icon-youtube" href="https://www.youtube.com/channel/UCQwUHIc5SjqNIppUH6xbxXQ"></a></li>
<li><a class="icon icon-github" href="{{ site.data.project.source_repository }}"></a></li>
http://git-wip-us.apache.org/repos/asf/incubator-systemml-website/blob/ec7ae8df/_src/_sass/_layout.scss
----------------------------------------------------------------------
diff --git a/_src/_sass/_layout.scss b/_src/_sass/_layout.scss
index edd9c4f..abc59d9 100644
--- a/_src/_sass/_layout.scss
+++ b/_src/_sass/_layout.scss
@@ -33,6 +33,9 @@
// grid system for content
.col {
+ &-1 {
+ @include span(1 of 12);
+ }
&-2 {
@include span(2 of 12);
}
@@ -95,32 +98,6 @@
flex-direction: row;
}
- // grid system for content
- .content-text {
- &--col-2 {
- @include span(2 of 12);
- }
- &--col-3 {
- @include span(3 of 12);
- }
- &--col-4 {
- @include span(4 of 12);
- }
- &--col-6 {
- @include span(6 of 12);
- }
- &--col-8 {
- @include span(8 of 12);
- }
- &--col-9 {
- @include span(9 of 12);
- }
- &--col-12 {
- @include span(12 of 12);
- }
-
- }
-
.wrap {
display: block;
}
@@ -167,5 +144,4 @@
text-align: center;
line-height: 35px;
display: inline-block;
- margin-right: 1em;
}
http://git-wip-us.apache.org/repos/asf/incubator-systemml-website/blob/ec7ae8df/_src/_sass/_modules.scss
----------------------------------------------------------------------
diff --git a/_src/_sass/_modules.scss b/_src/_sass/_modules.scss
index 9ff90c0..a194d5a 100644
--- a/_src/_sass/_modules.scss
+++ b/_src/_sass/_modules.scss
@@ -44,6 +44,29 @@
}
}
+.feature-content{
+ h2 {
+ font-size: 2em;
+ }
+ p {
+ font-size: 1.125em;
+ }
+
+ a {
+ margin-top: 1.5em;
+ }
+ &--center{
+ text-align: center;
+ }
+}
+
+.preview-image {
+ text-align: center;
+ img{
+ width: 500px;
+ }
+}
+
.bullet-pointless {
padding: 0;
margin: 0;
http://git-wip-us.apache.org/repos/asf/incubator-systemml-website/blob/ec7ae8df/_src/get-started.html
----------------------------------------------------------------------
diff --git a/_src/get-started.html b/_src/get-started.html
index 7465f95..0e92101 100644
--- a/_src/get-started.html
+++ b/_src/get-started.html
@@ -15,118 +15,127 @@ group: nav-right
</section>
-<!-- content -->
-<main>
- <!-- Overview-->
- <div class="background-stripe">
- <section class="ml-container content-group">
- <!-- 6 column text -->
- <div class="content-text content-text--col-6">
- <h2>Apache SystemML Beginner Tutorial</h2>
- <h6><strong>Difficulty Level:</strong> Beginner <strong>Time:</strong> 20 minutes</h6><br>
- <p>How to set up and run Apache SystemML locally.</p>
- <a class="button button-secondary" href="#">Docs</a>
- </div>
- <!--6 column image -->
- <div class="content-text content-text--col-6">
- <img src="https://unsplash.it/g/650/450" alt="Tutorial 1 Title">
- </div>
- </section>
+<!-- Overview-->
+<section class="full-stripe">
+ <div class="ml-container ml-container--vertically-centered">
+ <div class="col col-6 feature-content">
+ <h2>SystemML Beginner Tutorial</h2>
+ <h4><strong>Difficulty Level:</strong> Beginner <strong>Time:</strong> 20 minutes</h4><br>
+ <p>How to set up and run Apache SystemML locally.</p>
+ <a class="button button-secondary" href="https://apache.github.io/incubator-systemml">Docs</a>
+ </div>
+ <div class="col col-6 feature-content preview-image">
+ <img src="/assets/img/robotTutorial.png" alt="What is Apache SystemML?">
+ </div>
</div>
+</section>
+
+<!-- Tutorial Instructionss -->
+<section class="full-stripe full-stripe--alternate">
- <!-- Tutorial Instructionss -->
- <div class="background-stripe">
- <!-- Assumptions Section -->
- <section class="ml-container content-group steps">
- <ol>
- <section class="ml-container">
- <div class="content-text content-text--col-12">
- <h2>Assumptions</h2>
- <p>If you haven\u2019t run Apache SystemML before, make sure to set up your environment first.</p>
- </div>
- </section>
+ <!-- Assumptions Header -->
+ <section class="ml-container content-group steps">
+ <ol>
+ <section class="ml-container">
+ <div class="col-12">
+ <h2>Assumptions</h2>
+ <p>If you haven\u2019t run Apache SystemML before, make sure to set up your environment first.</p>
+ </div>
+ </section>
- <!-- step 1 -->
- <li class="ml-container">
- <div class="content-text content-text--col-4">
- <h3><div class="circle">1</div> Install Homebrew</h3>
- </div>
- <div class="content-text content-text--col-8">
- <pre>
- <code>
+ <!-- step 1 -->
+ <li class="ml-container">
+ <div class="col-1">
+ <div class="circle">1</div>
+ </div>
+ <div class="col-3">
+ <h3>Install Homebrew</h3>
+ </div>
+ <div class="col-8">
+ <pre>
+ <code>
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Linux
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"</code>
- </pre>
- </div>
- </li>
+ </pre>
+ </div>
+ </li>
- <!-- step 2 -->
- <li class="ml-container ml-container--section-end">
- <!-- instruction -->
- <div class="content-text content-text--col-4">
- <h3><div class="circle">2</div> Install Java</h3>
- </div>
+ <!-- step 2 -->
+ <li class="ml-container ml-container--section-end border">
+ <!-- instruction -->
+ <div class="col-1">
+ <div class="circle">2</div>
+ </div>
+ <div class="col-3">
+ <h3>Install Java</h3>
+ </div>
- <div class="content-text content-text--col-8">
- <!-- code -->
- <pre>
- <code>
+ <div class="col-8">
+ <!-- code -->
+ <pre>
+ <code>
brew tap caskroom/cask
brew install Caskroom/cask/java
brew install python
pip install jupyter matplotlib numpy</code>
- </pre>
- </div>
- </li>
+ </pre>
+ </div>
+ </li>
- <!-- Download Section -->
- <section class="ml-container">
- <div class="content-text content-text--col-12">
- <h2>Downloads</h2>
- <p>Download this Spark and SystemML</p>
- </div>
- </section>
+ <!-- Download Section -->
+ <section class="ml-container">
+ <div class="col-12">
+ <h2>Downloads</h2>
+ <p>Download this Spark and SystemML</p>
+ </div>
+ </section>
- <!-- Step 3 -->
- <li class="ml-container">
- <!-- instruction -->
- <div class="content-text content-text--col-4">
- <h3><div class="circle">3</div>Download and Install Spark 1.6</h3>
- </div>
- <!-- code -->
- <div class="content-text content-text--col-8">
- <pre>
- <code>
+ <!-- Step 3 -->
+ <li class="ml-container">
+ <!-- instruction -->
+ <div class="col-1">
+ <div class="circle">3</div>
+ </div>
+ <div class="col-3">
+ <h3>Download and Install Spark 1.6</h3>
+ </div>
+ <!-- code -->
+ <div class="col-8">
+ <pre>
+ <code>
brew tap homebrew/versions
brew install apache-spark16</code>
- </pre>
- </div>
- </li>
- <!-- Step 4 -->
- <li class="ml-container ml-container--section-end">
- <!-- instruction -->
- <div class="content-text content-text--col-4">
- <h3><div class="circle">4</div> Download and Install SystemML</h3>
- </div>
- <!-- code -->
- <div class="content-text content-text--col-8">
- <p>Download systemml-0.11.0-incubating.zip and unzip it to a location of your choice.
- <a>https://systemml.apache.org/download.html</a> <br>
- This is optional, but will be much easier in the long run: move SystemML to your bash profile. </p>
- <pre>
- <code>
+ </pre>
+ </div>
+ </li>
+ <!-- Step 4 -->
+ <li class="ml-container border">
+ <!-- instruction -->
+ <div class="col-1">
+ <div class="circle">4</div>
+ </div>
+ <div class="col-3">
+ <h3>Download and Install SystemML</h3>
+ </div>
+ <!-- code -->
+ <div class="col-8">
+ <p>Download systemml-0.11.0-incubating.zip and unzip it to a location of your choice.
+ <a>https://systemml.apache.org/download.html</a>
+ This is optional, but will be much easier in the long run: move SystemML to your bash profile. </p>
+ <pre>
+ <code>
vim .bash_profile
i
# 1 line:
export SYSTEMML_HOME=/Users/stc/Documents/systemml-0.10.0-incubating
:wq</code>
- </pre>
- <p>
+ </pre>
+ <p>
Similar to the Scala API, SystemML also provides a Python MLContext API. In addition to the regular SystemML.jar file, you\u2019ll need to install the Python API as follows:</p>
- <pre>
- <code>
+ <pre>
+ <code>
Python 2:
pip install systemml
# Bleeding edge: pip install git+git://github.com/apache/incubator-systemml.git#subdirectory=src/main/python
@@ -135,73 +144,79 @@ pip install systemml
Python 3:
pip3 install systemml
# Bleeding edge: pip3 install git+git://github.com/apache/incubator-systemml.git#subdirectory=src/main/python</code>
- </pre>
- </div>
- </li>
+ </pre>
+ </div>
+ </li>
- <!-- Ways to Use Spark Section -->
- <section class="ml-container">
- <div class="content-text content-text--col-12">
- <h2>Ways to Use</h2>
- <p>How to Use SystemML</p>
- </div>
- </section>
+ <!-- Ways to Use Spark Section -->
+ <section class="ml-container">
+ <div class="col-12">
+ <h2>Ways to Use</h2>
+ <p>How to Use SystemML</p>
+ </div>
+ </section>
- <!-- Step 5 -->
- <li class="ml-container">
- <!-- instruction -->
- <div class="content-text content-text--col-4">
- <h3><div class="circle">5</div>In Jupyter Notebook</h3>
- </div>
- <!-- code -->
- <div class="content-text content-text--col-8">
- <h4>Get Started</h4>
- <p>Start up your Jupyter notebook by moving to the folder where you saved the notebook. Then copying and pasting the line below:</p>
- <pre>
- <code>
+ <!-- Step 5 -->
+ <li class="ml-container">
+ <!-- instruction -->
+ <div class="col-1">
+ <div class="circle">5</div>
+ </div>
+ <div class="col-3">
+ <h3>In Jupyter Notebook</h3>
+ </div>
+ <!-- code -->
+ <div class="col-8">
+ <h4>Get Started</h4>
+ <p>Start up your Jupyter notebook by moving to the folder where you saved the notebook. Then copying and pasting the line below:</p>
+ <pre>
+ <code>
Python 2:
PYSPARK_DRIVER_PYTHON=jupyter PYSPARK_DRIVER_PYTHON_OPTS="notebook" pyspark --master local[*] --driver-class-path SystemML.jar --jars SystemML.jar--conf "spark.driver.memory=12g" --conf spark.driver.maxResultSize=0 --conf spark.akka.frameSize=128 --conf spark.default.parallelism=100
Python 3:
PYSPARK_PYTHON=python3 PYSPARK_DRIVER_PYTHON=jupyter PYSPARK_DRIVER_PYTHON_OPTS="notebook" pyspark --master local[*] --driver-class-path SystemML.jar --jars SystemML.jar --conf "spark.driver.memory=12g" --conf spark.driver.maxResultSize=0 --conf spark.akka.frameSize=128 --conf spark.default.parallelism=100</code>
- </pre>
- <a class="button button-primary" href="#">Download Example Jupyter Notebook</a>
- </div>
- </li>
+ </pre>
+ <a class="button button-primary" href="#">Download Example Jupyter Notebook</a>
+ </div>
+ </li>
- <!-- Step 6 -->
- <li class="ml-container">
- <!-- instruction -->
- <div class="content-text content-text--col-4">
- <h3><div class="circle">6</div>To Run SystemML in the Spark Shell</h3>
- </div>
- <!-- code -->
- <div class="content-text content-text--col-8">
- <h4>Start Spark Shell with SystemML</h4>
- <p> To use SystemML with Spark Shell, the SystemML jar can be referenced using Spark Shell\u2019s --jars option.
- Start the Spark Shell with SystemML with the following line of code in your terminal:</p>
- <pre>
- <code>
+ <!-- Step 6 -->
+ <li class="ml-container">
+ <!-- instruction -->
+ <div class="col-1">
+ <div class="circle">6</div>
+ </div>
+ <div class="col-3">
+ <h3>To Run SystemML in the Spark Shell</h3>
+ </div>
+ <!-- code -->
+ <div class="col-8">
+ <h4>Start Spark Shell with SystemML</h4>
+ <p> To use SystemML with Spark Shell, the SystemML jar can be referenced using Spark Shell\u2019s --jars option.
+ Start the Spark Shell with SystemML with the following line of code in your terminal:</p>
+ <pre>
+ <code>
spark-shell --executor-memory 4G --driver-memory 4G --jars SystemML.jar</code>
- </pre>
- <h4>Create the MLContext</h4>
- <p>To begin, start an MLContext by typing the code below. Once successful, you should see a \u201cWelcome to Apache SystemML!\u201d message.</p>
- <pre>
- <code>
+ </pre>
+ <h4>Create the MLContext</h4>
+ <p>To begin, start an MLContext by typing the code below. Once successful, you should see a \u201cWelcome to Apache SystemML!\u201d message.</p>
+ <pre>
+ <code>
import org.apache.sysml.api.mlcontext._
import org.apache.sysml.api.mlcontext.ScriptFactory._
val ml = new MLContext(sc)</code>
- </pre>
- <h4>Hello World</h4>
- <p>The ScriptFactory class allows DML and PYDML scripts to be created from Strings, Files, URLs, and InputStreams. Here, we\u2019ll use the dmlmethod to create a DML \u201chello world\u201d script based on a String. We execute the script using MLContext\u2019s execute method, which displays \u201chello world\u201d to the console. The execute method returns an MLResults object, which contains no results since the script has no outputs.</p>
- <pre>
- <code>
+ </pre>
+ <h4>Hello World</h4>
+ <p>The ScriptFactory class allows DML and PYDML scripts to be created from Strings, Files, URLs, and InputStreams. Here, we\u2019ll use the dmlmethod to create a DML \u201chello world\u201d script based on a String. We execute the script using MLContext\u2019s execute method, which displays \u201chello world\u201d to the console. The execute method returns an MLResults object, which contains no results since the script has no outputs.</p>
+ <pre>
+ <code>
val helloScript = dml("print('hello world')")
ml.execute(helloScript)</code>
- </pre>
- <h4>DataFrame Example</h4>
- <p>As an example of how to use SystemML, we\u2019ll first use Spark to create a DataFrame called df of random doubles from 0 to 1 consisting of 10,000 rows and 1,000 columns.</p>
- <pre>
- <code>
+ </pre>
+ <h4>DataFrame Example</h4>
+ <p>As an example of how to use SystemML, we\u2019ll first use Spark to create a DataFrame called df of random doubles from 0 to 1 consisting of 10,000 rows and 1,000 columns.</p>
+ <pre>
+ <code>
import org.apache.spark.sql._
import org.apache.spark.sql.types.{StructType,StructField,DoubleType}
import scala.util.Random
@@ -210,12 +225,12 @@ val numCols = 1000
val data = sc.parallelize(0 to numRows-1).map { _ => Row.fromSeq(Seq.fill(numCols)(Random.nextDouble)) }
val schema = StructType((0 to numCols-1).map { i => StructField("C" + i, DoubleType, true) } )
val df = sqlContext.createDataFrame(data, schema)</code>
- </pre>
- <p>We\u2019ll create a DML script using the ScriptFactory dml method to find the minimum, maximum, and mean values in a matrix. This script has one input variable, matrix Xin, and three output variables, minOut, maxOut, and meanOut. <br>
- For performance, we\u2019ll specify metadata indicating that the matrix has 10,000 rows and 1,000 columns. <br>
- We execute the script and obtain the results as a Tuple by calling getTuple on the results, specifying the types and names of the output variables.</p>
- <pre>
- <code>
+ </pre>
+ <p>We\u2019ll create a DML script using the ScriptFactory dml method to find the minimum, maximum, and mean values in a matrix. This script has one input variable, matrix Xin, and three output variables, minOut, maxOut, and meanOut.
+ For performance, we\u2019ll specify metadata indicating that the matrix has 10,000 rows and 1,000 columns.
+ We execute the script and obtain the results as a Tuple by calling getTuple on the results, specifying the types and names of the output variables.</p>
+ <pre>
+ <code>
val minMaxMean =
"""
minOut = min(Xin)
@@ -225,23 +240,23 @@ meanOut = mean(Xin)
val mm = new MatrixMetadata(numRows, numCols)
val minMaxMeanScript = dml(minMaxMean).in("Xin", df, mm).out("minOut", "maxOut", "meanOut")
val (min, max, mean) = ml.execute(minMaxMeanScript).getTuple[Double, Double, Double]("minOut", "maxOut", "meanOut")</code>
- </pre>
- <p>Many different types of input and output variables are automatically allowed. These types include Boolean, Long, Double, String, Array[Array[Double]], RDD<String> and JavaRDD<String> in CSV (dense) and IJV (sparse) formats, DataFrame, BinaryBlockMatrix,Matrix, and Frame. RDDs and JavaRDDs are assumed to be CSV format unless MatrixMetadata is supplied indicating IJV format.</p>
- <h4>RDD Example:</h4>
- <p>Let\u2019s take a look at an example of input matrices as RDDs in CSV format. We\u2019ll create two 2x2 matrices and input these into a DML script. This script will sum each matrix and create a message based on which sum is greater. We will output the sums and the message.</p>
- <pre>
- <code>
+ </pre>
+ <p>Many different types of input and output variables are automatically allowed. These types include Boolean, Long, Double, String, Array[Array[Double]], RDD<String> and JavaRDD<String> in CSV (dense) and IJV (sparse) formats, DataFrame, BinaryBlockMatrix,Matrix, and Frame. RDDs and JavaRDDs are assumed to be CSV format unless MatrixMetadata is supplied indicating IJV format.</p>
+ <h4>RDD Example:</h4>
+ <p>Let\u2019s take a look at an example of input matrices as RDDs in CSV format. We\u2019ll create two 2x2 matrices and input these into a DML script. This script will sum each matrix and create a message based on which sum is greater. We will output the sums and the message.</p>
+ <pre>
+ <code>
val rdd1 = sc.parallelize(Array("1.0,2.0", "3.0,4.0"))
val rdd2 = sc.parallelize(Array("5.0,6.0", "7.0,8.0"))
val sums = """
s1 = sum(m1);
s2 = sum(m2);
if (s1 > s2) {
- message = "s1 is greater"
+message = "s1 is greater"
} else if (s2 > s1) {
- message = "s2 is greater"
+message = "s2 is greater"
} else {
- message = "s1 and s2 are equal"
+message = "s1 and s2 are equal"
}
"""
scala.tools.nsc.io.File("sums.dml").writeAll(sums)
@@ -254,12 +269,12 @@ val rdd1Metadata = new MatrixMetadata(2, 2)
val rdd2Metadata = new MatrixMetadata(2, 2)
val sumScript = dmlFromFile("sums.dml").in(Seq(("m1", rdd1, rdd1Metadata), ("m2", rdd2, rdd2Metadata))).out("s1", "s2", "message")
val (firstSum, secondSum, sumMessage) = ml.execute(sumScript).getTuple[Double, Double, String]("s1", "s2", "message")</code>
- </pre>
- <p>Congratulations! You\u2019ve now run examples in Apache SystemML!</p>
- </div>
- </li>
- </ol>
- </section>
- </div>
+ </pre>
+ <p>Congratulations! You\u2019ve now run examples in Apache SystemML!</p>
+ </div>
+ </li>
+ </ol>
+ </section>
</div>
-</main>
+
+</section>
http://git-wip-us.apache.org/repos/asf/incubator-systemml-website/blob/ec7ae8df/_src/tutorials.html
----------------------------------------------------------------------
diff --git a/_src/tutorials.html b/_src/tutorials.html
index f605dde..4f32dbc 100644
--- a/_src/tutorials.html
+++ b/_src/tutorials.html
@@ -58,6 +58,3 @@ group: nav-right
</div>
</section>
</main>
-
-<!-- Social -->
-{% include themes/apache/partials/banners/banner_social.html %}