PyTorch के साथ Deep Learning परिचय
Jasmin Ludolf
Senior Data Science Content Developer, DataCamp
# Create network with three linear layers model = nn.Sequential(nn.Linear(n_features, 8),nn.Linear(8, 4), nn.Linear(4, n_classes))
nn.Sequential() के अंदर की लेयर्स हिडन लेयर्स हैं# Create network with three linear layers
model = nn.Sequential(
nn.Linear(n_features, 8), # n_features represents number of input features
nn.Linear(8, 4),
nn.Linear(4, n_classes) # n_classes represents the number of output classes
)
nn.Sequential() के अंदर की लेयर्स हिडन लेयर्स हैंn_features और n_classes डेटासेट से निर्धारित होते हैं



# Create network with three linear layers
model = nn.Sequential(
nn.Linear(10, 18),
nn.Linear(18, 20),
nn.Linear(20, 5)
)
# Create network with three linear layers
model = nn.Sequential(
nn.Linear(10, 18), # Takes 10 features and outputs 18
nn.Linear(18, 20),
nn.Linear(20, 5)
)
# Create network with three linear layers
model = nn.Sequential(
nn.Linear(10, 18),
nn.Linear(18, 20), # Takes 18 and outputs 20
nn.Linear(20, 5)
)
# Create network with three linear layers
model = nn.Sequential(
nn.Linear(10, 18),
nn.Linear(18, 20),
nn.Linear(20, 5) # Takes 20 and outputs 5
)
$$

$$
$$

$$
$$

$$
$$

$$

$$

$$
मैनुअल पैरामीटर कैलकुलेशन:
$$

$$
मैनुअल पैरामीटर कैलकुलेशन:
$$

$$
मैनुअल पैरामीटर कैलकुलेशन:
$$

$$
मैनुअल पैरामीटर कैलकुलेशन:
$$

$$
PyTorch का उपयोग:
.numel(): टेन्सर में एलिमेंट्स की संख्या लौटाता हैtotal = 0
for parameter in model.parameters():
total += parameter.numel()
print(total)
46

PyTorch के साथ Deep Learning परिचय