Skip to content

Commit

Permalink
Merge pull request #39 from CliMA/orad/profiling
Browse files Browse the repository at this point in the history
Accelerations learnt from profiling
  • Loading branch information
odunbar authored Apr 12, 2023
2 parents dda5447 + a1e0c5f commit db7920c
Show file tree
Hide file tree
Showing 10 changed files with 749 additions and 433 deletions.
680 changes: 381 additions & 299 deletions examples/Learn_hyperparameters/nd_to_md_regression_direct_withcov.jl

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/Features.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $(TYPEDSIGNATURES)
samples the random feature distribution
"""
function sample(rf::RandomFeature)
function sample(rf::RF) where {RF <: RandomFeature}
sampler = get_feature_sampler(rf)
m = get_n_features(rf)
return sample(sampler, m)
Expand All @@ -32,35 +32,35 @@ $(TYPEDSIGNATURES)
gets the `n_features` field
"""
get_n_features(rf::RandomFeature) = rf.n_features
get_n_features(rf::RF) where {RF <: RandomFeature} = rf.n_features

"""
$(TYPEDSIGNATURES)
gets the `scalar_function` field
"""
get_scalar_function(rf::RandomFeature) = rf.scalar_function
get_scalar_function(rf::RF) where {RF <: RandomFeature} = rf.scalar_function

"""
$(TYPEDSIGNATURES)
gets the `feature_sampler` field
"""
get_feature_sampler(rf::RandomFeature) = rf.feature_sampler
get_feature_sampler(rf::RF) where {RF <: RandomFeature} = rf.feature_sampler

"""
$(TYPEDSIGNATURES)
gets the `feature_sample` field
"""
get_feature_sample(rf::RandomFeature) = rf.feature_sample
get_feature_sample(rf::RF) where {RF <: RandomFeature} = rf.feature_sample

"""
$(TYPEDSIGNATURES)
gets the `feature_parameters` field
"""
get_feature_parameters(rf::RandomFeature) = rf.feature_parameters
get_feature_parameters(rf::RF) where {RF <: RandomFeature} = rf.feature_parameters



Expand Down
Loading

0 comments on commit db7920c

Please sign in to comment.