Changchun Master Li

用 numpy 实现一个简单的 SVM 线性分类器

统计学习

SVM 有软间隔和硬间隔之分, 可以朴素的把 折叶损失函数 作为损失函数, 很容易实现. 不到一百行就能写出一个简单的 SVM 分类器.

Read more

闲聊for循环的循坏边界

programming
1
2
3
4
5
6
7
// 1
for(int i = 0; i < n; ++ i)
{ ... }

// 2
for(int i = 0; i <=n; ++ i)
{ ... }
Read more

用代码感受 CPython 垃圾回收机制

Python

初步探索

编程中最常见的赋值语句也很有内涵,变量名就像一个handle,间接控制对象。id函数可以获取对象的真实地址,相同地址即同一对象,(ob1 is ob2) 等价于 (id(ob1) == id(ob2))。我们可以利用id和is探索赋值语句。

Read more

共轭梯度法
Conjugate gradient method

统计学习

共轭梯度法的地位与范畴

凸优化在机器学习中应用非常广泛, 发展到今天, 理论已经非常成熟.
凸优化可以再细分为 无约束优化, 等式约束优化 和 不等式约束优化

Read more

在寿终正寝路上的 SysVinit

Linux

We don’t execute people just because they are old, and worship people just because they are new.

随着 systemd 出现, sysvinit 开始淡出主流的发行版. 但 sysvinit 极为简单, 使用 sysvinit 只需要一点 bash 基础和一些基本的文件操作, 不需要学习额外的知识. sysvinit 小而美但功能简单, 仍然是一个不错的选择.

Read more

低成本物联网解决方案esp8266

esp8266
moved to http://blog.74ls74.org/2022/06/18/20220618_esp8266_esp01_basic_tutorial/
Read more

leetcode 215 Kth Largest Element in an Array
数组中找出第 K 大的数

algorithm leetcode

这是算法导论第九章 randomized-select 的经典问题, 解决方法有很多种

Read more

用 Gentoo Linux 打造开源 "Chrome OS"

Linux Gentoo

我有一个小笔记本ThinkPad X61, 我常常带着它去图书馆. 因为洋垃圾被偷了也不心疼 ; )
我对它的要求只有一个, 那就是能开网页, 方便查资料.

我最终寄托于 Gentoo 的灵活性. 跟着 handbook 安装一个 X without Display Manager 的系统并不难, 垃圾笔记本的死灰复燃却让我欣喜不已. 这大概是 FOSS 带给我们的快乐吧.

Read more

logistic regression(逻辑斯蒂回归) 数学原理

统计学习

Introduction

一个概率分类器, 输入为X, 预测输出y. 有两种方式去构造, 一种是类似朴素贝叶斯的生成模型, 这类模型为联合概率 建模; 还有一种是判别模型,直接为 建模.

logistics回归是一个经典的二分类模型.

Read more

一张表看懂 Longest increasing subsequence (最长递增子序列) and leetcode 354. Russian Doll Envelopes

algorithm leetcode

LIS

转换为最长公共子序列问题的方法暂且不表, 下面用一个表举例说明dp解法.

假设存在一个序列 A[8] = {2, 1, 5, 3, 6, 4, 8, 9, 7}, 可以看出来它的一个LIS是 {1, 3, 4, 8, 9}

其长度为5。

循环数

dp数组就是存储对应长度LIS的最小末尾

Read more
← Prev Next →