Skip to content

Commit 2aeef14

Browse files
author
rraj
committed
Initial commit to Packt repo
1 parent fb5b9cb commit 2aeef14

File tree

225 files changed

+125203
-2
lines changed

Some content is hidden

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

225 files changed

+125203
-2
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.idea
2+
target
3+
cookbook-app.iml
4+
cookbook-app.iws
5+
cookbook-app.ipr
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
3+
4+
## Why DeepLearning4J?
5+
6+
![Why DL4J?](https://user-images.githubusercontent.com/517415/58405629-83197480-8085-11e9-9f24-9b45058b62d5.png)
7+
(Courtesy: Skymind)
8+
9+
10+
In this recipe, we discuss on why we chose DL4J over other libraries especially when compared to Keras/Tensorflow.
11+
12+
- JVM languages have their own advantage when it comes to enterprise application development. Deep learning models created using DL4J are cross-platform compatible.
13+
- Production deployment is as simple as running the maven build from Jenkins job or from SSH terminal.
14+
- DL4J also offer dedicated support along with an enterprise deep learning suite called SKIL.
15+
- Import Keras/Tensorflow models without having to worry about the integration.
16+
- Existence of strong ETL component (**DataVec**) as equivalent to pandas.
17+
- Existence of strong scientific computing library (**ND4J**) as equivalent to numpy.
18+
- Make deep learning reachable to a vast community of Java developers.
19+
20+
21+
Still unsure to choose the right deep learning library for your use-case? You might want to read this amazing [article](https://skymind.ai/wiki/comparison-frameworks-dl4j-tensorflow-pytorch).
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
3+
4+
Although there are multiple ways to perform a single task, here are few of the commonly used network architectures for the mentioned use-cases:
5+
6+
| Problem | Core Architecture |
7+
|--|--|
8+
| Image Classification | CNN |
9+
| Anomaly Detection | Autoencoder |
10+
| Time Series classification | RNN/LSTM/Computation graph
11+
| Prediction problems on sequence data | RNN/LSTM
12+
| Recommender Systems | RL
13+
14+
15+
Note that, the optimal architectural decision can vary upon the type of data dealt with and whether it is supervised/unsupervised.
16+
17+
- For prediction problems with simple CSV data (non-sequential), MLP(Multilayer perceptron) would be just enough and will give best results compared to other complex architectures. MLP is nothing but the deep neural net with an input layer and output layer and multiple hidden layers in between these two layers. Hidden layers receive input from the input layer and output layers receive input from hidden layers. If there are multiple hidden layers, each layer will take inputs from preceding hidden layer.
18+
19+
- Time series data or anything that involves sequential data is going to need a RNN or LSTM. RNN is optimal to handle sequential data. If we want to track long term dependencies in the data, an LSTM might be the best option. LSTM is a variant from RNN with a memory unit which is capable to hold long term dependencies.
20+
- Anomaly detection problems involve feature analysis of each and every sample. We dont need to have labels here. We basically try to encode the data and decode it back to see the outliers in the feature. An autoencoder will be perfect fit for this purpose and lot of better variants like VAE (Variational autoencoder) are possible to construct using DL4J.
21+
- DL4J have its on subsidiary library for reinforcement learning called RL4J. Recommender systems use reinforcement learning algorithms to solve recommendation problems. We can also feed the data in image/video/text format to a feed forward network/CNN and then generate classified actions. That is to chose the policy upon given action.
22+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
Note that there are no implied rules about using an activation function at different layers. It all depends on your data and what you want to do from it. The only purpose of an activation function is to bring non-linearity in the network.
3+
4+
| Constraint | Activation function |
5+
|--|--|
6+
| Hidden layers| ReLU |
7+
| Output layer (classification) | Sigmoid |
8+
| Output layer (non-classification problems) | Linear
9+
|
10+
11+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
### Here are the most common strategies used to combat over-fitting:
4+
1) Dropouts
5+
2) L1/L2 Regularization
6+
3) Gather more data for training.
7+
4) Create more samples using data augmentation and train your network on top of it.
8+
5) Go for simple network architecture.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Chapter 1 : Introduction to Deep Learning in Java
2+
3+
We will discuss about DL4J as a distinct deep learning solution and the significance of Java deep learning library. We will also showcase required deep learning concepts in a recipe-based approach.
4+
5+
In this chapter, we have the following recipes:
6+
7+
- [Determine the right deep learning library](https://github.com/rahul-raj/Java-Deep-Learning-Cookbook/tree/master/01_Introduction%20to%20Deep%20Learning%20in%20Java/01_Determine%20the%20right%20deep%20learning%20library "01_Determine the right deep learning library")
8+
- [Determine the right network type to solve the problem](https://github.com/rahul-raj/Java-Deep-Learning-Cookbook/tree/master/01_Introduction%20to%20Deep%20Learning%20in%20Java/02_Determine%20the%20right%20network%20type%20to%20solve%20the%20problem "02_Determine the right network type to solve the problem")
9+
- [Determine the right activation function](https://github.com/rahul-raj/Java-Deep-Learning-Cookbook/tree/master/01_Introduction%20to%20Deep%20Learning%20in%20Java/03_Determine%20the%20right%20activation%20function "03_Determine the right activation function")
10+
- [Combat overfitting problems](https://github.com/rahul-raj/Java-Deep-Learning-Cookbook/tree/master/01_Introduction%20to%20Deep%20Learning%20in%20Java/04_Combat%20overfitting%20problems "04_Combat overfitting problems")
11+
- [Determine the right batch size and learning rates](https://github.com/rahul-raj/Java-Deep-Learning-Cookbook/tree/master/01_Introduction%20to%20Deep%20Learning%20in%20Java/05_Determine%20the%20right%20batch%20size%20and%20learning%20rates "05_Determine the right batch size and learning rates")
12+
- [Configuring Maven for DL4J](https://github.com/rahul-raj/Java-Deep-Learning-Cookbook/tree/master/01_Introduction%20to%20Deep%20Learning%20in%20Java/06_Configuring%20Maven%20%20for%20%20DL4J "06_Configuring Maven for DL4J")
13+
- [Configuring DL4J for GPU accelerated environment](https://github.com/rahul-raj/Java-Deep-Learning-Cookbook/tree/master/01_Introduction%20to%20Deep%20Learning%20in%20Java/07_Configuring%20DL4J%20for%20GPU%20accelerated%20environment "07_Configuring DL4J for GPU accelerated environment")
14+
- [Troubleshooting Installation issues](https://github.com/rahul-raj/Java-Deep-Learning-Cookbook/tree/master/01_Introduction%20to%20Deep%20Learning%20in%20Java/08_Troubleshooting%20Installation%20issues "08_Troubleshooting Installation issues")

0 commit comments

Comments
 (0)