Weka package for the Deeplearning4j java library
Clone or download
Permalink
Failed to load latest commit information.
.github Update issue templates Jun 19, 2018
cuda-scripts Version bump v1.5.10 to v1.5.11 Nov 12, 2018
datasets Move package files from package dir to root Jun 5, 2018
doc Move package files from package dir to root Jun 5, 2018
docs Fix imdb ARFF file link Oct 30, 2018
gradle/wrapper Update gradle wrapper to v4.10.2 Nov 11, 2018
src Fix iterator initialization after deserialization Nov 11, 2018
weka-run-test-scripts Fix mnist-single-layer script Oct 19, 2018
.gitattributes Merge branch 'develop' of github.com:Waikato/wekaDeeplearning4j into … May 27, 2018
.gitignore Move from Ant to Gradle for package builds Jun 26, 2018
.travis.yml Enable travis builds fail fast Nov 12, 2018
CONTRIBUTING.md Update CONTRIBUTING.md Oct 19, 2018
Description.props Fix Description props weka dependency Jun 30, 2018
GUIEditors.props Extract logging setup into config object Oct 9, 2018
GenericPropertiesCreator.props Extract logging setup into config object Oct 9, 2018
LICENSE Add license Oct 6, 2017
README.md Update README.md Oct 22, 2018
RELEASE.md Update REALEASE.md Oct 19, 2018
build.gradle Include tests in travis builds (#44) Nov 12, 2018
build.py Fix python shebang Sep 20, 2018
create-windows-test.sh Move package files from package dir to root Jun 5, 2018
gradlew Move from Maven to Gradle for dependency management Jun 25, 2018
gradlew.bat Move from Maven to Gradle for dependency management Jun 25, 2018
install-package.sh Fix change directories in install package script Jun 5, 2018
make-release-files.sh Fix make-release-files script Jun 26, 2018
mkdocs.yml Remove rnn.md Dec 13, 2017
settings.gradle Move from Maven to Gradle for dependency management Jun 25, 2018
update-javadocs.sh Fix javadocs and add update-javadoc script Sep 18, 2018
version Version bump v1.5.10 to v1.5.11 Nov 12, 2018
version-bump.sh Fix version bump tag prefix Aug 1, 2018

README.md

WekaDeeplearning4j

GitHub release GPLv3 license Build Status contributions welcome

WekaDeeplearning4j gives users the ability to train and test deep learning models from within the Weka environment. Our goal is to make deep learning available to users with zero knowledge of programming. The package uses Deeplearning4j as backend. Weka, and therefore also the WekaDeeplearning4j package, can be accessed via various interfaces. While the main focus of this package is the Weka GUI for users with no programming experience, it is also possible to access the presented features via the Weka commandline line runner as well as from the Weka Java API. Check out the getting-started tutorials for more information.

The full documentation, giving installation instructions and getting started guides, is available here.

Weka GUI

Installation

The package can be installed via the Weka Package Manager GUI.

Alternatively, the latest release on GitHub provides the zip file of the package that allow easy installation via the commandline:

java -cp weka.jar weka.core.WekaPackageManager \
     -install-package package.zip

GPU Support

To add GPU support, download and run the latest install-cuda-libs.sh for Linux/Macosx or install-cuda-libs.ps1 for Windows. Make sure CUDA is installed on your system as explained here.

Manual Download

The install script automatically downloads the libraries and copies them into your wekaDeeplearning4j package installation. If you want to download the library zip yourself, choose the appropriate combination of your platform and CUDA version from the latest release and point the installation script to the file, e.g.:

./install-cuda.sh ~/Downloads/wekaDeeplearning4j-cuda-9.2-1.5.9-linux-x86_64.zip

Usage

As most of Weka, WekaDeeplearning4j's functionality is accessible in three ways:

  • Using the Weka workbench GUI
  • Programming with Weka in Java
  • Via the commandline interface

All three ways are explained in the getting-started documentation.

Example commandline scripts are provided in the weka-run-test-scripts directory, e.g. a simple network with one dense layer of 32 neurons and one output layer, classifying the iris dataset, would look like the following:

$ java -cp ${WEKA_HOME}/weka.jar weka.Run \
       .Dl4jMlpClassifier \
       -layer "weka.dl4j.layers.DenseLayer -nOut 32 -activation \"weka.dl4j.activations.ActivationReLU \" " \
       -layer "weka.dl4j.layers.OutputLayer -activation \"weka.dl4j.activations.ActivationSoftmax \" " \
       -numEpochs 30 \
       -t datasets/nominal/iris.arff

which results in:

=== Stratified cross-validation ===

Correctly Classified Instances         141               94      %
Incorrectly Classified Instances         9                6      %
Kappa statistic                          0.91  
Mean absolute error                      0.0842
Root mean squared error                  0.1912
Relative absolute error                 18.9359 %
Root relative squared error             40.5586 %
Total Number of Instances              150     


=== Detailed Accuracy By Class ===

                 TP Rate  FP Rate  Precision  Recall   F-Measure  MCC      ROC Area  PRC Area  Class
                 1.000    0.000    1.000      1.000    1.000      1.000    1.000     1.000     Iris-setosa
                 0.880    0.030    0.936      0.880    0.907      0.864    0.978     0.928     Iris-versicolor
                 0.940    0.060    0.887      0.940    0.913      0.868    0.979     0.972     Iris-virginica
Weighted Avg.    0.940    0.030    0.941      0.940    0.940      0.911    0.986     0.967     


=== Confusion Matrix ===

  a  b  c   <-- classified as
 50  0  0 |  a = Iris-setosa
  0 44  6 |  b = Iris-versicolor
  0  3 47 |  c = Iris-virginica

The same setup can be achieved in Java with the following code:

// Setup layers
DenseLayer dense = new DenseLayer();
dense.setNOut(32);
OutputLayer out = new OutputLayer();
        
// Setup MLP
Dl4jMlpClassifier mlp = new Dl4jMlpClassifier();
mlp.setLayers(dense, out);
        
// Build model
mlp.buildClassifier(loadIris());

Documentation

The full documentation, giving installation instructions and getting started guides, is available at https://deeplearning.cms.waikato.ac.nz/.

The java documentation can be found here.

Contributing

If you want to contribute to the project, check out the contributing guide.

Misc.

Original code by Mark Hall