-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Optimize does not work on Colorant{T,1}
#12
Comments
This may just be a limitation of ForwardDiff.jl Could you try with
which should automatically pass to My hesitation with defining that function is that I would then have to depend on color types package just for the single method dispatch, when it seems simpler for the end-user to convert themselves. |
Yeah... The same problem... with that: PSFModels.fit(gaussian,(x = 7.5, y = 7.5), bead_view; autodiff=:finite)
|
Maybe you do not have to pull the dependency and just if function fit(..., image::AbstractArray{T},....) where {T<:Real}
# standard implementation
end
fit(..., image::AbstractArray{T},...) where {T} = fit(..., Real.(image), ...) Then mutliple dispatch will select the first when it is more specific and the second for any other... |
When trying to fit an image of a bead, it is most commonly represented as an array of colorants. The most likely for this use in particular is for it to be some subtype of
AbstractGray
. But when trying to fit some kind ofGray
array, there it throws:Could there be definition such as:
Do you think it is a good idea?
The text was updated successfully, but these errors were encountered: