Data Loading for Machine Learning

When we load data to train a neural network model, We usually split data into the training data and testing data. Then the training data is further split into batches to train the model. This is done to reduce the memory usage and speed up the training process. Let’s see how to load data into a neural network model using PyTorch. Dataset pytorch provides a Dataset class to load data into a neural network model. We can create a custom dataset by inheriting the Dataset class and implementing the __len__ and __getitem__ methods. ...

Neural Network Model Dissection

Data Flow Inside a Neural Network Model Inside a Neural Network Model, when we pass in a value it should some other value. Let’s inspect an example model import torch import torch.nn as nn class NeuralNetwork(nn.Module): def __init__(self): super(NeuralNetwork, self).__init__() self.input_layer = nn.Linear(1, 1) def forward(self, x): x = self.input_layer(x) return x Here, we have a simple neural network model with a single input and output layer. The input layer has a single node and the output layer has a single node. ...

Neural Networks

AI had been really influencing our daily life, It’s a powerful tool to help us with a lot of tasks. As of 2024 There are prototypes of self driving cars to humanoid robots that does chores. Neural Network is the core of the whole Machiene Learning and AI all around us. Let’s break down Neural Networks with examples in pytorch. What is a Neural Network? Neural Network is a programmable network of neurons called nodes with layers to compute and return few outputs. It’s a model that can be trained to recognize patterns in data. ...