-
Notifications
You must be signed in to change notification settings - Fork 3
Open
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:
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
endreplacing the hardcoded
RandomFeatures.jl/src/Features.jl
Lines 148 to 156 in 2d864cc
| samp = get_feature_sample(rf) | |
| xi = get_distribution(samp)["xi"] # dim_inputs x n_features | |
| features = inputs * xi[:, batch_feature_idx] # n_samples x n_features | |
| is_uniform_shift = "uniform" ∈ get_name(samp) | |
| if is_uniform_shift | |
| uniform = get_distribution(samp)["uniform"] # 1 x n_features | |
| features .+= uniform[:, batch_feature_idx] | |
| end |
- Possibly move the move the inbuilt uniform distribution elsewhere? It's only in the fourier case that this is necessary
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels