Consistency Models 阅读笔记

简介

Diffusion models需要多步迭代采样才能生成一张图片,这导致生成速度很慢。一致性模型(Consistency models)的提出是为了加速生成过程。
Consistency models可以直接一步采样就生成图片,但是也允许进行多步采样来提高生成的质量。
Consistency models可以从预训练的扩散模型蒸馏得到,也可以作为独立的生成模型从头训练得到。

PF ODE

论文中考虑的PF ODE(Probability Flow Ordinary Differential Equation)形式如下:
d x t d t = − t s ϕ ( x t , t ) \frac{d \mathbf x_t}{d t} = -ts_\phi(\mathbf x_t, t) dtdxt=tsϕ(xt,t)其中 s ϕ ( x t , t ) ≈ ∇ log ⁡ p t ( x ) s_\phi(\mathbf x_t, t) \approx \nabla\log p_t(\mathbf x) sϕ(xt,t)logpt(x)是分数函数, t ∈ [ 0 , T ] t \in [0, T] t[0,T]
从初始分布 x ^ T ∼ N ( 0 , T 2 I ) \mathbf{\hat x_T} \sim \mathcal N(\mathbf 0, T^2 \mathbf I) x^TN(0,T2I)中采样,然后逆向求解ODE,得到的 x ^ 0 \mathbf{\hat x_0} x^0是近似服从数据分布的样本。值得注意的是,为了保证数值稳定,在本文中用 x ^ ϵ \mathbf{\hat x_\epsilon} x^ϵ当做最后的近似样本, ϵ \epsilon ϵ是一个接近0的小正数。

一致性模型(Consistency models)

给定一个PF ODE(Probability Flow Ordinary Differential Equation) { x t } t ∈ [ ϵ , T ] \{\mathbf x_t\}_{t\in[\epsilon, T]} {xt}t[ϵ,T],一致性函数(consistency function)被定义为 f : ( x t , t ) → x ϵ f:(\mathbf x_t, t) \rightarrow \mathbf x_\epsilon f:(xt,t)xϵ,其中 ϵ \epsilon ϵ是一个接近0的小正数,是ODE求解器停止的位置。一致性函数具有self-consistency性质,即对于PF ODE轨迹上的任意点输出都是一样的。一致性模型 f θ f_\theta fθ的是从数据中估计的一致性函数。

给一个训练好的一致性模型 f θ ( ⋅ , ⋅ ) f_\theta(\cdot, \cdot) fθ(,),可以通过一致性模型一步生成了结果:首先从初始分布中采样 x ^ T ∼ N ( 0 , T 2 I ) \mathbf{\hat x_T} \sim \mathcal N(\mathbf 0, T^2 \mathbf I) x^TN(0,T2I),然后用一致性模型计算 x ^ ϵ = f θ ( x ^ T , T ) \mathbf{\hat x_\epsilon} = f_\theta(\mathbf{\hat x_T}, T) x^ϵ=fθ(x^T,T)。也可以调用一致性模型多次生成更准确的结果,如Algorithm 1所示,迭代的去噪和添加噪声。
在这里插入图片描述
Consistency models的训练算法有两种,一种是从预训练的扩散模型蒸馏(Algorithm 2),一种是作为独立的生成模型从头训练(Algorithm 3)。
在这里插入图片描述
感觉一致性模型和EDM1有共同之处,在每一步中都想恢复出 x 0 \mathbf x_0 x0,但是一致性模型训练时优化的目标是self-consistency性质,通过self-consistency性质来在保证每一步中都能直接恢复出 x 0 \mathbf x_0 x0


  1. 《Elucidating the design space of diffusion-based generative models》 ↩︎

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Consistency models are used in distributed computing systems to define the level of consistency that is maintained across different copies of the same data. These models determine how updates to the data are propagated to other copies and how conflicts are resolved when multiple copies are updated simultaneously. There are several consistency models, including: 1. Strong consistency: In this model, all copies of the data are updated synchronously and all updates are visible to all nodes at the same time. This model guarantees that all nodes see the same version of the data at the same time. 2. Weak consistency: In this model, updates are not propagated synchronously and different nodes may have different views of the data at any given time. This model allows for faster updates but may result in temporary inconsistencies. 3. Eventual consistency: In this model, updates are propagated asynchronously and nodes eventually converge to a consistent view of the data. This model allows for high availability and scalability but may result in temporary inconsistencies. 4. Causal consistency: In this model, updates are propagated in a causally consistent manner, meaning that updates that are causally related are propagated in the same order to all nodes. This model provides a compromise between strong and eventual consistency. 5. Read-your-writes consistency: In this model, a node always reads its own writes. This model guarantees that a node will always see its own writes, but may not see the writes of other nodes immediately. Each consistency model has its own trade-offs between performance, availability, and consistency. The choice of consistency model depends on the specific requirements of the application and the underlying distributed system.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值