Skip to main content

Posts

Showing posts from March, 2025

RNN model training with PyTorch

A Recurrent Neural Network (RNN) is a type of artificial neural network designed for processing sequential data like time series, speech, and text. Unlike traditional neural networks, RNNs have memory that allows them to retain information from previous inputs, making them effective for tasks where context matters.  RNNs played a crucial role for modern AI applications, especially in Natural Language Processing (NLP) and speech processing . Below is a proof of concept demonstrating the training of an RNN model for sentiment analysis using the publicly available IMDB dataset. Process: Install torchtext 0.6.0 Importing the PyTorch libraries # Styrish AI # Installing PyTorch libraries import torch #================================================================= # this will check if GPU is available, the device on which the # code is run is GPU, else CPU. if torch.cuda.is_available():     device = torch.device( "cuda" )     print ( f "GPU is available: {torc...

Exploring CNN with TensorFlow & Keras

Convolutional Neural Network or CNN for short, is one of the widely used neural network architecture for image recognition. It’s use cases can be widely extended to various powerful tasks, such as, object detection within an image, image classification, facial recognition, gesture recognition etc. Indeed, Convolutional Neural Networks (CNNs) are designed with some level of resemblance to the image recognition process in the human brain. For instance, In the visual cortex, neurons have local receptive fields, meaning they respond to stimuli only in a specific region of the visual field, which is achieved by CNN using kernels or filters. Both human brain and CNN process the visual information in hierarchical manner. Basic information of an image is extracted via lower level of neurons in human brain, and higher-level neurons integrate the information from lower-level neurons to identify the complex patterns. On the other hand, in CNN, we use multiple convolutional layers to extract hiera...