Dive into Deep Learning – Lec 6: Basics of Object-Oriented Programming in PyTorch (torch.nn.Module)

Dr. Data Science
Dr. Data Science
7.4 هزار بار بازدید - 2 سال پیش - In this video, we talk
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
2 سال پیش در تاریخ 1401/03/05 منتشر شده است.
7,423 بـار بازدید شده
... بیشتر