Deep Learning

Deep learning is a branch of machine learning, in essence, its the implementation of neural networks with more than a single hidden layer of neurons.

Image for post

AI, ML, DL (Pic credits: Pinterest)

In this article, I’m going to cover the top 5 Deep Learning Libraries & Frameworks.

Here you go —

Keras

Developed by François Chollet, a researcher at Google, Keras is a Python framework for deep learning.

Image for post

Keras has been used at organizations like Google, CERN, Yelp, Square, Netflix, and Uber. The advantage of Keras is that it uses the same Python code to run on CPU or GPU.

Keras models accept three types of inputs:

  • NumPy arrays, just like Scikit-Learn and many other Python-based libraries. This is a good option if your data fits in memory.
  • TensorFlow Dataset objects. This is a high-performance option that is more suitable for datasets that do not fit in memory and that are streamed from disk or from a distributed filesystem.
  • Python generators that yield batches of data (custom subclasses of the keras.utils.Sequence class).

Keras features a range of utilities to help you turn raw data on disk into a Dataset:

  • tf.keras.preprocessing.image_dataset_from_directory — It turns image files sorted into class-specific folders into a labeled dataset of image tensors.
  • tf.keras.preprocessing.text_dataset_from_directory — It turns text files sorted into class-specific folders into a labeled dataset of text tensors.

In Keras, layers are simple input-output transformations. For the preprocessing layers itincludes:

  • Vectorizing raw strings of text via the TextVectorization layer
  • Feature normalization via the Normalization layer
  • Image rescaling, cropping, or image data augmentation

Example —

from tensorflow.keras import layers

# Center-crop images to 150x150
x = CenterCrop(height=150, width=150)(inputs)
# Rescale images to [0, 1]
x = Rescaling(scale=1.0 / 255)(x)

# Apply some convolution and pooling layers
x = layers.Conv2D(filters=32, kernel_size=(3, 3), activation="relu")(x)
x = layers.MaxPooling2D(pool_size=(3, 3))(x)
x = layers.Conv2D(filters=32, kernel_size=(3, 3), activation="relu")(x)
x = layers.MaxPooling2D(pool_size=(3, 3))(x)
x = layers.Conv2D(filters=32, kernel_size=(3, 3), activation="relu")(x)

# Apply global average pooling to get flat feature vectors
x = layers.GlobalAveragePooling2D()(x)

# Add a dense classifier on top
num_classes = 10
outputs = layers.Dense(num_classes, activation="softmax")(x)

#keras #machine-learning #tensorflow #deep-learning #tech #deep learning

The Top 5 Deep Learning Libraries And Frameworks
4.95 GEEK