Skip to content

Reconcile DDIM scheduler behavior, tests, and comments #7

Description

@blacks1ne

Summary

The DDIM implementation, inline comments, and unit-test expectations disagree, causing two default diffusion tests to fail.

Reproduction

cargo test -p klearu-diffusion

Current failures:

  • scheduler::ddim::tests::timesteps_descending
  • scheduler::ddim::tests::step_at_t0_returns_x0_pred

Evidence

The implementation now targets Diffusers-style timestep_spacing="leading", steps_offset=1, and set_alpha_to_one=false. The tests still expect the previous [980, ..., 0] schedule and final alpha of 1.0. A nearby comment says alpha_bar_at(-1) = 1.0, while the function returns alpha_bars[0].

Proposed resolution

Compare one fixed scheduler configuration and reference vector against Python Diffusers, then update the implementation, tests, and comments together.

Acceptance criteria

  • cargo test -p klearu-diffusion is green.
  • Tests lock the intended timestep sequence and final-step behavior to a reference.
  • Comments accurately describe steps_offset and set_alpha_to_one semantics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions