Tensorflow Support for Deep Netts 3 Has Been Released

Deep Netts v3.0 release is the major breakthrough that brings compatibility with Tensorflow, the leading industry deep learning framework from Google. It is a major step towards vision of having high quality, user friendly, Java-native solution for AI. In addition to Tensorflow support this release also brings improved accuracy and speed. Learn more exciting details about this release below.

Deep Netts Platform

1. Tensorflow Support

Tensorflow compatibility in Deep Netts allows you to train machine learning models with Tensorflow and import them into Deep Netts. In practice this means that you can train your models using Tensorflow with huge amounts of data, on GPU or cloud infrastructure, and then to easily deploy it into Java-native applications using Deep Netts. This also enables you to re-use existing models by and importing pre-trained Tensorflow models. It effectively solves many problems that developers are facing when they want to put AI models into production, and use Tensorflow in Java.

In practice, this feature effectively enables using GPU support from Tensorflow for training. Deep Netts now also provides 100% inference compatibility with Tensorflow algorithms, which proves the correctness of implementation, and follows industry best practice.

All this makes Deep Netts the fastest Java-native implementation of deep learning, and position it side by side by leading industry AI frameworks.
It is an important step towards our vision of Java developer friendly AI/machine learning API that will enable massive application of AI by Java software developers.
daj malo koda ovde za import

This example shows how pre-trained VGG Net neural network can be imported into Deep Netts. VGG Net is trained on the large scale image dataset called ImageNet (1000000 images) to recognize 1000 common objects.

The release includes Python utility script for exporting pre-trained Tensorflow models (created with Keras) into format that can be imported to DeepNetts. Tensorflow models created with Keras can be exported using one Python function call:

deepnetts_export_model(model, "exported_model_file.txt")

The exported model can be imported into Deep Netts network in Java using:

TensorflowUtils.importWeights(neuralNet, "exported_model_file.txt");

See the following examples for more details. link here

2. Improved Speed and Accuracy

As with every release DeepNetts is becoming faster since the performance is critical to AI applications. The overall performance optimization of Deep Netts has been performed using JITWatch (thanks to Chris Newland @chriswhocodes for this amazing tool and help) and Apache NetBeans Profiler on a large VGG neural network imported from Tensorflow.

  • Optimized use of threads for fully connected layers and improved JIT compiler code optimization and inlining for tensor operations.
  • Improved mathematical models provide higher accuracy and more stable training

3. More User-friendly API

Small API changes to make more user friendly API and improve readability of builders for convolutional neural network architecture.
Introducing Filter class with static factory method ofSize, helps to avoid confusion with overloaded methods with several int parameters adding convolutional layer.
For example, instead of:

 ConvolutionalNetwork convNet = ConvolutionalNetwork.builder()
                .addInputLayer(imageWidth, imageHeight)
                .addConvolutionalLayer(32, 3, 3, ActivationType.RELU)

Now we can write:

 ConvolutionalNetwork convNet = ConvolutionalNetwork.builder()
                .addInputLayer(imageWidth, imageHeight)
                .addConvolutionalLayer(32, Filter.ofSize(3), ActivationType.RELU)

This is even more helpful when additional filter settings like stride and padding are used, like:

 ConvolutionalNetwork convNet = ConvolutionalNetwork.builder()
                .addInputLayer(imageWidth, imageHeight, 3)
                .addConvolutionalLayer(32, Filter.ofSize(3).stride(2), ActivationType.RELU)

The code above says: add convolutional layer with 32 channels with filter size 3 (same width and height) and stride 2, and Relu activation function. With this we can build convolutional neural network using the very readable code below (assuming you understand the basics of convolutional neural nets):

        ConvolutionalNetwork neuralNet = ConvolutionalNetwork.builder()
                .addInputLayer(imageWidth, imageHeight)
                .addConvolutionalLayer(12, Filter.ofSize(3))
                .addOutputLayer(numOutputs, ActivationType.SOFTMAX)

4. More stable GUI

In this release Deep Learning IDE is built on top of Apache NetBeans v14, which provides better overall user experience and usability. Additional components (such as nbjavac) are now integrated, and do not require additional installation. Also, a number of small GUI bugs are fixed.
As previous releases, this release also includes embedded Zulu JDK 11 from our partner Azul for the best performance.

Deep Netts 3.0 is available for download here