Regularization (正则化)
Why
主要目标:防止过拟合,通过显式或隐式约束模型复杂度,提升泛化性能。
次要目标:可能加速训练(如L2稳定优化)。
In mathematics, statistics, finance,[1] and computer science, particularly in machine learning and inverse problems, regularization is a process that converts the answer of a problem to a simpler one. It is often used in solving ill-posed problems or to prevent overfitting.[2]
What
Explicit Regularization
直接修改损失函数或模型结构。
Example
L1/L2正则化:在损失函数中添加参数惩罚项。
Elastic net regularization: combines L1 and L2 panalties.
Drop ...
Normalization (归一化)
Why
In typical neural networks, the activations of each layer can vary drastically, leading to issues like exploding or vanishing gradients, which slow down training.
主要目标:稳定训练过程,解决内部协变量偏移(Internal Covariate Shift),加速收敛。
次要影响:可能间接提升泛化(非主要目的)。
Normalization is often used to:
increase the speed of training convergence,
reduce sensitivity to variations and feature scales in input data,
reduce overfitting,
and produce better model generalization to unseen data.
What
对数据分布的操作: ...
Development
未读软件开发中的项目组织方式
以下是软件开发中常见的 5 种项目组织方式 的详细总结与示例说明,涵盖从传统到现代的最佳实践:
1. 前后端完全分离
特点:
• 前端与后端为独立仓库
• 通过 HTTP API/Swagger 文档交互
• 部署完全独立
示例结构:
# 前端仓库(Vue/React)frontend-repo/ ├── src/ │ ├── api/ # 手动维护API调用 │ └── views/ └── package.json# 后端仓库(Go/Java)backend-repo/ ├── cmd/ │ └── server/ # 启动入口 ├── pkg/ # 可复用库 └── go.mod
适用场景:
• 团队技术栈差异大(如前端 React + 后端 Java)
• 项目需独立版本发布(如前端每周迭代,后端每月发布)
典型案例:
• GitLab 前端 与 后端 分离
• 电商平台(前端托管在 CDN,后端微服务集群)
2. Monorepo(单体仓库)
特点:
• 所有项目 ...