【2025版李宏毅机器学习系列课程】CH2 机器学习 Training Guide

作业流程

General Guide

  • model bias:增加模型的flexibility,比如激活函数、更多层数等
  • model bias 还是 optimization ?
    • comparison
    • Start from shallower network (or other models), which are easier to optimize
    • If deeper networks do not obtain smaller loss on training data, then there is optimization issue.
  • Overfitting:flexibility太大,training data不够多导致的
    • more training data:
      • data augmentation 数据增强,对现有数据进行各种变换来生成更多数据,要合理变换
    • less flexibility , constrained model:
      • Less parameters:less神经元、less层数
      • sharing parameters:CNN
      • Less features
      • Early stopping
      • Regularization
      • Dropout

Bias-Complexity Trade-off

  • benchmark corpora:基准测试语料库
  • how to select the best one?
    • 不建议的做法:直接比较model 在 public testing set的分数来选择。WHY?类比猴子敲出莎士比亚,如果test很多遍,即使是很废模型,还是有可能拿到好分数
    • testing set分public和private:public one 可以看成是训练时会用的,private one可以理解为实际放出来给大众用的,在public testing set上表现好可能是用了某些手段导致在此过拟合,但是在private testing set的表现不好
    • 建议的做法:cross validation,用validation set 来选model,少看public testing set的结果
    • n-fold cross validation

Mismatch

  • training and testing data have different distribution

critical point:local minima、saddle point

  • gradient为0的点统称critical point:比如local minima、saddle point
  • 判断critical point的类型:Hessian
  • saddle point:可以沿着负特征值的特征向量去更新参数
  • local minima:When you have lots of parameters, perhaps local minima is rare
    可能在高维空间只是个saddle point
  • 经验上看,其实local minima其实不常见,多数是saddle point

Batch

  • shuffle after each epoch

  • Why batch? 如果不用batch,那就是整个training set一起训练,相当于batch size = training set size,即极端情况的large batch

    • Small Batch v.s. Large Batch

      • large batch:Long time for cool down, but powerful(稳定)
      • small batch:Short time for cool down, but powerful but noisy
    • 时间上,large batch 跑完一个epoch的时间反而短,因为GPU并行运算的能力

    • 但noisy反而会有利于training

    • 而且 Small batch is better on testing data,大的batch size会让我们倾向于走到峡谷里面

  • 总结:Batch size is a hyperparameter you have to decide

相关推荐
咚咚王者5 分钟前
人工智能之数学基础 概率论与统计:第二章 核心定理
人工智能·概率论
式5166 分钟前
线性代数(九)线性相关性、基与维数
线性代数·算法·机器学习
小徐Chao努力7 分钟前
Spring AI Alibaba A2A 使用指南
java·人工智能·spring boot·spring·spring cloud·agent·a2a
啊阿狸不会拉杆7 分钟前
《数字图像处理》第7章:小波变换和其他图像变换
图像处理·人工智能·python·算法·机器学习·计算机视觉·数字图像处理
yiersansiwu123d7 分钟前
生成式AI重构内容生态,人机协同定义创作新范式
大数据·人工智能·重构
老蒋新思维9 分钟前
创客匠人:从个人IP到知识变现,如何构建可持续的内容生态?
大数据·网络·人工智能·网络协议·tcp/ip·创客匠人·知识变现
HyperAI超神经15 分钟前
GPT-5全面领先,OpenAI发布FrontierScience,「推理+科研」双轨检验大模型能力
人工智能·gpt·ai·openai·benchmark·基准测试·gpt5.2
老蒋新思维19 分钟前
创客匠人洞察:从“个人品牌”到“系统物种”——知识IP的终极进化之路
网络·人工智能·网络协议·tcp/ip·重构·创客匠人·知识变现
阿杰学AI22 分钟前
AI核心知识57——大语言模型之MoE(简洁且通俗易懂版)
人工智能·ai·语言模型·aigc·ai-native·moe·混合专家模型
珠海西格电力26 分钟前
零碳园区边缘计算节点规划:数字底座的硬件部署与能耗控制方案
运维·人工智能·物联网·能源·边缘计算