4 min read
Out of interest, I joined in Kaggle a year old and participate in several competitions, but I didn’t reach top 15% until 2 month ago. Here I want to share some tips I have learned from those competitions. I am just a programmer with no acadamic background, so if there is mistake, please contact me. Any advice are greatly appreciated.
TensorFlow is now widely used by companies, startups, and business firms to automate things and develop new systems. It draws its reputation from its distributed training support, scalable production and deployment options, and support for various devices like Android. PyTorch is gaining popularity for its simplicity, ease of use, dynamic computational graph and efficient memory usage.
Initially, neural networks were used to solve simple classification problems like handwritten digit recognition or identifying a car’s registration number using cameras. But thanks to the latest frameworks and NVIDIA’s high computational graphics processing units (GPU’s), we can train neural networks on terra bytes of data and solve far more complex problems. A few notable achievements include reaching state of the art performance on the IMAGENET dataset using convolutional neural networks implemented in both TensorFlow and PyTorch. The trained model can be used in different applications, such as object detection, image semantic segmentation and more.
Although the architecture of a neural network can be implemented on any of these frameworks, the result will not be the same. The training process has a lot of parameters that are framework dependent. For example, if you are training a dataset on PyTorch you can enhance the training process using GPU’s as they run on CUDA (a C++ backend). In TensorFlow you can access GPU’s but it uses its own inbuilt GPU acceleration, so the time to train these models will always vary based on the framework you choose.
The key difference between PyTorch and TensorFlow is the way they execute code. Both frameworks work on the fundamental datatype tensor. You can imagine a tensor as a multi-dimensional array.
TensorFlow is a framework composed of two core building blocks:
tf.Session object and tf.Placeholder, which are tensors that will be substituted by external data at runtime.
This is how a computational graph is generated in a static way before the code is run in TensorFlow. The core advantage of having a computational graph is allowing parallelism or dependency driving scheduling which makes training faster and more efficient.Similar to TensorFlow, PyTorch has two core building blocks:
In PyTorch, these production deployments became easier to handle than in it’s latest 1.0 stable version, but it doesn’t provide any framework to deploy models directly on to the web. You’ll have to use either Flask or Django as the backend server. So, TensorFlow serving may be a better option if performance is a concern.
Good documentation and community support.
Plenty of projects out there using PyTorch.
What I would recommend is if you want to make things faster and build AI-related products, TensorFlow is a good choice. PyTorch is mostly recommended for research-oriented developers as it supports fast and dynamic training.