摘要:
1 导入实验所需要的包 import torch import torch.nn as nn import numpy as np import torchvision import torchvision.transforms as transforms import matplotlib.pyp 阅读全文
摘要:
1 导入实验所需要的包 import torch import torch.nn as nn import numpy as np import torchvision import torchvision.transforms as transforms import matplotlib.pyp 阅读全文
摘要:
1 导入实验所需要的包 import torch import numpy as np import random from IPython import display from matplotlib import pyplot as plt from torch import nn import 阅读全文
摘要:
1导入实验所需要的包 import torch import numpy as np import random from IPython import display from matplotlib import pyplot as plt from torch import nn import 阅读全文
摘要:
1. 定义 数学公式为 Loss = -w * [p * log(q) + (1-p) * log(1-q)] ,其中p、q分别为理论标签、实际预测值,w为权重。这里的log对应数学上的ln。 PyTorch对应函数为: torch.nn.BCELoss(weight=None, size_aver 阅读全文