随笔分类 -  数学

摘要:http://joschu.net/blog/kl-approx.html KL近似计算代码: https://github.com/THUDM/slime/blob/main/slime/utils/ppo_utils.py KL 散度定义 标准的 k1 估计KL 散度, 方差大, 应为k1 有正 阅读全文
posted @ 2025-10-29 14:49 bregman 阅读(13) 评论(0) 推荐(0)
摘要:双样本T检验代码, 对应数学原理 https://online.stat.psu.edu/stat415/lesson/11/11.2 import numpy as np # noqa from scipy import stats from scipy.stats import beta bas 阅读全文
posted @ 2023-10-11 16:17 bregman 阅读(110) 评论(0) 推荐(0)
摘要:### online mirror descent algorithm * 参考 https://tlienart.github.io/posts/2018/10/27-mirror-descent-algorithm/ * 这本书有详细介绍 http://www.cs.cmu.edu/afs/cs 阅读全文
posted @ 2023-09-08 14:25 bregman 阅读(29) 评论(1) 推荐(0)
摘要:* 行列式 $ \begin{array}{|cc|} a_1 & a_2 \\\\ b_1 & b_2 \end{array} = a_1b_2 - b_1a_2$ 的几何意义, 等于下面平行四边形OPGQ的面积. 根据辅助线可以简单证明。 ![image](https://img2023.cnb 阅读全文
posted @ 2023-09-07 10:35 bregman 阅读(39) 评论(0) 推荐(0)
摘要:以下摘自 https://zhuanlan.zhihu.com/p/642693808 * 考虑一个可微函数 $f: \mathbb{R}^{n} \rightarrow \mathbb{R}, \operatorname{dom} f=\mathbb{R}^{n}$ 对某一点 $\left(x_{ 阅读全文
posted @ 2023-09-06 14:58 bregman 阅读(1510) 评论(0) 推荐(0)
摘要:* ortools 中提供了一个文档介绍快速具体算法 https://developers.google.cn/optimization/lp/lp_advanced?hl=en 其中实现了一个迭代法 PDLP, 对于低精度,以及给定初值的情况应该比较有利。 文档没有提供例子, 但代码路中有例子: 阅读全文
posted @ 2023-07-26 01:00 bregman 阅读(457) 评论(1) 推荐(0)
摘要:读论文 Sequential Recommendation with Probabilistic Logical Reasoning 中碰到的问题。 结论大概是这样: 对于Beta分布,KL散度的公式为: $$D_{KL}(Beta(\alpha_1, \beta_1)||Beta(\alpha_2 阅读全文
posted @ 2023-04-27 15:31 bregman 阅读(320) 评论(0) 推荐(0)
摘要:![image](https://img2023.cnblogs.com/blog/698752/202302/698752-20230203135515320-35298912.png) * https://homepages.inf.ed.ac.uk/imurray2/pub/16choldif 阅读全文
posted @ 2023-02-03 13:57 bregman 阅读(45) 评论(1) 推荐(0)
摘要:* https://mathworld.wolfram.com/IncompleteGammaFunction.html#:~:text=is%20the%20exponential%20sum%20function,z%5D%20in%20the%20Wolfram%20Language.&tex 阅读全文
posted @ 2022-03-21 14:18 bregman 阅读(117) 评论(0) 推荐(0)
摘要:《统计计算》书中, 包含 maxima 介绍, julia 语言介绍 https://www.math.pku.edu.cn/teachers/lidf/docs/statcomp/html/_statcompbook/maxima.html 阅读全文
posted @ 2022-02-22 10:52 bregman 阅读(138) 评论(0) 推荐(0)
摘要:* 北大, 《最优化:建模、算法与理论》, 2020 , https://bicmr.pku.edu.cn/~wenzw/optbook/opt1.pdf * 问题: 有哪些经典的问题是非凸的, 但是有最优解算法? 特征值问题 虽然看上去是非凸的, 但可以转化为凸的, 见 https://www.c 阅读全文
posted @ 2022-02-22 10:27 bregman 阅读(1703) 评论(0) 推荐(0)
摘要:## 对偶问题 * 原问题 $$ \begin{align} \min_{x \in \cal D} f(x) \end{align} $$ 其中 ${\cal D} = \{x \in X: g_i(x) \leq 0, \ \ i = 1,2,\cdots, m\}$​. 一般的,这里$X = 阅读全文
posted @ 2021-08-30 14:10 bregman 阅读(462) 评论(1) 推荐(0)
摘要:* https://wrfranklin.org/Research/Short_Notes/pnpoly.html 阅读全文
posted @ 2021-06-23 14:29 bregman 阅读(36) 评论(0) 推荐(0)
摘要:# 定义 * 函数 $f:\mathbb{R}^n\to\mathbb{R},$ 它在点 $x \in \mathbb{R}^n$上的梯度定义为 $\mathrm{grad}_x(f):=\left[\frac{\partial f}{\partial x_1},\frac{\partial f}{ 阅读全文
posted @ 2021-06-21 11:18 bregman 阅读(354) 评论(0) 推荐(0)
摘要:如果 $A$ 是大小为 $m \times n$ 的实矩阵, $A$的精简形式的SVD分解为 $A = U\Sigma V^T$. 那么$A$的零空间,列空间, 行空间 分别为 ${\cal N}(A) = {\rm span}(V)^\perp$, ${\cal R}(A) = {\rm span 阅读全文
posted @ 2021-06-08 13:46 bregman 阅读(255) 评论(0) 推荐(0)
摘要:当前最新版本 5.44, 系统:macOS ### 安装 macports * 下载 MacPorts-2.6.4_1-11-BigSur.pkg 安装, 需要断网, 防止中间卡死。 * 配置国内代理, 配置文件中有提示。 # /opt/local/etc/macports/sources.conf 阅读全文
posted @ 2021-03-26 11:15 bregman 阅读(307) 评论(1) 推荐(0)