GithubHelp home page GithubHelp logo

lewuathe / dllib Goto Github PK

View Code? Open in Web Editor NEW
32.0 6.0 5.0 3.78 MB

dllib is a distributed deep learning library running on Apache Spark

Home Page: https://www.lewuathe.com/dllib/

License: Apache License 2.0

Scala 24.92% Shell 4.21% HTML 9.48% CSS 58.49% JavaScript 2.90%
deep-learning scala spark mllib

dllib's Introduction

dllib Build Status codecov GitHub tag license Maven Central

dllib is a distributed deep learning framework running on Apache Spark. See more detail in documentation. dllib is designed to be simple and easy to use for Spark users.

Since dllib has completely same interface of MLlib algorithms, libraries in MLlib can be used for feature engineering or transformation.

How to use

dllib is uploaded on Spark Packages. You can use from sperk-shell directly.

$ ./bin/spark-shell --packages Lewuathe:dllib:0.0.9

If you want use jar package to extend, you can write the configuration in your pom.xml.

<dependency>
    <groupId>com.lewuathe</groupId>
    <artifactId>dllib_2.11</artifactId>
    <version>0.0.9</version>
</dependency>

Example

This is an example for classification of MNIST dataset. Full code can be seen here.

import com.lewuathe.dllib.graph.Graph
import com.lewuathe.dllib.layer.{AffineLayer, ReLULayer, SoftmaxLayer}
import com.lewuathe.dllib.network.Network

// Define the network structure as calculation graph.
val graph = new Graph(Array(
  new AffineLayer(100, 784),
  new ReLULayer(100, 100),
  new AffineLayer(10, 100),
  new SoftmaxLayer(10, 10)
))

// Model keeps whole network parameters which should be trained.
// Default is in-memory model.
val model = Model(nn3Graph)

val nn3 = Network(model, graph)

// MultilayerPerceptron defines the optimization algorithms and hyper parameters.
val multilayerPerceptron = new MultiLayerPerceptron("MNIST", nn3)

// We can pass Dataset of Spark to the network.
val trainedModel = multilayerPerceptron.fit(df)

val result = trainedModel.transform(df)

result.filter("label = prediction").count()

License

Apache v2

Author

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.