Skip to content

ScaledPlan: region subfield missing (needed for AD)  #182

Open
@maximilian-gelbrecht

Description

@maximilian-gelbrecht

The ScaledPlan like e.g. the result of plan_fft has no field region, leading to an error when attempting to AD it via Zygote. Zygote (which depends on AbstractFFT) is requiring a region subfield.

Example

begin
    using Flux
    using Zygote
    using LinearAlgebra
    using FFTW
end

N = 15
data = rand(Float64, N)

FT = plan_fft(data) # e.g. plan_dct / plan_idct would work 
iFT= plan_ifft(data)

m = Chain(x->FT*x, Dense(N,N), x->iFT*x)
loss(x,y) = sum(abs2,m(x) .- y)
loss(data,data) # precompile

grads = gradient(() -> loss(data, data), params(m))

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