排序
Deep Learning Note 39 多头注意力
import math import torch from torch import nn from d2l import torch as d2l # 缩放点积注意力 class DotProductAttention(nn.Module): def __init__(self, dropout, **kwargs): super(DotPr...
Deep Learning Note 40 Transformer
import math import torch import pandas as pd from torch import nn from d2l import torch as d2l # 基于位置的前馈网络(实际上就是一个两层的全连接) class PositionWiseFFN(nn.Module): de...
Deep Learning Note 37 注意力评分(Attention Score)
import math import torch from torch import nn from d2l import torch as d2l # 遮掩softmax操作 def masked_softmax(X, valid_lens): """通过最后一个轴上遮蔽元素来执行 sof...
Deep Learning Note 41 风格迁移
import torch import torchvision from torchvision.models import vgg19, VGG19_Weights from torch import nn from d2l import torch as d2l d2l.set_figsize() content_img = d2l.Image.open...
Flow Matching的数学原理
这篇文章介绍了Flow Matching作为一种生成模型训练方法,将其视为扩散模型的更通用形式。其核心思想是将数据视为在流场中运动的粒子,通过学习一个与时间相关的向量场来引导粒子从先验分布移动...


