In this video, we talk about the basics of Object-Oriented Programming (OOP), including encapsulation and inheritance, to build and define neural networks and deep learning models using PyTorch (torch.nn.Module) in Python. Throughout this video, we explain concepts such as object, class, constructor __init__(), subclassing, and super() with __init__() methods. We use several examples based on NumPy and Customer class to explain these concept. Equipped with these tools, we discuss the construction of neural networks using PyTorch. The torch.nn provides all the building blocks you need to build your own neural network. Every module in PyTorch subclasses the nn.Module. This nested structure allows for building and managing complex architectures easily. Particularly, we discuss:
super(NeuralNetwork, self).__init__()
def forward(self, x)
model.named_parameters()
#PyTorch #Inheritance #nn.Module