Hi all.
I want to change the input so it minimizes the loss (rather than changing the trainable variables ). in other words i want update input instead of weight and bias.
I use this code for iteration:
data_batch = Variable(data_batch, requires_grad=True)
prediction = model(data_batch)
loss = loss_function(prediction, fitness_batch)
loss…backward(retain_graph=False)
grad_input = data_batch.grad
print(“grad”,grad_input)
grad_input is not none and have the value ,but input not change.
I dont know what is my mistake. please help me .