CliMA / CliMA/RandomFeatures.jl

More flexible interface for feature building

Open
#23 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
11
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Features could allow arg/distribution combination based on a different variety of distributions and constructions.

## Idea

Introduce a `FeatureArgType` type so `build_features` can create more flexible types with a `build_args` function dispatching over `::FeatureArgType`
E.g. informally building the the classic scalar feature would involve:
```julia
abstract type FeatureArgType
Affine <: FeatureArgType

function build_args(
samp::sampler,
feature_parameters::Dict,
inputs::Array,
::Affine,
)
xi = get_distribution(samp)["xi"]
uniform = get_distribution(samp)["uniform"]
return inputs*xi + uniform
end
```
replacing the hardcoded https://github.com/CliMA/RandomFeatures.jl/blob/2d864cc8ffc89965b476bb04db1f2f6d687c881b/src/Features.jl#L148-L156
- Possibly move the move the inbuilt uniform distribution elsewhere? It's only in the fourier case that this is necessary

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.