for i in range(train_iter):
    out = model(*inputs)
    loss = criterion(out, h_train)  # loss between predicted and truth

    optimizerADAM.zero_grad()
    loss.backward()
    optimizerADAM.step()

    model.apply(constraints)  # keep wieghts positive after gradient decent
    loss_values.append(loss.item())