tn = ((labels == zero) * (pred == zero)).sum()
tp = ((labels == one) * (pred == one)).sum()
fp = ((labels == zero) * (pred == one)).sum()
fn = ((labels == one) * (pred == zero)).sum()
test_sum_fn += fn.item()
test_sum_fp += fp.item()
test_sum_tn += tn.item()
test_sum_tp += tp.item()
sum_loss += loss.item()
sum_correct += acc.item()
test_precision = test_sum_tp * 1.0 / (test_sum_fp + test_sum_tp)
test_recall = test_sum_tp * 1.0 / (test_sum_fn + test_sum_tp)
test_loss = sum_loss * 1.0 / len(testDataLoader)
test_correct = sum_correct * 1.0 / len(testDataLoader) / batch_size
writer.add_scalar(“test loss“, test_loss, global_step=epoch + 1)
writer.add_scalar(“test correct“, test_correct, global_step=epoch + 1)
writer.add_scalar
(“test precision“, test_precision, global_step=epoch + 1)
writer.add_scala
r(“test recall“, test_recall, global_step=epoch + 1)
print(“epoch is“, epoch, “train loss“, train_loss, “train correct“, train_correct, “test loss is “,
test_loss, “test correct is: “, test_correct, “train_precision: “, train_precision, “test_precision: “,
test_precision, “train_recall: “, train_recall, “test_recall: “, test_recall)
writer.close()
可以说非常之高大粗壮,也给山里面人带来了很多不便,为了开发山里面的土地,或者给山里面阳光,村民决定砍伐这棵树。他们砍了整整一天,给树砍了,一股七彩的光芒就飞进了树林。村民就非常爽,晚上就抱着他们女朋友进入了甜蜜的梦乡。
可第二天他们发现树又长回来了,这次不是python这次是特么java。他们又砍树,但第二天又长出来了,这树C,C++-->>