RandomFeatureMaps
Documentation for RandomFeatureMaps.
RandomFeatureMaps.RandomFourierFeatures
RandomFeatureMaps.RandomOrientationFeatures
RandomFeatureMaps.RandomOrientationFeatures
RandomFeatureMaps.get_rigid
RandomFeatureMaps.RandomFourierFeatures
— TypeRandomFourierFeatures(n => m, σ)
Maps n
-dimensional data and projects it to m
-dimensional random fourier features.
This type has no trainable parameters.
Examples
julia> rff = RandomFourierFeatures(2 => 4, 1.0); # maps 2D data to 4D
+Home · RandomFeatureMaps.jl RandomFeatureMaps
Documentation for RandomFeatureMaps.
RandomFeatureMaps.RandomFourierFeatures
RandomFeatureMaps.RandomOrientationFeatures
RandomFeatureMaps.RandomOrientationFeatures
RandomFeatureMaps.get_rigid
RandomFeatureMaps.RandomFourierFeatures
— TypeRandomFourierFeatures(n => m, σ)
Maps n
-dimensional data and projects it to m
-dimensional random fourier features.
This type has no trainable parameters.
Examples
julia> rff = RandomFourierFeatures(2 => 4, 1.0); # maps 2D data to 4D
julia> rff(rand(2, 3)) |> size # 3 samples
(4, 3)
julia> rff(rand(2, 3, 5)) |> size # extra batch dim
-(4, 3, 5)
sourceRandomFeatureMaps.RandomOrientationFeatures
— TypeRandomOrientationFeatures
Holds two random matrices which are used to embed rigid transformations.
This type has no trainable parameters.
Methods
(::RandomOrientationFeatures)(rigid1, rigid2)
: returns the distances between the corresponding
rigid transformations, embedded using the two random matrices of the random orientation features.
(::RandomOrientationFeatures)(rigid1, rigid2; dims::Int)
: unsqueezes batch dimension dim+1
of rigid1
and dim
of rigid2
to broadcast the rof
call and produce a pairwise map.
(::RandomOrientationFeatures)(rigid1, rigid2, graph::GraphNeuralNetworks.GNNGraph)
: similar to
the first method, but takes two sets rigid transformations of equal size and unrolls a graph to get the pairs of rigid transformations. Equivalent to the second method (with broadcasted dimensions flattened) when the graph is complete.
Each of these have single rigid argument methods for when rigid1 == rigid2
, i.e. rof(rigid)
Examples
julia> rof = RandomOrientationFeatures(10, 0.1f0);
+(4, 3, 5)
sourceRandomFeatureMaps.RandomOrientationFeatures
— TypeRandomOrientationFeatures
Holds two random matrices which are used to embed rigid transformations.
This type has no trainable parameters.
Methods
(::RandomOrientationFeatures)(rigid1, rigid2)
: returns the distances between the corresponding
rigid transformations, embedded using the two random matrices of the random orientation features.
(::RandomOrientationFeatures)(rigid1, rigid2; dims::Int)
: unsqueezes batch dimension dim+1
of rigid1
and dim
of rigid2
to broadcast the rof
call and produce a pairwise map.
(::RandomOrientationFeatures)(rigid1, rigid2, graph::GraphNeuralNetworks.GNNGraph)
: similar to
the first method, but takes two sets rigid transformations of equal size and unrolls a graph to get the pairs of rigid transformations. Equivalent to the second method (with broadcasted dimensions flattened) when the graph is complete.
Each of these have single rigid argument methods for when rigid1 == rigid2
, i.e. rof(rigid)
Examples
julia> rof = RandomOrientationFeatures(10, 0.1f0);
julia> rigid = rand_rigid(Float32, (4, 3));
@@ -27,4 +27,4 @@
julia> rigid = rand_rigid(Float32, (2,));
julia> rof(rigid, graph) |> size
-(10, 3)
sourceRandomFeatureMaps.RandomOrientationFeatures
— MethodRandomOrientationFeatures(m, σ)
Creates a RandomOrientationFeatures
instance, mapping to m
features.
sourceRandomFeatureMaps.get_rigid
— Methodget_rigid(R::AbstractArray, t::AbstractArray)
Converts a rotation R
and translation t
to a BatchedTransformations.Rigid
, designed to handle batch dimensions.
The transformation gets applied according to NNlib.batched_mul(R, x) .+ t
sourceSettings
This document was generated with Documenter.jl version 1.7.0 on Wednesday 18 September 2024. Using Julia version 1.10.5.
+(10, 3)
RandomFeatureMaps.RandomOrientationFeatures
— MethodRandomOrientationFeatures(m, σ)
Creates a RandomOrientationFeatures
instance, mapping to m
features.
RandomFeatureMaps.get_rigid
— Methodget_rigid(R::AbstractArray, t::AbstractArray)
Converts a rotation R
and translation t
to a BatchedTransformations.Rigid
, designed to handle batch dimensions.
The transformation gets applied according to NNlib.batched_mul(R, x) .+ t