Skip to content

Commit 7b57aa8

Browse files
committed
Eclipse Migration Initial Commit
0 parents  commit 7b57aa8

File tree

476 files changed

+58120
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

476 files changed

+58120
-0
lines changed

.editorconfig

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
################################################################################
2+
# Copyright (c) 2015-2019 Skymind, Inc.
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Apache License, Version 2.0 which is available at
6+
# https://www.apache.org/licenses/LICENSE-2.0.
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
# License for the specific language governing permissions and limitations
12+
# under the License.
13+
#
14+
# SPDX-License-Identifier: Apache-2.0
15+
################################################################################
16+
17+
root = true
18+
19+
[*]
20+
charset = utf-8
21+
end_of_line = lf
22+
insert_final_newline = true
23+
trim_trailing_whitespace = true
24+
25+
[*.java]
26+
indent_style = space
27+
indent_size = 4

.github/CONTRIBUTING.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Contribute
2+
3+
1. Check for open issues, or open a new issue to start a discussion around a
4+
new example or a bug.
5+
2. If you feel uncomfortable or uncertain about an issue or your changes, feel free to contact us on Gitter using the link above.
6+
3. Fork [the repository](https://github.com/deeplearning4j/dl4j-examples.git) on GitHub to start making your changes to the **master** branch (or branch off of it).
7+
4. If you're providing a new example, please help reference it by adding notes
8+
of relevant publications to the code comments, including links if
9+
available. If you fix an existing example, write a test, which shows that the bug was fixed or that the feature works as expected.
10+
5. Note the repository follows
11+
the [Google Java style](https://google.github.io/styleguide/javaguide.html)
12+
with two modifications: 120-char column wrap and 4-spaces indentation. You
13+
can format your code to this format by typing `mvn formatter:format` in the
14+
subproject you work on, by using the `contrib/formatter.xml` at the root of
15+
the repository to configure the Eclipse formatter, or by [using the INtellij
16+
plugin](https://github.com/HPI-Information-Systems/Metanome/wiki/Installing-the-google-styleguide-settings-in-intellij-and-eclipse).
17+
18+
6. Send a pull request, and bug us on Gitter until it gets merged and published.

.github/ISSUE_TEMPLATE.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#### Issue Description
2+
3+
Please describe your issue, along with:
4+
- expected behavior
5+
- encountered behavior
6+
7+
#### Version Information
8+
9+
Please indicate relevant versions, including, if relevant:
10+
11+
* Deeplearning4j version
12+
* platform information (OS, etc)
13+
* CUDA version, if used
14+
* NVIDIA driver version, if in use
15+
16+
#### Contributing
17+
18+
If you'd like to help us fix the issue by contributing some code, but would
19+
like guidance or help in doing so, please mention it!

.github/PULL_REQUEST_TEMPLATE.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## What changes were proposed in this pull request?
2+
3+
(Please fill in changes proposed in this fix)
4+
5+
## How was this patch tested?
6+
7+
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
8+
9+
Please review
10+
https://github.com/eclipse/deeplearning4j/blob/master/CONTRIBUTING.md before opening a pull request.

.gitignore

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
################################################################################
2+
# Copyright (c) 2015-2019 Skymind, Inc.
3+
#
4+
# This program and the accompanying materials are made available under the
5+
# terms of the Apache License, Version 2.0 which is available at
6+
# https://www.apache.org/licenses/LICENSE-2.0.
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
# License for the specific language governing permissions and limitations
12+
# under the License.
13+
#
14+
# SPDX-License-Identifier: Apache-2.0
15+
################################################################################
16+
17+
target/
18+
.idea/*
19+
*.iml
20+
logs/
21+
*.ser
22+
*.log
23+
*.ipynb_checkpoints
24+
*.pyc
25+
graph-tmp/
26+
27+
.DS_Store
28+
pom.xml.releaseBackup
29+
30+
dependency-reduced-pom.xml
31+
*.ser
32+
application.home_IS_UNDEFINEiD
33+
README.md~
34+
*.png
35+
*.bin
36+
*.releaseBackup
37+
*.png
38+
*.bin
39+
*.out
40+
*~
41+
.pydevproject
42+
release.properties
43+
.idea/
44+
*.iml
45+
*.prefs
46+
*.settings/*
47+
model-saver-*
48+
mnist-pretrain-dbn.bin-*
49+
deeplearning4j-scaleout/deeplearning4j-aws/src/main/java/org/deeplearning4j/aws/ec2/provision/Ec2CommandRunner.java.settings/
50+
*.log
51+
.project
52+
.classpath
53+
.settings/
54+
metastore_db
55+
*.ipynb*
56+
!tutorials/*.ipynb
57+
*.html
58+
Word2vec-index/
59+
*.conf
60+
*.json
61+
!tutorials/*.json
62+
*end.model
63+

CONTRIBUTORS.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Contributing to dl4j-examples
2+
3+
Thanks for your interest in Deeplearning4j's examples. Our goal is to bring fast, open-source deep learning to all JVM-based communities.
4+
5+
## Getting Started
6+
7+
Here are Deeplearning4j's [open issues are here](https://github.com/eclipse/deeplearning4j/issues). In time, we'll tag issues that would make a good first pull request for new contributors. An easy way to get started helping the project is to *file an issue*. You can do that on the Deeplearning4j issues page by clicking on the green button at the right. Issues can include bugs to fix, features to add, or documentation that looks outdated.
8+
9+
For some tips on contributing to open source, this [post is helpful](http://blog.smartbear.com/programming/14-ways-to-contribute-to-open-source-without-being-a-programming-genius-or-a-rock-star/).
10+
11+
## Contributions
12+
13+
Deeplearning4j welcomes contributions from everyone.
14+
15+
Contributions to Deeplearning4j should be made in the form of GitHub pull requests. Each pull request will
16+
be reviewed by a core contributor (someone with permission to land patches) and either landed in the
17+
main tree or given feedback for changes that would be required.
18+
19+
## Pull Request Checklist
20+
21+
- Branch from the master branch and, if needed, rebase to the current master
22+
branch before submitting your pull request. If it doesn't merge cleanly with
23+
master you may be asked to rebase your changes.
24+
25+
- Commits should be as small as possible, while ensuring that each commit is
26+
correct independently (i.e., each commit should compile and pass tests).
27+
28+
- Don't put submodule updates in your pull request unless they are to landed
29+
commits.
30+
31+
- If your patch is not getting reviewed or you need a specific person to review
32+
it, you can @-reply a reviewer asking for a review in the pull request or a
33+
comment.
34+
35+
- Add tests relevant to the fixed bug or new feature.
36+
37+
## Conduct & License
38+
39+
We follow the [Rust Code of Conduct](http://www.rust-lang.org/conduct.html).
40+
41+
All code in this repository is released under the Apache Software Foundation License, 2.0, and by contributing to this repository, you agree to release your contribution under that same license.

LICENSE.txt

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
Copyright 2015-2019 Skymind Inc.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
15+
16+
##########################
17+
18+
-- Misc files --
19+
*README.md
20+
*readme.md
21+
.github/CONTRIBUTING.md
22+
.github/ISSUE_TEMPLATE.md
23+
.github/PULL_REQUEST_TEMPLATE.md
24+
org/deeplearning4j/examples/misc/customlayers/CustomLayerExampleReadme.md
25+
org/deeplearning4j/examples/tictactoe/ReadMe.txt
26+
lstm-hdfs/src/resources/test/f1
27+
lstm-hdfs/src/resources/test/f2
28+
lstm-hdfs/src/resources/train/f1
29+
lstm-hdfs/src/resources/train/f2
30+
lstm-hdfs/src/resources/train/f3
31+
nd4j-examples/src/main/resources/numpy_cheatsheet/file.csv
32+
nd4j-examples/src/main/resources/numpy_cheatsheet/file.txt
33+
nd4j-examples/src/main/resources/numpy_cheatsheet/saveFile.csv
34+
nd4j-examples/src/main/resources/numpy_cheatsheet/saveFile.txt
35+
pydatavec-examples/basic_example.csv
36+
pydatavec-examples/reduction_example.csv
37+
rl4j-examples/cartpole.gif
38+
rl4j-examples/cliffwalk.gif
39+
rl4j-examples/cliffwalk_block.gif
40+
rl4j-examples/doom.gif
41+
rl4j-examples/scoregraph.png
42+
tutorials/00. Quickstart for Deeplearning4j.json
43+
tutorials/00. Quickstart for Deeplearning4j.zepp.ipynb
44+
tutorials/01. MultiLayerNetwork and ComputationGraph.json
45+
tutorials/01. MultiLayerNetwork and ComputationGraph.zepp.ipynb
46+
tutorials/02. Built-in Data Iterators.json
47+
tutorials/02. Built-in Data Iterators.zepp.ipynb
48+
tutorials/03. Logistic Regression.json
49+
tutorials/03. Logistic Regression.zepp.ipynb
50+
tutorials/04. Feed-forward.json
51+
tutorials/04. Feed-forward.zepp.ipynb
52+
tutorials/05. Basic Autoencoder- Anomaly Detection Using Reconstruction Error.json
53+
tutorials/05. Basic Autoencoder- Anomaly Detection Using Reconstruction Error.zepp.ipynb
54+
tutorials/06. Advanced Autoencoder- Trajectory Clustering using AIS.json
55+
tutorials/06. Advanced Autoencoder- Trajectory Clustering using AIS.zepp.ipynb
56+
tutorials/07. Convolutions- Train FaceNet Using Center Loss.json
57+
tutorials/07. Convolutions- Train FaceNet Using Center Loss.zepp.ipynb
58+
tutorials/08. RNNs- Sequence Classification of Synthetic Control Data.json
59+
tutorials/08. RNNs- Sequence Classification of Synthetic Control Data.zepp.ipynb
60+
tutorials/09. Early Stopping.ipynb
61+
tutorials/09. Early Stopping.zepp.json
62+
tutorials/10. Layers and Preprocessors.ipynb
63+
tutorials/10. Layers and Preprocessors.zepp.json
64+
tutorials/11. Hyperparameter Optimization.json
65+
tutorials/11. Hyperparameter Optimization.zepp.ipynb
66+
tutorials/12. Clinical Time Series LSTM Example.json
67+
tutorials/12. Clinical Time Series LSTM Example.zepp.ipynb
68+
tutorials/13. Clinical LSTM Time Series Example Using SKIL.json
69+
tutorials/13. Clinical LSTM Time Series Example Using SKIL.zepp.ipynb
70+
tutorials/14. Parallel Training.json
71+
tutorials/14. Parallel Training.zepp.ipynb
72+
tutorials/15. Sea Temperature Convolutional LSTM Example.json
73+
tutorials/15. Sea Temperature Convolutional LSTM Example.zepp.ipynb
74+
tutorials/16. Sea Temperature Convolutional LSTM Example 2.json
75+
tutorials/16. Sea Temperature Convolutional LSTM Example 2.zepp.ipynb
76+
tutorials/17. Instacart Multitask Example.json
77+
tutorials/17. Instacart Multitask Example.zepp.ipynb
78+
tutorials/18. Instacart Single Task Example.json
79+
tutorials/18. Instacart Single Task Example.zepp.ipynb
80+
tutorials/19. Cloud Detection Example.json
81+
tutorials/19. Cloud Detection Example.zepp.ipynb
82+
83+
84+
85+
Copyright (c) 2015-2019 Skymind, Inc.
86+
Apache 2.0 License
87+
88+
##########################

README.md

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
Deeplearning4J Examples
2+
=========================
3+
4+
## NOTE: HOW to interpret these examples
5+
6+
## Data Loading
7+
In this repository, you may likely see custom [datasetiterators](https://github.com/eclipse/deeplearning4j/blob/master/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/dataset/api/iterator/DataSetIterator.java) - these iterators are only for special examples and 1 off use cases. Consult the [gitter](https://gitter.im/deeplearning4j/deeplearning4j) if you are not sure how to proceed.
8+
Once you find a record reader for your use case, you then should use one of pre made iterators that knows how to interpret record reader output, either [RecordReaderDataSetIterator](https://deeplearning4j.org/api/latest/org/deeplearning4j/datasets/datavec/RecordReaderDataSetIterator.html) for normal data or [SequenceRecordReaderDataSetIterator](https://deeplearning4j.org/api/latest/org/deeplearning4j/datasets/datavec/SequenceRecordReaderDataSetIterator.html) for sequence data. For more on sequences, please see our [rnns page](http://deeplearning4j.org/usingrnns)
9+
10+
11+
We have special iterators for 1 off use cases where normal data does not quite exist, or sometimes it is legacy.
12+
99% of the time you should be using [datavec](https://deeplearning4j.org/datavec) and writing your own custom [record readers](https://deeplearning4j.org/api/latest/org/datavec/api/records/reader/RecordReader.html) if one of our pre provided ones is not suitable. If you are not sure what is available, please again consult the [gitter](https://gitter.im/deeplearning4j/deeplearning4j) - In general, you can find both [normal record readers](https://deeplearning4j.org/api/latest/org/datavec/api/records/reader/RecordReader.html) and [sequence record readers](https://deeplearning4j.org/api/latest/org/datavec/api/records/reader/SequenceRecordReader.html) in the datavec [javadoc](https://deeplearning4j.org/docs/latest/datavec-overview).
13+
14+
15+
## Dependencies
16+
17+
Note that this repository contains all dl4j examples for all modules. It will download about 1.5g of dependencies from maven central when you are first starting out. That being said, this makes it easier to get started without worrying about what to download. This examples repository is meant to be a reference point to get started with most common use cases.
18+
It is broken up in to modules. If you would like to just have a more minimal/simple, guide please go [here](http://www.dubs.tech/guides/maven-essentials/)
19+
20+
21+
Repository of Deeplearning4J neural net examples:
22+
23+
- MLP Neural Nets
24+
- Convolutional Neural Nets
25+
- Recurrent Neural Nets
26+
- TSNE
27+
- Word2Vec & GloVe
28+
- Anomaly Detection
29+
- User interface examples.
30+
31+
DL4J-Examples is released under an Apache 2.0 license. By contributing code to this repository, you agree to make your contribution available under an Apache 2.0 license.
32+
33+
---
34+
35+
## Build and Run
36+
37+
Use [Maven](https://maven.apache.org/) to build the examples.
38+
39+
```
40+
mvn clean package
41+
```
42+
43+
This downloads binaries for all platforms, but we can also append `-Djavacpp.platform=` with `android-arm`, `android-x86`, `linux-ppc64le`, `linux-x86_64`, `macosx-x86_64`, or `windows-x86_64` to get binaries for only one platform and produce much smaller archives.
44+
45+
Run the `runexamples.sh` script to run the examples (requires [bash](https://www.gnu.org/software/bash/)). It will list the examples and prompt you for the one to run. Pass the `--all` argument to run all of them. (Other options are shown with `-h`).
46+
47+
```
48+
./runexamples.sh [-h | --help]
49+
```
50+
51+
52+
## Documentation
53+
For more information, check out [deeplearning4j.org](http://deeplearning4j.org/) and its [JavaDoc](https://deeplearning4j.org/docs/latest/).
54+
55+
`GradientsListenerExample.java` in dl4j-examples/src/main/java/org/deeplearning4j/examples/userInterface uses JavaFX. If you're using Java 8 or greater, it should run as is. If you're using Java 7 or an earlier version, you should set JAVAFX_HOME to point to the root directory of the JavaFX 2.0 SDK.
56+
57+
58+
### Known issues with JavaFX
59+
60+
If you are running on JDK 1.7 or inferior, the maven-enforcer plugin will require you to set the variable `JAVAFX_HOME` before building.
61+
That variable should point to a directory containing `jfxrt.jar`, a file that is part of the JavaFX 2.0 distrbution.
62+
63+
Please set it to an instance of JavaFX that matches the JDK with which you are trying to use this project. Usually, the Sun JDK comes with JavaFX. However, OpenJDK does not and you may have to install OpenJFX, a free distribution of JavaFX.
64+
65+
Beware that your editor (e.g. IntelliJ) may not be using the JDK that is your system default (and that you may ancounter on the command line).
66+
67+
### On IntelliJ
68+
69+
To run the JavaFX examples from IntelliJ, you'll have to add the `jfxrt.jar` as an exernal dependency of your project. Here's a screencast on how to do it: https://youtu.be/si146q7WkSY
70+
71+
#### On Ubuntu
72+
73+
If you are using OpenJDK, on Ubuntu 16, you can install OpenJFX with `sudo apt-get install openjfx libopenjfx-java`. A typical `JAVAFX_HOME` is then `/usr/share/java/openjfx/jre/lib/ext/`. If you are on Ubuntu 14, you can install OpenJFX with the following process:
74+
75+
- edit `/etc/apt/sources.list.d/openjdk-r-ppa-trusty.list` and uncomment the line for deb-src
76+
- `sudo apt-get update`
77+
- `sudo apt-get install libicu-dev`
78+
- `sudo aptitude build-dep libopenjfx-java`
79+
- `sudo apt-get --compile source libopenjfx-java`
80+
- `ls -1 *.deb|xargs sudo dpkg -i`
81+
82+
#### On JDK 1.8
83+
84+
The Sun version of JDK8 still comes with its own JavaFX, so that there should be no need to configure anything particular there and the build will succeed. If using OpenJDK8, you will still have to install OpenJFX and set `JAVAFX_HOME`, but the maven-enforcer plugin will not catch you — the reason being that it's difficult to distinguish between OpenJDK and Sun's JDK since version 8, with both adoptiong the same Vendor ID.
85+
86+
If you are using OpenJDK 8, install OpenJFX and set JAVAFX_HOME as indicated above. Compile with `mvn clean install -POpenJFX`
87+
88+
## Other Issues
89+
90+
If you notice issues, please log them, and if you want to contribute, submit a pull request. Input is welcome here.
91+

0 commit comments

Comments
 (0)