Hello everyone,
I have a question about backpropagation.
In my program I use cross_entropy as the cost function.
I use a DNN predict 3 weights(w1, w2, w3) for 3 different models(M1,M2,M3). And after that I calculate the prediction like this:
prediction=w1*M1+w2*M2+w3*M3(w1,w2,w3 are vectors and M1,M2,M3 are matrics)
I have a targetmatrice, now I want after training prediction same as targetmatrice.
my code is like this:

prediction = w1.mul(M1) + w2.mul(M2) + w3.mul(M3)
optimizer.zero_grad()
            loss = loss_func(prediction.cuda(), target.cuda())
            loss.backward()
            optimizer.step()


I want to ask if I do something wrong? Because the loss seems difficult to reduce.
Please help me
Thank you
Wentao