MicrosoftDocs / ml-basics

Exercise notebooks for Machine Learning modules on Microsoft Learn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need more explaination and reasoning for the code samples, not useless comments

MingLu8 opened this issue · comments

I'm a beginner, trying to teach myself machine learning. It is frustrating to the read comments that are just useless english translation the code, which the code already showing. Look at the sample below from the "05b-Convolutional Neural Network (PyTorch).ipynb" file, where I added comments indicating the more meaningful comments would actually provide some meaningful values to help with the learning.

# Create a neural net class
class Net(nn.Module):
    # Constructor
    def __init__(self, num_classes=3):
        super(Net, self).__init__()
        
        # Our images are RGB, so input channels = 3. We'll apply 12 filters in the first convolutional layer
#explain why 12 filters
        self.conv1 = nn.Conv2d(in_channels=3, out_channels=12, kernel_size=3, stride=1, padding=1)
        
        # We'll apply max pooling with a kernel size of 2
#explain why using max pooling of kernel size of 2
        self.pool = nn.MaxPool2d(kernel_size=2)
        
        # A second convolutional layer takes 12 input channels, and generates 12 outputs
        self.conv2 = nn.Conv2d(in_channels=12, out_channels=12, kernel_size=3, stride=1, padding=1)
        
        # A third convolutional layer takes 12 inputs and generates 24 outputs
#explain why gernerates 24 outputs
        self.conv3 = nn.Conv2d(in_channels=12, out_channels=24, kernel_size=3, stride=1, padding=1)
        
        # A drop layer deletes 20% of the features to help prevent overfitting
#explain how this help prevent overfitting
        self.drop = nn.Dropout2d(p=0.2)