-
-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug π
From slack thread here.
Expected behavior
MTKParameters is returned itself.
Minimal Reproducible Example π
Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.
@mtkmodel Simple begin
@parameters begin
a = 1.0
b = 1.0
end
@variables begin
x(t)
end
@equations begin
D(x) ~ -a * x + b
end
end
@named model = Simple()
model = complete(model)
p = MTKParameters(model, defaults(model))
setter = ModelingToolkit.setp_oop(model, [model.a])
function loss(x)
new_p = setter(p, [x])
# do something with new_p and the model...
return sum(abs2, new_p.tunable) # for example
end
Error & Stacktrace
MethodError: no method matching parameter_values(::MTKParameters{Vector{Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}})
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working