DeepLearning4J
Purposes of ML Architecture: 1) Build models 2) Deploy and serve models to get predictions 3) Provide with possibility to serve the ‘best’ models (in terms of maximizing the business KPIs) 4) Provide researchers with possibility to perform different ambitious experiments
Model training and serving architecture in zendesk
Features of DL4J: - fast computations with ND4J (CPU and GPU support) - supports modern Deep Learning features: layers, activations, initializations, losses and optimizers - allows distributed training on Spark - provides with sequential model as well as with a computational graph - model Zoo - feature preprocessing - hyperparameter tuning (Arbiter) - import Keras models
ND4J The APIs are essentially wrappers for different versions of BLAS (Basic Linear Algebra Subprograms) ND4J uses off-heap memory to store NDArrays, to provide better performance while working with NDArrays from native code such as BLAS and CUDA libraries. “Off-heap” means that the memory is allocated outside of the JVM (Java Virtual Machine) and hence isn’t managed by the JVM’s garbage collection (GC). On the Java/JVM side, we only hold pointers to the off-heap memory, which can be passed to the underlying C++ code via JNI for use in ND4J operations.
DataVec Implementations of particular RecordReaders: ● CSVRecordReader for CSV data ● CSVNLinesSequenceRecordReader for Sequence Data ● ImageRecordReader for images ● JacksonRecordReader for JSON data ● RegexLineRecordReader for parsing log files ● WavFileRecordReader for audio files ● LibSvmRecordReader for Support Vector Machine ● VideoRecordReader for reading Video
DataVec For re-organizing, joining, normalizing and transforming data. ● Transform Specific transform implementations ● CategoricalToIntegerTransform to convert category names to integers ● CategoricalToOneHotTransform convert catagory name to onehot representation ● ReorderColumnsTransform rearrange columns ● RenameColumnsTransform rename columns ● StringToTimeTransform convert timestring The labels for data input may be based on the directory where the image is stored. ● ParentPathLabelGenerator Label based on parent directory ● PatternPathLabelGenerator Derives label based on a string within the file path DataNormalization ● Normalizer
Distributed training on Spark Two possibilities: 1) Perform training on Spark using SparkDl4jMultiLayer 2) Perform ETL on Spark using DataVec
How does distribute training work?
“Note that using Spark entails overhead. In order to determine whether Spark will help you or not, consider using the Performance Listener and look at the millisecond iteration time. If it’s <= 150ms, Spark may not be worth it.”
Zalando Fashion-MNIST https://github.com/zalandoresearch/fashion-mnist Current best accuracy is 0.967

Running deep neural nets in your Java application with Deeplearning4j

  • 1.
  • 2.
    Purposes of MLArchitecture: 1) Build models 2) Deploy and serve models to get predictions 3) Provide with possibility to serve the ‘best’ models (in terms of maximizing the business KPIs) 4) Provide researchers with possibility to perform different ambitious experiments
  • 3.
    Model training andserving architecture in zendesk
  • 4.
    Features of DL4J: -fast computations with ND4J (CPU and GPU support) - supports modern Deep Learning features: layers, activations, initializations, losses and optimizers - allows distributed training on Spark - provides with sequential model as well as with a computational graph - model Zoo - feature preprocessing - hyperparameter tuning (Arbiter) - import Keras models
  • 5.
    ND4J The APIs areessentially wrappers for different versions of BLAS (Basic Linear Algebra Subprograms) ND4J uses off-heap memory to store NDArrays, to provide better performance while working with NDArrays from native code such as BLAS and CUDA libraries. “Off-heap” means that the memory is allocated outside of the JVM (Java Virtual Machine) and hence isn’t managed by the JVM’s garbage collection (GC). On the Java/JVM side, we only hold pointers to the off-heap memory, which can be passed to the underlying C++ code via JNI for use in ND4J operations.
  • 6.
    DataVec Implementations of particularRecordReaders: ● CSVRecordReader for CSV data ● CSVNLinesSequenceRecordReader for Sequence Data ● ImageRecordReader for images ● JacksonRecordReader for JSON data ● RegexLineRecordReader for parsing log files ● WavFileRecordReader for audio files ● LibSvmRecordReader for Support Vector Machine ● VideoRecordReader for reading Video
  • 7.
    DataVec For re-organizing, joining,normalizing and transforming data. ● Transform Specific transform implementations ● CategoricalToIntegerTransform to convert category names to integers ● CategoricalToOneHotTransform convert catagory name to onehot representation ● ReorderColumnsTransform rearrange columns ● RenameColumnsTransform rename columns ● StringToTimeTransform convert timestring The labels for data input may be based on the directory where the image is stored. ● ParentPathLabelGenerator Label based on parent directory ● PatternPathLabelGenerator Derives label based on a string within the file path DataNormalization ● Normalizer
  • 8.
    Distributed training onSpark Two possibilities: 1) Perform training on Spark using SparkDl4jMultiLayer 2) Perform ETL on Spark using DataVec
  • 9.
    How does distributetraining work?
  • 10.
    “Note that usingSpark entails overhead. In order to determine whether Spark will help you or not, consider using the Performance Listener and look at the millisecond iteration time. If it’s <= 150ms, Spark may not be worth it.”
  • 13.