With the addition of the Machine Learning Professional plug-in, OpendTect development is further extended by allowing Python as an additional development environment. Starting from within OpendTect, a Python shell, or integrated development environment (IDE), can be launched, and one with direct access to the OpendTect-Python link, libraries and data structures that are a pre-requisite to further research and development. An advantage of Python is its flexibility, and the ability to add new tools and libraries from the command line, so, even this environment can be easily customized with additional analytics libraries. Recently we have added extended support for PyTorch, on top of our already extensive Tensorflow/Keras and scikit-learn support.
Scikit-learn is a simple and reusable set of tools built on NumPy, SciPy and matplotlib great for initial research and exploring the utility of various Machine Learning methods. Although the end results are similar, using PyTorch versus Tensorflow/Keras has it’s own advantages. PyTorch is Pythonic, has support for C++, easier to write OOP and easier to debug then Tensorflow. Tensorflow uses a static computation graph, that is, we have to define the computations that we want to do in a sequence and then run the Machine Learning Model. It is possible to perform computations in an eager (immediate mode) but you are limited in what you can do and the performance can be limited. PyTorch operated on a dynamic computational graph that is defined at run time and where the computations are done at the time when code is interpreted. The dynamic approach of PyTorch makes it possible to use python debugging tools. The static computation graph of the TensorFlow makes it hard to debug. Furthermore, mixing keras and numpy code for example can “break the graph” and errors can be difficult to track down.
There are a lot of advantages that TensorFlow enjoys over PyTorch when it comes to production. Better performance due to the static computation graphs and tools like TensorBoard which helps the user to visualize the Machine Learning Model, profile and compare different training runs, as well as aiding in tuning hyperparameters. PyTorch does not have a built-in tool such as Tensorboard, so we can utilize MatPlotLib and other similar tools to create our own dashboards, or find similar projects on GitHub as may suit our needs.
It is clear that for different reasons, and for different developer personas, PyTorch and Tensorflow/Keras provide complimentary features and benefits. Thus we are proud that the OpendTect Machine Learning plugin now gives the developer more choices and more flexibility in developing models and workflows that will provide even more value to their teams