#custom initiliazation of weight
self.hidden_layer_1.weight = torch.nn.Parameter(torch.from_numpy(weights))
a = self.hidden_layer_1.weight
num_epochs=10
for epoch in range(num_epochs):
            print('Epoch {}'.format(epoch))
            torch.autograd.set_detect_anomaly(True)
            epoch_loss_train = []
            epoch_loss_validation = []
            for i, (x,y) in enumerate(zip(feature_trainloader,label_trainloader), 0):
                optimizer.zero_grad()   
                output = self.forward(x)
                target = y
                loss = self.CrossEntropyLoss(output, target)
                epoch_loss_train.append(loss.item())
                y_true_train = torch.cat((y_true_train, target))
                _, pred_class = torch.max(output, dim=1)
                y_pred_train = torch.cat((y_pred_train, pred_class))
                loss.backward()
                optimizer.step() 
b = self.hidden_layer_1.weight
print(torch.equal(a, b)) #True

I don’t understand how weights are the same after 10 epochs even though the loss is changing