-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement dependent parameters feature for FreeParameters
#271
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create another simple example in FreeParameters
docstring that demonstrates the dependent_parameters
kwarg?
|
||
observation_map(::VectorNormMap, observations) = reshape([0], 1, 1) | ||
output_map_str(::ConcatenatedVectorNormMap) = "ConcatenatedVectorNormMap" | ||
observation_map(::ConcatenatedVectorNormMap, observations) = reshape([0], 1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit further down there is a redefinition of this method:
observation_map(map::ConcatenatedVectorNormMap, observations) = hcat(0.0)
which one we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it because of this that docs fail?
** incremental compilation may be fatally broken for this module **
We also need to update |
I gave it a crack but it could be done better :) julia> priors = (ν = Normal(1e-4, 1e-5), κ = Normal(1e-3, 1e-5))
(ν = Normal{Float64}(μ=0.0001, σ=1.0e-5), κ = Normal{Float64}(μ=0.001, σ=1.0e-5))
julia> free_parameters = FreeParameters(priors)
FreeParameters with 2 parameters
├── names: (:ν, :κ)
├── priors: Dict{Symbol, Any}
│ ├── ν => Normal{Float64}(μ=0.0001, σ=1.0e-5)
│ └── κ => Normal{Float64}(μ=0.001, σ=1.0e-5)
└── dependent parameters: Dict{Symbol, Any}
julia> c(p) = p.ν + p.κ # compute a third dependent parameter `c` as a function of `ν` and `κ`
c (generic function with 1 method)
julia> free_parameters_with_a_dependent = FreeParameters(priors, dependent_parameters=(; c))
FreeParameters with 2 parameters and 1 dependent parameters
├── names: (:ν, :κ)
├── priors: Dict{Symbol, Any}
│ ├── ν => Normal{Float64}(μ=0.0001, σ=1.0e-5)
│ └── κ => Normal{Float64}(μ=0.001, σ=1.0e-5)
└── dependent parameters: Dict{Symbol, Any}
└── c => c |
docs seems to fails at https://github.com/CliMA/ParameterEstimocean.jl/runs/6742066654?check_suite_focus=true#step:6:939 |
it'd be nice if we can print something related to the dependent parameters... but I don't know what? if c was defined as a function then there is nothing to print out... |
we can use Oceananigans' |
I'll try to build the docs locally to see if I run into same issue(s). |
…Estimocean.jl into glw/dependent-parameters
Usage is something like
Closes #269