Python——常用函数、方法

基础知识

  • 带*的参数
    python函数中带 ∗ * 的参数表示接收任意个位置参数(可以不传参)
    example1:
    torch.randn(*size,…),这里要生成一个size = (1,1,3,4)的矩阵
import torch
import torch.nn as nn
input = torch.randn(1, 1, 3, 4)
print(input)

OpenCV

Deep Learning

  • 计算准确率和召回率,用来检验训练效果
    classification_report()
  • 混淆矩阵,用来检验训练效果
    confusion_matrix()
  • 二值化
    LabelBinarizer().fit_transform()
  • 数据分割,把训练集和测试集分开
    train_test_split()

猜你喜欢

转载自blog.csdn.net/weixin_44823313/article/details/112430644