Repository: systemml
Updated Branches:
  refs/heads/gh-pages dbe9a03b2 -> e3f0cf404


[SYSTEMML-1819] Added new Keras2DML frontend

This adds a new "Keras2DML" frontend to SystemML, built upon the
Caffe2DML infrastructure, that allows users to define (and even train)
models in Keras and then import them into SystemML for distributed
training and prediction.

More specifically, a new `Keras2DML` class accepts a Keras `Model`
object, converts it in the background to a Caffe model using the Python
Caffe API in a `keras2caffe.py` file, and then internally uses Caffe2DML
to transform the model into DML.  From the user's perspective, no Caffe
interaction is necessary.

This API is still experimental at this point.

Closes #622.


Project: http://git-wip-us.apache.org/repos/asf/systemml/repo
Commit: http://git-wip-us.apache.org/repos/asf/systemml/commit/c95108c4
Tree: http://git-wip-us.apache.org/repos/asf/systemml/tree/c95108c4
Diff: http://git-wip-us.apache.org/repos/asf/systemml/diff/c95108c4

Branch: refs/heads/gh-pages
Commit: c95108c4db39be229fba1847987d8c4a58e0453a
Parents: dbe9a03
Author: FuturizeHandgun <[email protected]>
Authored: Tue Sep 19 17:20:57 2017 -0700
Committer: Mike Dusenberry <[email protected]>
Committed: Tue Sep 19 17:20:57 2017 -0700

----------------------------------------------------------------------
 beginners-guide-keras2dml.md | 62 +++++++++++++++++++++++++++++++++++++++
 index.md                     |  2 +-
 2 files changed, 63 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/systemml/blob/c95108c4/beginners-guide-keras2dml.md
----------------------------------------------------------------------
diff --git a/beginners-guide-keras2dml.md b/beginners-guide-keras2dml.md
new file mode 100644
index 0000000..fd2af87
--- /dev/null
+++ b/beginners-guide-keras2dml.md
@@ -0,0 +1,62 @@
+---
+layout: global
+title: Beginner's Guide for Keras2DML users
+description: Beginner's Guide for Keras2DML users
+---
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% endcomment %}
+-->
+
+* This will become a table of contents (this text will be scraped).
+{:toc}
+
+<br/>
+
+## Introduction
+
+Keras2DML is an **experimental API** that converts a Keras specification to 
DML through the intermediate Caffe2DML module. 
+It is designed to fit well into the mllearn framework and hence supports 
NumPy, Pandas as well as PySpark DataFrame.
+
+### Getting Started 
+
+To create a Keras2DML object, one needs to create a Keras model through the 
Funcitonal API. please see the [Functional API.](https://keras.io/models/model/)
+This module utilizes the existing [Caffe2DML](beginners-guide-caffe2dml) 
backend to convert Keras models into DML. Keras models are 
+parsed and translated into Caffe prototext and caffemodel files which are then 
piped into Caffe2DML. Thus one can follow the Caffe2DML
+documentation for further information.
+
+### Model Conversion
+
+Keras models are parsed based on their layer structure and corresponding 
weights and translated into the relative Caffe layer and weight
+configuration. Be aware that currently this is a translation into Caffe and 
there will be loss of information from keras models such as 
+intializer information, and other layers which do not exist in Caffe. 
+
+To create a Keras2DML object, simply pass the keras object to the Keras2DML 
constructor. It's also important to note that your models
+should be compiled so that the loss can be accessed for Caffe2DML
+
+```python
+from systemml.mllearn import Keras2DML
+import keras
+from keras.applications.resnet50 import preprocess_input, decode_predictions, 
ResNet50
+
+model = 
ResNet50(weights='imagenet',include_top=True,pooling='None',input_shape=(224,224,3))
+model.compile(optimizer='sgd', loss= 'categorical_crossentropy')
+
+resnet = Keras2DML(spark,model,input_shape=(3,224,224))
+resnet.summary()
+```
+

http://git-wip-us.apache.org/repos/asf/systemml/blob/c95108c4/index.md
----------------------------------------------------------------------
diff --git a/index.md b/index.md
index 96b6b2a..d1dded7 100644
--- a/index.md
+++ b/index.md
@@ -51,7 +51,7 @@ for running SystemML from Spark via Scala, Python, or Java.
 machine in R-like and Python-like declarative languages.
 * [JMLC](jmlc) - Java Machine Learning Connector.
 * *Experimental* [Caffe2DML API](beginners-guide-caffe2dml) for Deep Learning.
-
+* *Experimental* [Keras2DML API](beginners-guide-keras2dml) for Deep Learning.
 ## Language Guides
 
 * [Python API Reference](python-reference) - API Reference Guide for Python 
users.

Reply via email to