Skip to content

Commit cf0d51a

Browse files
committed
update
1 parent affb38b commit cf0d51a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1696
-120
lines changed

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"editor.minimap.enabled": true,
44
"editor.wordWrapColumn": 120,
55
"editor.defaultFormatter": "esbenp.prettier-vscode",
6-
"[javascript]": {
6+
"[javascript]": {
77
"editor.defaultFormatter": "esbenp.prettier-vscode"
88
},
99
"[markdown]": {
@@ -13,6 +13,12 @@
1313
"[xml]": {
1414
"editor.defaultFormatter": "DotJoshJohnson.xml"
1515
},
16+
"[yaml]": {
17+
"editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter"
18+
},
19+
"[helm]": {
20+
"editor.defaultFormatter": "kennylong.kubernetes-yaml-formatter"
21+
},
1622
"[solidity]": {
1723
"editor.defaultFormatter": "JuanBlanco.solidity"
1824
},

notes/ai/ai-awesome.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,30 @@ tags:
2626
- MIT, TS
2727
- AI-powered search engine
2828
- alternative to Perplexity
29+
- [zaidmukaddam/scira](https://github.com/zaidmukaddam/scira)
30+
- MIT, TS
31+
- MiniPerplx -> scira
32+
- minimalistic AI-powered search engine
2933
- Web/SDK/UI
3034
- [vercel/ai](https://github.com/vercel/ai)
3135
- Apache-2.0, TS
3236
- npm:ai
3337
- Build AI-powered applications with React, Svelte, Vue, and Solid
3438
- [xenova/transformers.js](https://github.com/xenova/transformers.js)
3539
- Apache-2.0, JS
36-
- Client/Desktop
40+
- Client/Desktop/App
3741
- [chatbox](./service/chatbox.md)
3842
- GPLv3, TypeScript, React, Electron
3943
- 支持 Desktop, iOS, Android, Web
4044
- [mckaywrigley/chatbot-ui](https://github.com/mckaywrigley/chatbot-ui)
4145
- MIT
4246
- [CherryHQ/cherry-studio](https://github.com/CherryHQ/cherry-studio)
4347
- ~~Apache-2.0~~, TS
48+
- [mainframecomputer/fullmoon-ios](https://github.com/mainframecomputer/fullmoon-ios)
49+
- MIT, Swift
50+
- [languine-ai/languine](https://github.com/languine-ai/languine)
51+
- AGPLv3, TS
52+
- CLI, 用于 i10n
4453
- WebUI/Chatbot
4554
- [vercel/ai-chatbot](https://github.com/vercel/ai-chatbot)
4655
- MIT, React
@@ -428,3 +437,9 @@ tags:
428437
- Tiered Discount Pricing
429438
- Graduated Discount Pricing
430439
- https://help.aliyun.com/zh/isi/product-overview/billing-10
440+
441+
## Learning
442+
443+
> Reading, Learning, Tutorials, 教程, 阅读资料
444+
445+
- https://github.com/NielsRogge/Transformers-Tutorials

notes/ai/ai-faq.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tags:
1111
- 量化 - Quantization
1212
- 降低精度
1313
- 减少内存占用和计算需求
14-
- 例如 FP32 -> INT8, INT4, BIT1.5
14+
- 例如 FP32,FP16 -> INT8 [-128, 127], INT4 [-8, 7], BIT1.5, FP16, BF16
1515
- 蒸馏 - Distillation
1616
- 将大型模型的知识转移到较小的模型中,实现性能接近的同时降低计算成本。
1717
- 例如 Teacher-Student
@@ -27,6 +27,19 @@ tags:
2727
- MoE - Mixture of Experts
2828
- 减少内存和计算需求
2929

30+
| size | FP32 1 | int8 | int4 | perf |
31+
| ---- | -------: | -----: | -----: | ---------------------------------------------------------------------------- |
32+
| 1B | ~4-6GB | ~2-3GB | ~1-2GB | 适用于简单任务,如基础问答、文本分类,但易出现无意义输出,复杂任务表现不佳。 |
33+
| 3B | ~12-18GB | ~6-9GB | ~3-4GB | 能处理中等复杂度任务,如简单对话、文本摘要,性能适中,但仍有限制。 |
34+
| 7B | ~28GB | ~14GB | ~7GB | 在大多数NLP任务上表现良好,如机器翻译、情感分析,性能与资源消耗较平衡。 |
35+
| 13B | ~52GB | ~26GB | ~13GB | 具备较高准确性和生成质量,适合专业领域应用,如法律、金融等。 |
36+
| 30B | ~120GB | ~60GB | ~30GB | 可处理复杂任务,如多轮对话、代码生成,性能接近人类水平。 |
37+
| 65B | ~260GB | ~130GB | ~65GB | 顶级模型,适用于前沿研究和高端应用,具备极强的语言理解和生成能力。 |
38+
39+
## Train
40+
41+
- Train Your Own O1 Preview Model Within $450
42+
- https://news.ycombinator.com/item?id=43125430
3043

3144
## AI vs ML vs DL
3245

notes/ai/ai-glossary.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,38 @@ tags:
4343
| Speech Synthesis | 语音合成 |
4444
| Voice Synthesis | 语音合成 |
4545

46+
## 精度 {#precision}
47+
48+
| type | byte | dynamic | 训练中常见用途 | GPU支持性 |
49+
| ---- | ---- | -------------: | -------------------------------------- | ---------------- |
50+
| FP64 | 8 | 极高(~10³⁰⁸) | 科学计算、极端精度需求,极少用于DL训练 | 较弱,性能低 |
51+
| FP32 | 4 | 高(~10³⁸) | 中小型模型训练,混合精度中的关键操作 | 广泛支持 |
52+
| FP16 | 2 | 低(~10⁴) | 大模型训练(需损失缩放),推理优化 | Tensor Core 加速 |
53+
| BF16 | 2 | 高(~10³⁸) | 大模型训练主流,数值稳定 | A100/H100 优化 |
54+
55+
- FP64 - Double Precision 双精度
56+
- FP32 - Single Precision 单精度
57+
- FP16 - Half Precision 半精度
58+
- BF16 / Bfloat16
59+
- Brain Floating Point 16-bit
60+
- by Google Brain
61+
- 保留了 FP32 的指数范围(8位指数),减少尾数(7位)
62+
- Float
63+
- s 符号位(Sign bit)
64+
- e 指数(Exponent)
65+
- m 尾数(Mantissa,或称为有效数/分数)
66+
67+
$$
68+
\text{FP} = (-1)^s \times 2^{e-\text{Bias}} \times (1 + m)
69+
$$
70+
71+
- 1 + m
72+
- 更明确地分开隐含位(1)和存储的小数部分(m)
73+
74+
$$
75+
\text{FP32} = (-1)^s \times 2^{e - 127} \times (1 + m)
76+
$$
77+
4678
## LLM 参数
4779

4880
- temperature

notes/ai/ml/jupyter/README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,28 @@ title: Jupyter
55
# Project Jupyter
66

77
- https://jupyter.org/
8+
- Kernel
9+
- Binder
10+
- UI/用户界面
11+
- [jupyterlab/jupyterlab](https://github.com/jupyterlab/jupyterlab)
12+
- BSD-3, TS, Python
13+
- 多文档, 插件, 内置文件浏览, 交互输出, 更高级的文本编辑
14+
- next-generation web-based user interface for Project Jupyter
15+
- [jupyter/notebook](https://github.com/jupyter/notebook)
16+
- 特点
17+
- document-centric
18+
- Notebook v7
19+
- JupyterLab components for the frontend
20+
- Jupyter Server for the Python server
21+
- Classic Notebook v6
22+
- [jupyter/nbclassic](https://github.com/jupyter/nbclassic)
23+
- nbclassic
24+
- Jupyter Console
25+
- Qt console
826
- Voilà
927
- 笔记本转换为独立的交互式网页应用程序
10-
- Binder
1128
- [jupyter/jupyter](https://github.com/jupyter/jupyter)
1229
- metapackage for installation, docs and chat
13-
- [jupyterlab/jupyterlab](https://github.com/jupyterlab/jupyterlab)
14-
- BSD-3, TS, Python
15-
- 多文档, 插件, 内置文件浏览, 交互输出, 更高级的文本编辑
16-
- next-generation web-based user interface for Project Jupyter
17-
- [jupyter/notebook](https://github.com/jupyter/notebook)
18-
- 特点
19-
- document-centric
20-
- Notebook v7
21-
- JupyterLab components for the frontend
22-
- Jupyter Server for the Python server
23-
- Classic Notebook v6
24-
- [jupyter/nbclassic](https://github.com/jupyter/nbclassic)
2530
- [Jupyter-kernels](https://github.com/jupyter/jupyter/wiki/Jupyter-kernels)
2631
- kernels -> 执行环境
2732
- [jupyter-server/jupyter_server](https://github.com/jupyter-server/jupyter_server)

notes/ai/ml/labeling.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ tags:
2222
- https://github.com/KKKSQJ/DeepLearning/tree/master/others/label_convert
2323
- https://openvinotoolkit.github.io/datumaro/latest/docs/data-formats/formats/index.html
2424
- [datumaro](./datumaro.md)
25+
- box
26+
- xywh
27+
- xywhn
28+
- xyxy
29+
- xyxyn
30+
- cycywh
2531

2632
## YOLO
2733

notes/ai/ml/ml-faq.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,3 +297,12 @@ LD_LIBRARY_PATH=/opt/conda/lib/python3.10/site-packages/nvidia/cudnn/lib/:$LD_LI
297297
- https://github.com/pytorch/pytorch/issues/104591
298298

299299
## Placeholder shape mismatches (expected 1 vs got tensorData with 2240) at dimIdx = 0
300+
301+
## transforms.Normalize
302+
303+
```py
304+
# 基于 ImageNet 的均值和标准差
305+
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
306+
```
307+
308+
- https://stackoverflow.com/a/58151903/1870054

notes/ai/ml/pytorch/pytorch-cookbook.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ device = torch.device((
3737
print(f"Using {device} device")
3838
```
3939

40+
```py
41+
device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
42+
```
43+
4044
```py
4145
# 不推荐
4246
torch.set_default_device(device)

notes/ai/ocr/doclayout-yolo.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,58 @@ tags:
1919
- table_footnote
2020
- isolate_formula
2121
- formula_caption
22+
23+
```python
24+
#%%
25+
from doclayout_yolo import YOLOv10
26+
from huggingface_hub import hf_hub_download
27+
28+
# model = YOLOv10.from_pretrained("juliozhao/DocLayout-YOLO-DocStructBench")
29+
filepath = hf_hub_download(repo_id="juliozhao/DocLayout-YOLO-DocStructBench",
30+
filename="doclayout_yolo_docstructbench_imgsz1024.pt")
31+
model = YOLOv10(filepath)
32+
#%%
33+
import torch
34+
35+
device = torch.device((
36+
"cuda"
37+
if torch.cuda.is_available()
38+
else "mps"
39+
if torch.backends.mps.is_available()
40+
else "cpu"
41+
))
42+
det_res = model.predict("input/2003-D30-000-0013.jpg", imgsz=1024, device=device)
43+
44+
#%%
45+
import cv2
46+
47+
annotated_frame = det_res[0].plot(pil=True, line_width=5, font_size=20)
48+
cv2.imwrite("result.jpg", annotated_frame)
49+
#%%
50+
result = det_res[0]
51+
table_class_id = None
52+
for id, name in det_res[0].names.items():
53+
if name == "table":
54+
table_class_id = id
55+
break
56+
table_class_id
57+
#%%
58+
table_boxes = []
59+
for i, cls in enumerate(result.boxes.cls):
60+
if int(cls.item()) == table_class_id:
61+
# 获取表格边界框 [x1, y1, x2, y2]
62+
box = result.boxes.xyxy[i].cpu().numpy()
63+
# 获取置信度
64+
conf = result.boxes.conf[i].item()
65+
table_boxes.append({
66+
"xywh": box.tolist(),
67+
"confidence": conf
68+
})
69+
table_boxes
70+
```
71+
72+
73+
```tsx
74+
75+
76+
```

notes/ai/ocr/ocr-awesome.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,17 @@ tags:
8181
- license plates
8282
- https://news.ycombinator.com/item?id=37384327
8383
- https://github.com/kba/awesome-ocr
84+
- [deepdoctection/deepdoctection](https://github.com/deepdoctection/deepdoctection)
85+
- Apache-2.0, Python
86+
- 用到了很多东西,可以作为参考
87+
- LayoutLM
88+
- https://huggingface.co/docs/transformers/en/model_doc/layoutlm
89+
- https://medium.com/@shivarama/layoutlmv3-from-zero-to-hero-part-1-85d05818eec4
90+
- DiT - Document Image Text
91+
- https://github.com/microsoft/unilm/tree/master/dit
92+
- [microsoft/unilm](https://github.com/microsoft/unilm)
93+
- MIT, Python
94+
- Large-scale Self-supervised Pre-training Across Tasks, Languages, and Modalities
95+
- Unified Language Model Pre-training
8496
- 商业
8597
- https://doc2x.noedgeai.com/

0 commit comments

Comments
 (0)