hi here my code.
could yo please draw the roc curve for the code in pytorch.
def train(epochs):
best_model_wts = copy.deepcopy(model.state_dict())

b_acc = 0.0

t_loss = []

t_acc = []

avg_t_loss=[]

avg_t_acc=[]

v_loss = []

v_acc=[]

avg_v_loss = []

avg_v_acc = []

ep = []

print('Starting training..')

for e in range(0, epochs):

    ep.append(e+1)

    print('='*20)

    print(f'Starting epoch {e + 1}/{epochs}')

    print('='*20)

    train_loss = 0.

    val_loss = 0.

    train_accuracy = 0

    total_train = 0

    correct_train = 0

    model.train() # set model to training phase

    for train_step, (images, labels) in enumerate(dl_train):

        optimizer.zero_grad()

        outputs = model(images)

        _, pred = torch.max(outputs, 1)

        loss = loss_fn(outputs, labels)

        loss.backward()

        optimizer.step()

        train_loss += loss.item()

        train_loss /= (train_step + 1)

        _, predicted = torch.max(outputs, 1)

        total_train += labels.nelement()

        correct_train += sum((predicted == labels).numpy())

        train_accuracy = correct_train / total_train

        t_loss.append(train_loss)

        t_acc.append(train_accuracy)

        

        if train_step % 20 == 0:

            print('Evaluating at step', train_step)

            print(f'Training Loss: {train_loss:.4f}, Training Accuracy: {train_accuracy:.4f}')

            accuracy = 0.  

            model.eval() # set model to eval phase

            for val_step, (images, labels) in enumerate(dl_test):

                outputs = model(images)

                loss = loss_fn(outputs, labels)

                val_loss += loss.item()

                _, preds = torch.max(outputs, 1)

                accuracy += sum((preds == labels).numpy())

            val_loss /= (val_step + 1)

            accuracy = accuracy/len(test_dataset)

            print(f'Validation Loss: {val_loss:.4f}, Validation Accuracy: {accuracy:.4f}')

            v_loss.append(val_loss)

            v_acc.append(accuracy)

            show_preds()

            model.train()

            if accuracy > b_acc:

              b_acc = accuracy

                                

    avg_t_loss.append(sum(t_loss)/len(t_loss))

    avg_v_loss.append(sum(v_loss)/len(v_loss))

    avg_t_acc.append(sum(t_acc)/len(t_acc))

    avg_v_acc.append(sum(v_acc)/len(v_acc))

    

best_model_wts = copy.deepcopy(model.state_dict())

print('Best validation Accuracy: {:4f}'.format(b_acc))            

print('Training complete..')



plt.plot(ep, avg_t_loss, 'g', label='Training loss')

plt.plot(ep, avg_v_loss, 'b', label='validation loss')

plt.title('Training and Validation loss for each epoch')

plt.xlabel('Epochs')

plt.ylabel('Loss')

plt.legend()

#plt.savefig('/gdrive/My Drive/Research_Documents_completed/MobileNet/mobilenet_loss.png')

plt.show()

plt.plot(ep, avg_t_acc, 'g', label='Training accuracy')

plt.plot(ep, avg_v_acc, 'b', label='validation accuracy')

plt.title('Training and Validation Accuracy for each epoch')

plt.xlabel('Epochs')

plt.ylabel('Accuracy')

plt.legend()

#plt.savefig('/gdrive/My Drive/Research_Documents_completed/MobileNet/mobilenet_accuarcy.png')

plt.show()

#torch.save(model.state_dict(),'/gdrive/My Drive/Research_Documents_completed/MobileNet/mobilenet.pt')

#confsuion matrix
nb_classes = 2
device = torch.device(“cuda:0” if torch.cuda.is_available() else “cpu”)
confusion_matrix = torch.zeros(nb_classes, nb_classes)
with torch.no_grad():
for i, (inputs, classes) in enumerate(dl_test):

    inputs = inputs.to(device)

    classes = classes.to(device)

    outputs = model(inputs)

    _, preds = torch.max(outputs, 1)

    for t, p in zip(classes.view(-1), preds.view(-1)):

            confusion_matrix[t.long(), p.long()] += 1

print(confusion_matrix)
tensor([[1407.,   10.],
[  17., 1327.]])