Layer initialization
The initialization of the weights of a neural network has been the focus of researchers for many years. When training a network, the method used to initialize the weights has a direct impact on the final performance of the network.
As a machine learning practitioner, you should be able to experiment with different initialization strategies. In this exercise, you are creating a small neural network made of two layers and you are deciding to initialize each layer's weights with the uniform method.
Bu egzersiz
Introduction to Deep Learning with PyTorch
kursunun bir parçasıdırEgzersiz talimatları
- For each layer (
layer0andlayer1), use the uniform initialization method to initialize the weights.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
layer0 = nn.Linear(16, 32)
layer1 = nn.Linear(32, 64)
# Use uniform initialization for layer0 and layer1 weights
nn.____.____(____)
nn.____.____(____)
model = nn.Sequential(layer0, layer1)