This is Haleuan’s Neverland

Gatsby believed in the green light, the orgastic future that year by year recedes89 before us. It eluded90 us then, but that’s no matter–tomorrow we will run faster, stretch out our arms farther…. And one fine morning.

So we beat on, boats against the current, borne back ceaselessly into the past.

Linux 生存指南:Vim, Nano 与 Tmux

Vim 功能 命令行文本编辑器:Vim 是一个强大的命令行文本编辑器,适用于多种操作系统。 自动识别编程语言:根据文件扩展名自动识别编程语言,支持代码高亮、自动缩进等功能。 使用方式: 命令:vim filename 如果文件存在,则打开该文件;如果文件不存在,则创建一个新文件并命名为 filename。 模式 Vim 包含三种主要模式: ...

August 26, 2025 · Haleuan

Linux 生存指南:进程与定时任务

Crontab 常用速查指南(OpenWRT / Linux) 1) 基本概念 cron:定时任务守护进程 crontab:用户级任务表(每个用户一份) 任务格式:分 时 日 月 周 命令 2) 常用命令 查看当前用户任务:crontab -l 编辑当前用户任务:crontab -e 删除当前用户任务:crontab -r 查看 cron 服务状态(OpenWRT):/etc/init.d/cron status 启动 cron(OpenWRT):/etc/init.d/cron start 开机自启(OpenWRT):/etc/init.d/cron enable 重启 cron(OpenWRT):/etc/init.d/cron restart 3) 时间字段速记(分时日月周) 分:0-59 时:0-23 日:1-31 月:1-12 周:0-7(0/7 都表示周日;1=周一 … 6=周六) 4) 通配与步进写法 *:任意值 ,:列举多个值(如 1,15) -:范围(如 1-5) /:步进(如 */5 表示每 5 分钟) 示例: ...

August 26, 2025 · Haleuan

Linux 生存指南:网络配置与管理

nmcli 连接 Wi-Fi 命令备忘录 任务 命令 扫描网络 nmcli device wifi list 连接网络 sudo nmcli dev wifi connect "SSID" password "PASS" 查看活动连接 nmcli con show --active 查看所有已存连接 nmcli con show 断开连接 sudo nmcli dev disconnect wlan0 连接已存网络 sudo nmcli con up "连接名" 删除已存网络 sudo nmcli con del "连接名" 关闭/开启 Wi-Fi nmcli radio wifi off/on 方法一:使用 nmcli 创建热点 (推荐) nmcli 是 NetworkManager 的命令行客户端,是管理网络连接的现代标准。用它来创建热点相对简单直观。 ...

August 26, 2025 · Haleuan

Linux 生存指南:文件传输与进度监控

mv, cp 进度显示 rsync 复制单个文件: 1 2 3 4 # -a: 归档模式,保留文件所有属性(权限、时间戳等) # -h: human-readable,以人类可读的格式显示大小 (e.g., GB, MB) # -P: 显示进度 (progress) 并且支持断点续传 (partial) rsync -ahP /path/to/source/very_large_dataset.zip /path/to/destination/ 复制整个目录: ...

August 26, 2025 · Haleuan

PyTorch 核心概念与踩坑记录

Quickstart: Creating Models 使用 accelerator 进行加速: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 import torch import torch.nn as nn device = torch.accelerator.current_accelerator().type if torch.accelerator.is_available() else "cpu" print(f"Using {device} device") # Define model class NeuralNetwork(nn.Module): def __init__(self): super().__init__() self.flatten = nn.Flatten() self.linear_relu_stack = nn.Sequential( nn.Linear(28*28, 512), nn.ReLU(), nn.Linear(512, 512), nn.ReLU(), nn.Linear(512, 10) ) def forward(self, x): x = self.flatten(x) # model 的实际输入是在这里发生 logits = self.linear_relu_stack(x) return logits model = NeuralNetwork().to(device) print(model) 在 PyTorch(以及大多数深度学习框架)的习惯里,forward 函数接收的输入默认是整个 batch 的数据,而不是单个样本。 ...

July 6, 2025 · Haleuan

FastAPI 入门与 HTTP 协议基础

Quickstart e.g 1 2 3 4 5 6 7 8 9 10 11 12 13 from typing import Union from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"} @app.get("/items/{item_id}") def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} 创建 FastAPI 实例: 1 app = FastAPI() 在这一步,创建了一个 FastAPI 应用的实例,它将用于定义和管理应用的各个组件,包括路由。FastAPI 是FastAPI框架的主要类。 2. 定义根路径 / 的路由操作 ...

May 8, 2025 · Haleuan

马尔可夫链与隐马尔可夫模型

前言 马尔可夫链(Markov Chain)可以说是机器学习和人工智能的基石,在强化学习、自然语言处理、金融领域、天气预测、语音识别方面都有着极其广泛的应用 ...

May 8, 2025 · Haleuan

论文精读 | Simple Is Effective

Metadata Title: Simple Is Effective: The Roles of Graphs and Large Language Models in Knowledge-Graph-Based Retrieval-Augmented Generation Venue: ICLR 2025 Source Code: Github TL;DR Motivation: Retriever效率和准确性之间的平衡。 知识的结构信息没有被充分利用 Sections The SubgraphRAG Framework 图的建立 Given a training set of question-answer pairs D, the subgraph retriever learning problem can be formulated as the following problem: ...

April 17, 2025 · Haleuan

AutoGen学习笔记

AutoGen的安装 基于conda 1 2 3 4 5 conda create -n pyautogen python=3.10 conda activate pyautogen # (optional, run on jupyter) conda install ipykernel -y # (optional, formatter plugin) conda install black -y pip install pyautogen 常见概念 OAI_CONFIG_LIST 调用OpenAI的API常用配置文件,用于指定如何连接到OpenAI的服务,比如API密钥、端点URL等信息。 ...

September 4, 2024 · Haleuan