mirror of
https://github.com/Laurent2916/Diffusers.jl.git
synced 2024-11-12 16:18:23 +00:00
19 lines
487 B
Julia
19 lines
487 B
Julia
using Diffusers.BetaSchedules
|
|
using Test
|
|
|
|
@testset "Variance schedules tests" begin
|
|
@testset "β increases monotonically" begin
|
|
T = 1000
|
|
|
|
β_linear = linear_beta_schedule(T)
|
|
β_scaled_linear = scaled_linear_beta_schedule(T)
|
|
β_cosine = cosine_beta_schedule(T)
|
|
β_sigmoid = sigmoid_beta_schedule(T)
|
|
|
|
@test all(diff(β_linear) .>= 0)
|
|
@test all(diff(β_scaled_linear) .>= 0)
|
|
@test all(diff(β_cosine) .>= 0)
|
|
@test all(diff(β_sigmoid) .>= 0)
|
|
end
|
|
end
|