标准化-归一化-BN-激活函数

标准化、归一化,用于数据预处理,一般是将原始数据统一刻度,预防原始数据差异较大带来的反向传播时的梯度爆炸。 具体刻度根据所应用的公式而不同。 Min-Max Scaling公式是,将数值归一化到[0,1]内 $x' = \frac{x - \min(x)}{\max(x) - \min(x)}$ 而Z-score 公式根据实际数据将数值标准化到一定范围内 $z = \frac{x - \mu}{\sigma}$,由于每个值都减去均值,故标准化后均值为0,那为何标准化后标准差为1?实际上这种标准化在实践中也被中称为Normalization 特性 归一化 (Normalization) 标准化 (Standardization) 典型做法 Min-Max Scaling Z-score Normalization 计算公式 $x' = \frac{x - \min}{\max - \min}$ $z = \frac{x - \mu}{\sigma}$ 数值范围 严格限制在 $[0, 1]$ 或 $[-1, 1]$ 无固定范围(通常在 $[-3, 3]$ 之间) 数据中心 不固定 严格以 0 为中心 对异常值 非常敏感(一个极大值会把其他数压扁) 较稳健(异常值只影响均值,不至于摧毁范围) Batch Normalization 对每个Batch的神经网络输出做(特别的)Normalization,注意这里的g,b是不是标量 Batch Size = 每次神经网络输入的数据数量;epoch = 总样本量 / Batch Size ...

January 19, 2026 · 1 min · 72 words · Bob

mamba-vision

NVIDIA-MambaVision 摘要 主要工作:integrating Vision Transformers (ViT) with Mamba, 目的:improves its capacity to capture long-range spatial dependencies 适用于哪些下游任务:object detection, instance segmentation,and semantic segmentation 开源链接:GitHub - NVlabs/MambaVision: [CVPR 2025] Official PyTorch Implementation of MambaVision: A Hybrid Mamba-Transformer Vision Backbone 引言 transformer训练成本高:the quadratic complexity of the attention mechanism with respect to sequence length makes Transformers computationally expensive to train and deploy 本篇的前置知识:Vit、Mamba、SSM 等 Mamba 通过 new State Space Model (SSM) 关注该关注的,通过ardware-aware considerations并行计算:new State Space Model (SSM) that achieves linear time complexity,enables efficient input-dependent processing of long sequences with ardware-aware considerations. ...

January 11, 2026 · 3 min · 503 words · Bob

输入-输出-实验结果

问题:它的输入是什么?它的输出是什么?它是怎么得到这个输出的?它的效果怎样么? UNet OutPut 输出:一个与原图大小相同的多通道图,通道数对应分类数,每个通道图像的像素点都有一个概率,表示当前像素点预测为此类的概率 但是记住,原论文中的输入大小为572 * 572 * 1 ,输出为 338 * 338 * 2,为何这样呢? 源于作者,没有做0填充(现代做法是执行卷积前0填充),而是镜像填充,再具体一点,就是将大图划分为patch时,如果 $572 \times 572$ 的输入方框 跨越原图边界,就进行镜像填充。 寻找代码中实际的处理 镜像填充(不常用): 如果你需要填充一个像素: 零填充:| 0 | 5 | 8 | 1 | 4 | 镜像填充:| 8 | 5 | 8 | 1 | 4 |(它将 5 旁边的 8 复制到了 5 的左边,就像 5 是一面镜子反射了 8 一样。) 下面是现代填充和原文填充对比 原始 U-Net 做法 准备数据(Pre-processing): 读取超大图 ($5000 \times 5000$)。 确定要切的一个 Patch 位置。 判断位置是否在边缘。 如果是边缘 $\rightarrow$ 执行镜像填充算法(Mirror Padding)生成扩充数据。 $\leftarrow$ (就是这里!) ...

December 16, 2025 · 1 min · 163 words · Bob

A Neural Representation of Sketch Drawings

A Neural Representation of Sketch Drawings 以向量形式,生成连贯的涂鸦(低分辨率的)。 想法 以人的思维方式进行生成,具体是模拟控笔的动作:移动方向,提笔,结束绘画 什么是:unconditional and conditional generation of vector images composed of a sequence of lines. 数据 dataset 为笔画动作,每个点由5个元素表示,分别是偏移和状态,其中偏移是相对于上一个点的偏移,状态则包含:笔尖触纸、抬笔、结束绘画 方法 经过双向RNN 生成h,经过全连接层投影到$ \mu $和 $\sigma$,使用ex使得$\sigma$非负,再进行$z = \mu + \sigma \odot \mathcal{N}(0, I)$,其中$ \sigma \odot \mathcal{N}(0, I)$,是生成一个符合高斯分布的噪声,并使用$\sigma$进行放缩 为何这样做: Encoder 神经网络输出 $\mu$ 和 $\sigma$ 2,实际上是在告诉系统:“我认为这张草图在潜在空间里的位置大概在这里($\mu$),但我不太确定,允许的误差范围大概是这么大($\sigma$)。 z经过tanh ($[ h0 ; c0 ] = \tanh(W_z z + b_z)$)得到初始状态向量h0,c0,其中前者是初始隐藏状态,代表短期记忆或输出状态,后者是初始细胞状态(LSTM 特有的),代表长期记忆初始细胞状态(LSTM 特有的),代表长期记忆 hi的计算方法: 根据 $h_0$(零状态)和 $S_0$ 计算出 $h_1$。 ...

December 1, 2025 · 5 min · 965 words · Bob

NLP基础

NLP的核心任务:understanding and synthesizing NLP输入预处理 Tokenization Case folding 将输入统一大小写,以减少内存,提高效率 ,but可能创造歧义,so具体问题具体分析 For example "Green" (name) has a different meaning to "green" (colour) but both would get the same token if case folding is applied. Stop word removal 移除一些含义较少的词,同样提高效率,but可能造成语义不完整,具体问题具体分析 Examples include, "a", "the", "of", "an", "this","that".For some tasks like topic modelling (identifying topics in text), contextual information is not as important compared to a task like sentiment analysis where the stop word "not" can change the sentiment completely. ...

November 21, 2025 · 2 min · 221 words · Bob

Transformer

1. 理论 输入 embedding words turning each input word into a vector using an embedding algorithm. 问题:The size of this list is hyperparameter we can set – basically it would be the length of the longest sentence in our training dataset. 最底层的编码器输入是 embedding words,其后都是其他编码器的输出 In the bottom encoder that would be the word embeddings, but in other encoders, it would be the output of the encoder that’s directly below BERT实践中也提到了这个,可以查看下 ...

November 20, 2025 · 8 min · 1690 words · Bob
微信二维码

扫一扫,加我微信