Aggregation
Index
Mill.AbstractAggregation
Mill.AggregationStack
Mill.BagCount
Mill.SegmentedLSE
Mill.SegmentedMax
Mill.SegmentedMean
Mill.SegmentedPNorm
Mill.SegmentedSum
Mill.SegmentedMeanMax
Mill.SegmentedPNormLSE
API
Mill.AbstractAggregation
— TypeAbstractAggregation
Supertype for any aggregation operator.
See also: AggregationStack
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
Mill.AggregationStack
— TypeAggregationStack{T <: Tuple{Vararg{AbstractAggregation}}} <: AbstractAggregation
A container that implements a concatenation of one or more AbstractAggregation
s.
Construct with e.g. AggregationStack(SegmentedMean([t::Type, ]d))
for single operators and with e.g. SegmentedPNormLSE([t::Type, ]d)
for concatenations. With these calls all parameters inside operators are initialized randomly as Float32
arrays, unless type t
is further specified. Another option is to vcat
two operators together.
Nested stacks are flattened into a single-level structure upon construction, see examples.
Intended to be used as a functor:
(a::AggregationStack)(x, bags[, w])
where x
is either AbstractMatrix
or missing
, bags
is AbstractBags
structure and optionally w
is an AbstractVector
of weights.
Examples
julia> a = AggregationStack(SegmentedMean(2), SegmentedMax(2))
+Aggregation · Mill.jl Aggregation
Index
Mill.AbstractAggregation
Mill.AggregationStack
Mill.BagCount
Mill.SegmentedLSE
Mill.SegmentedMax
Mill.SegmentedMean
Mill.SegmentedPNorm
Mill.SegmentedSum
Mill.SegmentedMeanMax
Mill.SegmentedPNormLSE
API
Mill.AbstractAggregation
— TypeAbstractAggregation
Supertype for any aggregation operator.
See also: AggregationStack
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.AggregationStack
— TypeAggregationStack{T <: Tuple{Vararg{AbstractAggregation}}} <: AbstractAggregation
A container that implements a concatenation of one or more AbstractAggregation
s.
Construct with e.g. AggregationStack(SegmentedMean([t::Type, ]d))
for single operators and with e.g. SegmentedPNormLSE([t::Type, ]d)
for concatenations. With these calls all parameters inside operators are initialized randomly as Float32
arrays, unless type t
is further specified. Another option is to vcat
two operators together.
Nested stacks are flattened into a single-level structure upon construction, see examples.
Intended to be used as a functor:
(a::AggregationStack)(x, bags[, w])
where x
is either AbstractMatrix
or missing
, bags
is AbstractBags
structure and optionally w
is an AbstractVector
of weights.
Examples
julia> a = AggregationStack(SegmentedMean(2), SegmentedMax(2))
AggregationStack:
SegmentedMean(ψ = Float32[0.0, 0.0])
SegmentedMax(ψ = Float32[0.0, 0.0])
@@ -25,7 +25,7 @@
AggregationStack:
SegmentedMean(ψ = Float32[0.0, 0.0])
SegmentedMax(ψ = Float32[0.0, 0.0])
-
See also: AbstractAggregation
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedSum
— TypeSegmentedSum{V <: AbstractVector{<:Number}} <: AbstractAggregation
AbstractAggregation
implementing segmented sum aggregation:
$f(\{x_1, \ldots, x_k\}) = \sum_{i = 1}^{k} x_i$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered.
See also: AbstractAggregation
, AggregationStack
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedMax
— TypeSegmentedMax{V <: AbstractVector{<:Number}} <: AbstractAggregation
AbstractAggregation
implementing segmented max aggregation:
$f(\{x_1, \ldots, x_k\}) = \max_{i = 1, \ldots, k} x_i$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered.
See also: AbstractAggregation
, AggregationStack
, SegmentedMean
, SegmentedSum
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedMean
— TypeSegmentedMean{V <: AbstractVector{<:Number}}} <: AbstractAggregation
AbstractAggregation
implementing segmented mean aggregation:
$f(\{x_1, \ldots, x_k\}) = \frac{1}{k} \sum_{i = 1}^{k} x_i$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered.
See also: AbstractAggregation
, AggregationStack
, SegmentedMax
, SegmentedSum
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedPNorm
— TypeSegmentedPNorm{V <: AbstractVector{<:AbstractFloat}} <: AbstractAggregation
AbstractAggregation
implementing segmented p-norm aggregation:
$f(\{x_1, \ldots, x_k\}; p, c) = \left(\frac{1}{k} \sum_{i = 1}^{k} \vert x_i - c \vert ^ {p} \right)^{\frac{1}{p}}$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered, and vectors of parameters p
and c
used during computation.
See also: AbstractAggregation
, AggregationStack
, SegmentedMax
, SegmentedMean
, SegmentedSum
, SegmentedLSE
.
sourceMill.SegmentedLSE
— TypeSegmentedLSE{V <: AbstractVector{<:AbstractFloat}} <: AbstractAggregation
AbstractAggregation
implementing segmented log-sum-exp (LSE) aggregation:
$f(\{x_1, \ldots, x_k\}; r) = \frac{1}{r}\log \left(\frac{1}{k} \sum_{i = 1}^{k} \exp({r\cdot x_i})\right)$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered, and a vector of parameters r
used during computation.
See also: AbstractAggregation
, AggregationStack
, SegmentedMax
, SegmentedMean
, SegmentedSum
, SegmentedPNorm
.
sourceMill.SegmentedMeanMax
— FunctionSegmentedMeanMax([t::Type, ]d::Integer)
Construct AggregationStack
consisting of SegmentedMean
and SegmentedMax
operators.
Examples
julia> SegmentedMeanMax(4)
+
See also: AbstractAggregation
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedSum
— TypeSegmentedSum{V <: AbstractVector{<:Number}} <: AbstractAggregation
AbstractAggregation
implementing segmented sum aggregation:
$f(\{x_1, \ldots, x_k\}) = \sum_{i = 1}^{k} x_i$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered.
See also: AbstractAggregation
, AggregationStack
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedMax
— TypeSegmentedMax{V <: AbstractVector{<:Number}} <: AbstractAggregation
AbstractAggregation
implementing segmented max aggregation:
$f(\{x_1, \ldots, x_k\}) = \max_{i = 1, \ldots, k} x_i$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered.
See also: AbstractAggregation
, AggregationStack
, SegmentedMean
, SegmentedSum
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedMean
— TypeSegmentedMean{V <: AbstractVector{<:Number}}} <: AbstractAggregation
AbstractAggregation
implementing segmented mean aggregation:
$f(\{x_1, \ldots, x_k\}) = \frac{1}{k} \sum_{i = 1}^{k} x_i$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered.
See also: AbstractAggregation
, AggregationStack
, SegmentedMax
, SegmentedSum
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedPNorm
— TypeSegmentedPNorm{V <: AbstractVector{<:AbstractFloat}} <: AbstractAggregation
AbstractAggregation
implementing segmented p-norm aggregation:
$f(\{x_1, \ldots, x_k\}; p, c) = \left(\frac{1}{k} \sum_{i = 1}^{k} \vert x_i - c \vert ^ {p} \right)^{\frac{1}{p}}$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered, and vectors of parameters p
and c
used during computation.
See also: AbstractAggregation
, AggregationStack
, SegmentedMax
, SegmentedMean
, SegmentedSum
, SegmentedLSE
.
sourceMill.SegmentedLSE
— TypeSegmentedLSE{V <: AbstractVector{<:AbstractFloat}} <: AbstractAggregation
AbstractAggregation
implementing segmented log-sum-exp (LSE) aggregation:
$f(\{x_1, \ldots, x_k\}; r) = \frac{1}{r}\log \left(\frac{1}{k} \sum_{i = 1}^{k} \exp({r\cdot x_i})\right)$
Stores a vector of parameters ψ
that are filled into the resulting matrix in case an empty bag is encountered, and a vector of parameters r
used during computation.
See also: AbstractAggregation
, AggregationStack
, SegmentedMax
, SegmentedMean
, SegmentedSum
, SegmentedPNorm
.
sourceMill.SegmentedMeanMax
— FunctionSegmentedMeanMax([t::Type, ]d::Integer)
Construct AggregationStack
consisting of SegmentedMean
and SegmentedMax
operators.
Examples
julia> SegmentedMeanMax(4)
AggregationStack:
SegmentedMean(ψ = Float32[0.0, 0.0, 0.0, 0.0])
SegmentedMax(ψ = Float32[0.0, 0.0, 0.0, 0.0])
@@ -33,7 +33,7 @@
julia> SegmentedMeanMax(Float64, 2)
AggregationStack:
SegmentedMean(ψ = [0.0, 0.0])
- SegmentedMax(ψ = [0.0, 0.0])
See also: AbstractAggregation
, AggregationStack
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedPNormLSE
— FunctionSegmentedPNormLSE([t::Type, ]d::Integer)
Construct AggregationStack
consisting of SegmentedPNorm
and SegmentedLSE
operators.
See also: AbstractAggregation
, AggregationStack
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.BagCount
— TypeBagCount{T <: AbstractAggregation}
A wrapper type that when called applies the AbstractAggregation
stored in it, and appends one more element containing bag size after $x ↦ \log(x + 1)$ transformation to the result.
Used as a functor:
(bc::BagCount)(x, bags[, w])
where x
is either AbstractMatrix
or missing
, bags
is AbstractBags
structure and optionally w
is an AbstractVector
of weights.
Examples
julia> x = Float32[0 1 2; 3 4 5]
+ SegmentedMax(ψ = [0.0, 0.0])
See also: AbstractAggregation
, AggregationStack
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.SegmentedPNormLSE
— FunctionSegmentedPNormLSE([t::Type, ]d::Integer)
Construct AggregationStack
consisting of SegmentedPNorm
and SegmentedLSE
operators.
See also: AbstractAggregation
, AggregationStack
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceMill.BagCount
— TypeBagCount{T <: AbstractAggregation}
A wrapper type that when called applies the AbstractAggregation
stored in it, and appends one more element containing bag size after $x ↦ \log(x + 1)$ transformation to the result.
Used as a functor:
(bc::BagCount)(x, bags[, w])
where x
is either AbstractMatrix
or missing
, bags
is AbstractBags
structure and optionally w
is an AbstractVector
of weights.
Examples
julia> x = Float32[0 1 2; 3 4 5]
2×3 Matrix{Float32}:
0.0 1.0 2.0
3.0 4.0 5.0
@@ -59,4 +59,4 @@
3.0 4.5
0.0 2.0
3.0 5.0
- 0.693147 1.09861
See also: AbstractAggregation
, AggregationStack
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.
sourceSettings
This document was generated with Documenter.jl version 1.7.0 on Monday 11 November 2024. Using Julia version 1.11.1.
+ 0.693147 1.09861
See also: AbstractAggregation
, AggregationStack
, SegmentedSum
, SegmentedMax
, SegmentedMean
, SegmentedPNorm
, SegmentedLSE
.