Skip to content

Commit

Permalink
fixed doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmandlik committed Oct 13, 2024
1 parent 7523c2a commit 89a231f
Show file tree
Hide file tree
Showing 17 changed files with 404 additions and 316 deletions.
316 changes: 202 additions & 114 deletions docs/src/examples/musk/Manifest.toml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/datanodes/bagnode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ If `b` is an `AbstractVector`, [`Mill.bags`](@ref) is applied first.
# Examples
```jldoctest
julia> BagNode(ArrayNode(maybehotbatch([1, missing, 2], 1:2)), AlignedBags([1:1, 2:3]))
BagNode 2 obs, 104 bytes
╰── ArrayNode(2×3 MaybeHotMatrix with Union{Missing, Bool} elements) 3 obs, 87 bytes
BagNode 2 obs, 80 bytes
╰── ArrayNode(2×3 MaybeHotMatrix with Union{Missing, Bool} elements) 3 obs, 74 bytes
julia> BagNode(randn(2, 5), [1, 2, 2, 1, 1])
BagNode 2 obs, 200 bytes
╰── ArrayNode(2×5 Array with Float64 elements) 5 obs, 128 bytes
BagNode 2 obs, 272 bytes
╰── ArrayNode(2×5 Array with Float64 elements) 5 obs, 136 bytes
```
See also: [`WeightedBagNode`](@ref), [`AbstractBagNode`](@ref),
Expand Down
40 changes: 20 additions & 20 deletions src/datanodes/datanode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ julia> catobs(ArrayNode(zeros(2, 2)), ArrayNode([1 2; 3 4]))
0.0 0.0 3.0 4.0
julia> n = ProductNode(t1=ArrayNode(randn(2, 3)), t2=BagNode(ArrayNode(randn(3, 8)), bags([1:3, 4:5, 6:8])))
ProductNode 3 obs, 24 bytes
├── t1: ArrayNode(2×3 Array with Float64 elements) 3 obs, 96 bytes
╰── t2: BagNode 3 obs, 112 bytes
╰── ArrayNode(3×8 Array with Float64 elements) 8 obs, 240 bytes
ProductNode 3 obs, 0 bytes
├── t1: ArrayNode(2×3 Array with Float64 elements) 3 obs, 104 bytes
╰── t2: BagNode 3 obs, 96 bytes
╰── ArrayNode(3×8 Array with Float64 elements) 8 obs, 248 bytes
julia> catobs(n[1], n[3])
ProductNode 2 obs, 24 bytes
├── t1: ArrayNode(2×2 Array with Float64 elements) 2 obs, 80 bytes
╰── t2: BagNode 2 obs, 96 bytes
╰── ArrayNode(3×6 Array with Float64 elements) 6 obs, 192 bytes
ProductNode 2 obs, 0 bytes
├── t1: ArrayNode(2×2 Array with Float64 elements) 2 obs, 88 bytes
╰── t2: BagNode 2 obs, 80 bytes
╰── ArrayNode(3×6 Array with Float64 elements) 6 obs, 200 bytes
```
See also: [`Mill.subset`](@ref).
Expand All @@ -107,8 +107,8 @@ julia> Mill.subset(ArrayNode(NGramMatrix(["Hello", "world"])), 2)
"world"
julia> Mill.subset(BagNode(ArrayNode(randn(2, 8)), [1:2, 3:3, 4:7, 8:8]), 1:3)
BagNode 3 obs, 112 bytes
╰── ArrayNode(2×7 Array with Float64 elements) 7 obs, 160 bytes
BagNode 3 obs, 96 bytes
╰── ArrayNode(2×7 Array with Float64 elements) 7 obs, 168 bytes
```
See also: [`catobs`](@ref).
Expand All @@ -123,12 +123,12 @@ Remove instances from `n` using `mask` and remap bag indices accordingly.
# Examples
```jldoctest
julia> b1 = BagNode(ArrayNode([1 2 3; 4 5 6]), bags([1:2, 0:-1, 3:3]))
BagNode 3 obs, 112 bytes
╰── ArrayNode(2×3 Array with Int64 elements) 3 obs, 96 bytes
BagNode 3 obs, 96 bytes
╰── ArrayNode(2×3 Array with Int64 elements) 3 obs, 104 bytes
julia> b2 = removeinstances(b1, [false, true, true])
BagNode 3 obs, 112 bytes
╰── ArrayNode(2×2 Array with Int64 elements) 2 obs, 80 bytes
BagNode 3 obs, 96 bytes
╰── ArrayNode(2×2 Array with Int64 elements) 2 obs, 88 bytes
julia> b2.data
2×2 ArrayNode{Matrix{Int64}, Nothing}:
Expand Down Expand Up @@ -174,14 +174,14 @@ Recursively apply `f` to data in all leaves of `x`.
# Examples
```jldoctest
julia> n1 = ProductNode(a=zeros(2,2), b=ones(2,2))
ProductNode 2 obs, 16 bytes
├── a: ArrayNode(2×2 Array with Float64 elements) 2 obs, 80 bytes
╰── b: ArrayNode(2×2 Array with Float64 elements) 2 obs, 80 bytes
ProductNode 2 obs, 0 bytes
├── a: ArrayNode(2×2 Array with Float64 elements) 2 obs, 88 bytes
╰── b: ArrayNode(2×2 Array with Float64 elements) 2 obs, 88 bytes
julia> n2 = Mill.mapdata(x -> x .+ 1, n1)
ProductNode 2 obs, 16 bytes
├── a: ArrayNode(2×2 Array with Float64 elements) 2 obs, 80 bytes
╰── b: ArrayNode(2×2 Array with Float64 elements) 2 obs, 80 bytes
ProductNode 2 obs, 0 bytes
├── a: ArrayNode(2×2 Array with Float64 elements) 2 obs, 88 bytes
╰── b: ArrayNode(2×2 Array with Float64 elements) 2 obs, 88 bytes
julia> Mill.data(n2).a
2×2 ArrayNode{Matrix{Float64}, Nothing}:
Expand Down
4 changes: 2 additions & 2 deletions src/datanodes/lazynode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ end;
```jldoctest
julia> LazyNode{:Sentence}(["foo bar", "baz"]) |> Mill.unpack2mill
BagNode 2 obs, 120 bytes
╰── ArrayNode(2053×3 NGramMatrix with Int64 elements) 3 obs, 274 bytes
BagNode 2 obs, 80 bytes
╰── ArrayNode(2053×3 NGramMatrix with Int64 elements) 3 obs, 170 bytes
```
See also: [`LazyNode`](@ref), [`LazyModel`](@ref).
Expand Down
18 changes: 9 additions & 9 deletions src/datanodes/productnode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ an [`ArrayNode`](@ref).
# Examples
```jldoctest
julia> ProductNode((ArrayNode(zeros(2, 2)), ArrayNode(Flux.onehotbatch([1, 2], 1:2))))
ProductNode 2 obs, 24 bytes
├── ArrayNode(2×2 Array with Float64 elements) 2 obs, 80 bytes
╰── ArrayNode(2×2 OneHotArray with Bool elements) 2 obs, 80 bytes
ProductNode 2 obs, 0 bytes
├── ArrayNode(2×2 Array with Float64 elements) 2 obs, 88 bytes
╰── ArrayNode(2×2 OneHotArray with Bool elements) 2 obs, 64 bytes
julia> ProductNode(x1 = ArrayNode(NGramMatrix(["Hello", "world"])),
x2 = BagNode(ArrayNode([1 2; 3 4]), [1:2, 0:-1]))
ProductNode 2 obs, 48 bytes
├── x1: ArrayNode(2053×2 NGramMatrix with Int64 elements) 2 obs, 146 bytes
╰── x2: BagNode 2 obs, 96 bytes
╰── ArrayNode(2×2 Array with Int64 elements) 2 obs, 80 bytes
ProductNode 2 obs, 0 bytes
├── x1: ArrayNode(2053×2 NGramMatrix with Int64 elements) 2 obs, 114 bytes
╰── x2: BagNode 2 obs, 80 bytes
╰── ArrayNode(2×2 Array with Int64 elements) 2 obs, 88 bytes
julia> ProductNode([1 2 3])
ProductNode 3 obs, 8 bytes
╰── ArrayNode(1×3 Array with Int64 elements) 3 obs, 72 bytes
ProductNode 3 obs, 0 bytes
╰── ArrayNode(1×3 Array with Int64 elements) 3 obs, 80 bytes
julia> ProductNode((ArrayNode([1 2; 3 4]), ArrayNode([1 2 3; 4 5 6])))
ERROR: AssertionError: All subtrees must have an equal amount of instances!
Expand Down
8 changes: 4 additions & 4 deletions src/datanodes/weighted_bagnode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ If `b` is an `AbstractVector`, [`Mill.bags`](@ref) is applied first.
# Examples
```jldoctest
julia> WeightedBagNode(ArrayNode(NGramMatrix(["s1", "s2"])), bags([1:2, 0:-1]), [0.2, 0.8])
WeightedBagNode 2 obs, 184 bytes
╰── ArrayNode(2053×2 NGramMatrix with Int64 elements) 2 obs, 140 bytes
WeightedBagNode 2 obs, 144 bytes
╰── ArrayNode(2053×2 NGramMatrix with Int64 elements) 2 obs, 108 bytes
julia> WeightedBagNode(zeros(2, 2), [1, 2], [1, 2])
WeightedBagNode 2 obs, 160 bytes
╰── ArrayNode(2×2 Array with Float64 elements) 2 obs, 80 bytes
WeightedBagNode 2 obs, 240 bytes
╰── ArrayNode(2×2 Array with Float64 elements) 2 obs, 88 bytes
```
See also: [`BagNode`](@ref), [`AbstractBagNode`](@ref), [`AbstractMillNode`](@ref), [`BagModel`](@ref).
Expand Down
2 changes: 1 addition & 1 deletion src/modelnodes/arraymodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ julia> n = ArrayNode(randn(Float32, 2, 2))
```jldoctest array_model
julia> m = ArrayModel(Dense(2, 2))
ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 104 bytes
ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 112 bytes
```
```jldoctest array_model; filter=$DOCTEST_FILTER
Expand Down
14 changes: 7 additions & 7 deletions src/modelnodes/bagmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ model `bm` on the aggregated representation of every bag in the data node.
julia> Random.seed!(0);
julia> n = BagNode(ArrayNode(randn(Float32, 3, 2)), bags([0:-1, 1:2]))
BagNode 2 obs, 96 bytes
╰── ArrayNode(3×2 Array with Float32 elements) 2 obs, 72 bytes
BagNode 2 obs, 80 bytes
╰── ArrayNode(3×2 Array with Float32 elements) 2 obs, 80 bytes
julia> m = BagModel(ArrayModel(Dense(3, 2)), SegmentedMeanMax(2), Dense(4, 2))
BagModel ↦ [SegmentedMean(2); SegmentedMax(2)] ↦ Dense(4 => 2) 4 arrays, 14 params, 216 bytes
╰── ArrayModel(Dense(3 => 2)) 2 arrays, 8 params, 112 bytes
BagModel ↦ [SegmentedMean(2); SegmentedMax(2)] ↦ Dense(4 => 2) 4 arrays, 14 params, 224 bytes
╰── ArrayModel(Dense(3 => 2)) 2 arrays, 8 params, 120 bytes
julia> m(n)
2×2 Matrix{Float32}:
Expand Down Expand Up @@ -51,12 +51,12 @@ it is wrapped into an [`ArrayNode`](@ref).
# Examples
```jldoctest
julia> m = BagModel(ArrayModel(Dense(3, 2)), SegmentedMeanMax(2), Dense(4, 2))
BagModel ↦ [SegmentedMean(2); SegmentedMax(2)] ↦ Dense(4 => 2) 4 arrays, 14 params, 216 bytes
╰── ArrayModel(Dense(3 => 2)) 2 arrays, 8 params, 112 bytes
BagModel ↦ [SegmentedMean(2); SegmentedMax(2)] ↦ Dense(4 => 2) 4 arrays, 14 params, 224 bytes
╰── ArrayModel(Dense(3 => 2)) 2 arrays, 8 params, 120 bytes
julia> m = BagModel(Dense(4, 3), BagCount(SegmentedMean(3)))
BagModel ↦ BagCount(SegmentedMean(3)) ↦ identity 1 arrays, 3 params (all zero), 52 bytes
╰── ArrayModel(Dense(4 => 3)) 2 arrays, 15 params, 140 bytes
╰── ArrayModel(Dense(4 => 3)) 2 arrays, 15 params, 148 bytes
```
See also: [`AbstractMillModel`](@ref), [`AbstractAggregation`](@ref), [`BagCount`](@ref),
Expand Down
6 changes: 3 additions & 3 deletions src/modelnodes/lazymodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LazyNode{:Sentence, Vector{String}, Nothing}:
julia> m = LazyModel{:Sentence}(BagModel(Dense(2053, 3), SegmentedMean(3), identity))
LazyModel{Sentence}
╰── BagModel ↦ SegmentedMean(3) ↦ identity 1 arrays, 3 params (all zero), 52 bytes
╰── ArrayModel(Dense(2053 => 3)) 2 arrays, 6_162 params, 24.148 KiB
╰── ArrayModel(Dense(2053 => 3)) 2 arrays, 6_162 params, 24.156 KiB
```
```jldoctest unpack2mill; filter=$DOCTEST_FILTER
Expand Down Expand Up @@ -60,11 +60,11 @@ it is wrapped into an [`ArrayNode`](@ref).
```jldoctest
julia> LazyModel{:Sentence}(ArrayModel(Dense(2, 2)))
LazyModel{Sentence}
╰── ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 104 bytes
╰── ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 112 bytes
julia> LazyModel(:Sentence, Dense(2, 2))
LazyModel{Sentence}
╰── ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 104 bytes
╰── ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 112 bytes
```
See also: [`AbstractMillModel`](@ref), [`LazyNode`](@ref), [`Mill.unpack2mill`](@ref).
Expand Down
20 changes: 10 additions & 10 deletions src/modelnodes/productmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ A model node for processing [`ProductNode`](@ref)s. For each subtree of the data
julia> Random.seed!(0);
julia> n = ProductNode(a=ArrayNode([0 1; 2 3]), b=ArrayNode([4 5; 6 7]))
ProductNode 2 obs, 16 bytes
├── a: ArrayNode(2×2 Array with Int64 elements) 2 obs, 80 bytes
╰── b: ArrayNode(2×2 Array with Int64 elements) 2 obs, 80 bytes
ProductNode 2 obs, 0 bytes
├── a: ArrayNode(2×2 Array with Int64 elements) 2 obs, 88 bytes
╰── b: ArrayNode(2×2 Array with Int64 elements) 2 obs, 88 bytes
julia> m1 = ProductModel(a=ArrayModel(Dense(2, 2)), b=ArrayModel(Dense(2, 2)))
ProductModel ↦ identity
├── a: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 104 bytes
╰── b: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 104 bytes
├── a: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 112 bytes
╰── b: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 112 bytes
```
```jldoctest product_model; filter=$DOCTEST_FILTER
Expand Down Expand Up @@ -70,19 +70,19 @@ an [`ArrayNode`](@ref).
```jldoctest
julia> ProductModel(a=ArrayModel(Dense(2, 2)), b=identity)
ProductModel ↦ identity
├── a: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 104 bytes
├── a: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 112 bytes
╰── b: ArrayModel(identity)
julia> ProductModel(Dense(4, 2); a=ArrayModel(Dense(2, 2)), b=Dense(2, 2))
ProductModel ↦ Dense(4 => 2) 2 arrays, 10 params, 120 bytes
├── a: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 104 bytes
╰── b: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 104 bytes
ProductModel ↦ Dense(4 => 2) 2 arrays, 10 params, 128 bytes
├── a: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 112 bytes
╰── b: ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 112 bytes
julia> ProductModel((identity, BagModel(ArrayModel(Dense(2, 2)), SegmentedMean(2), identity)))
ProductModel ↦ identity
├── ArrayModel(identity)
╰── BagModel ↦ SegmentedMean(2) ↦ identity 1 arrays, 2 params (all zero), 48 bytes
╰── ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 104 bytes
╰── ArrayModel(Dense(2 => 2)) 2 arrays, 6 params, 112 bytes
julia> ProductModel(identity)
ProductModel ↦ identity
Expand Down
76 changes: 38 additions & 38 deletions src/modelnodes/reflectinmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,63 +33,63 @@ layers in these types are replaced by their imputing variants.
# Examples
```jldoctest
julia> n1 = ProductNode(a=ArrayNode(NGramMatrix(["a", missing])))
ProductNode 2 obs, 32 bytes
╰── a: ArrayNode(2053×2 NGramMatrix with Union{Missing, Int64} elements) 2 obs, 129 bytes
ProductNode 2 obs, 0 bytes
╰── a: ArrayNode(2053×2 NGramMatrix with Union{Missing, Int64} elements) 2 obs, 97 bytes
julia> n2 = ProductNode((ArrayNode([0 1]), BagNode(ArrayNode([0 1; 2 3]), bags([1:1, 2:2]))))
ProductNode 2 obs, 24 bytes
├── ArrayNode(1×2 Array with Int64 elements) 2 obs, 64 bytes
╰── BagNode 2 obs, 96 bytes
╰── ArrayNode(2×2 Array with Int64 elements) 2 obs, 80 bytes
ProductNode 2 obs, 0 bytes
├── ArrayNode(1×2 Array with Int64 elements) 2 obs, 72 bytes
╰── BagNode 2 obs, 80 bytes
╰── ArrayNode(2×2 Array with Int64 elements) 2 obs, 88 bytes
julia> n = ProductNode((n1, n2))
ProductNode 2 obs, 56 bytes
├── ProductNode 2 obs, 32 bytes
│ ╰── a: ArrayNode(2053×2 NGramMatrix with Union{Missing, Int64} elements) 2 obs, 129 bytes
╰── ProductNode 2 obs, 24 bytes
├── ArrayNode(1×2 Array with Int64 elements) 2 obs, 64 bytes
╰── BagNode 2 obs, 96 bytes
╰── ArrayNode(2×2 Array with Int64 elements) 2 obs, 80 bytes
ProductNode 2 obs, 0 bytes
├── ProductNode 2 obs, 0 bytes
│ ╰── a: ArrayNode(2053×2 NGramMatrix with Union{Missing, Int64} elements) 2 obs, 97 bytes
╰── ProductNode 2 obs, 0 bytes
├── ArrayNode(1×2 Array with Int64 elements) 2 obs, 72 bytes
╰── BagNode 2 obs, 80 bytes
╰── ArrayNode(2×2 Array with Int64 elements) 2 obs, 88 bytes
julia> reflectinmodel(n)
ProductModel ↦ Dense(20 => 10) 2 arrays, 210 params, 920 bytes
ProductModel ↦ Dense(20 => 10) 2 arrays, 210 params, 928 bytes
├── ProductModel ↦ identity
│ ╰── a: ArrayModel([postimputing]Dense(2053 => 10)) 3 arrays, 20_550 params, 80.391 KiB
╰── ProductModel ↦ Dense(11 => 10) 2 arrays, 120 params, 560 bytes
│ ╰── a: ArrayModel([postimputing]Dense(2053 => 10)) 3 arrays, 20_550 params, 80.398 KiB
╰── ProductModel ↦ Dense(11 => 10) 2 arrays, 120 params, 568 bytes
├── ArrayModel(identity)
╰── BagModel ↦ BagCount([SegmentedMean(10); SegmentedMax(10)]) ↦ Dense(21 => 10) 4 arrays, 240 params, 1.094 KiB
╰── ArrayModel(Dense(2 => 10)) 2 arrays, 30 params, 200 bytes
╰── BagModel ↦ BagCount([SegmentedMean(10); SegmentedMax(10)]) ↦ Dense(21 => 10) 4 arrays, 240 params, 1.102 KiB
╰── ArrayModel(Dense(2 => 10)) 2 arrays, 30 params, 208 bytes
julia> reflectinmodel(n, d -> Dense(d, 3), SegmentedMean, all_imputing=true)
ProductModel ↦ Dense(6 => 3) 2 arrays, 21 params, 164 bytes
ProductModel ↦ Dense(6 => 3) 2 arrays, 21 params, 172 bytes
├── ProductModel ↦ identity
│ ╰── a: ArrayModel([postimputing]Dense(2053 => 3)) 3 arrays, 6_165 params, 24.199 KiB
╰── ProductModel ↦ Dense(4 => 3) 2 arrays, 15 params, 140 bytes
├── ArrayModel([preimputing]Dense(1 => 1)) 3 arrays, 3 params, 132 bytes
╰── BagModel ↦ SegmentedMean(3) ↦ Dense(3 => 3) 3 arrays, 15 params, 180 bytes
╰── ArrayModel([preimputing]Dense(2 => 3)) 3 arrays, 11 params, 164 bytes
│ ╰── a: ArrayModel([postimputing]Dense(2053 => 3)) 3 arrays, 6_165 params, 24.207 KiB
╰── ProductModel ↦ Dense(4 => 3) 2 arrays, 15 params, 148 bytes
├── ArrayModel([preimputing]Dense(1 => 1)) 3 arrays, 3 params, 140 bytes
╰── BagModel ↦ SegmentedMean(3) ↦ Dense(3 => 3) 3 arrays, 15 params, 188 bytes
╰── ArrayModel([preimputing]Dense(2 => 3)) 3 arrays, 11 params, 172 bytes
julia> printtree(n; trav=true)
ProductNode [""] 2 obs, 56 bytes
├── ProductNode ["E"] 2 obs, 32 bytes
│ ╰── a: ArrayNode(2053×2 NGramMatrix with Union{Missing, Int64} elements) ["M"] 2 obs, 129 bytes
╰── ProductNode ["U"] 2 obs, 24 bytes
├── ArrayNode(1×2 Array with Int64 elements) ["Y"] 2 obs, 64 bytes
╰── BagNode ["c"] 2 obs, 96 bytes
╰── ArrayNode(2×2 Array with Int64 elements) ["e"] 2 obs, 80 bytes
ProductNode [""] 2 obs, 0 bytes
├── ProductNode ["E"] 2 obs, 0 bytes
│ ╰── a: ArrayNode(2053×2 NGramMatrix with Union{Missing, Int64} elements) ["M"] 2 obs, 97 bytes
╰── ProductNode ["U"] 2 obs, 0 bytes
├── ArrayNode(1×2 Array with Int64 elements) ["Y"] 2 obs, 72 bytes
╰── BagNode ["c"] 2 obs, 80 bytes
╰── ArrayNode(2×2 Array with Int64 elements) ["e"] 2 obs, 88 bytes
julia> reflectinmodel(n, d -> Dense(d, 3), SegmentedMean;
fsm=Dict("e" => d -> Chain(Dense(d, 2), Dense(2, 2))),
fsa=Dict("c" => SegmentedLSE),
single_key_identity=false,
single_scalar_identity=false)
ProductModel ↦ Dense(6 => 3) 2 arrays, 21 params, 164 bytes
├── ProductModel ↦ Dense(3 => 3) 2 arrays, 12 params, 128 bytes
│ ╰── a: ArrayModel([postimputing]Dense(2053 => 3)) 3 arrays, 6_165 params, 24.199 KiB
╰── ProductModel ↦ Dense(6 => 3) 2 arrays, 21 params, 164 bytes
├── ArrayModel(Dense(1 => 3)) 2 arrays, 6 params, 104 bytes
╰── BagModel ↦ SegmentedLSE(2) ↦ Dense(2 => 3) 4 arrays, 13 params, 212 bytes
╰── ArrayModel(Chain(Dense(2 => 2), Dense(2 => 2))) 4 arrays, 12 params, 208 bytes
ProductModel ↦ Dense(6 => 3) 2 arrays, 21 params, 172 bytes
├── ProductModel ↦ Dense(3 => 3) 2 arrays, 12 params, 136 bytes
│ ╰── a: ArrayModel([postimputing]Dense(2053 => 3)) 3 arrays, 6_165 params, 24.207 KiB
╰── ProductModel ↦ Dense(6 => 3) 2 arrays, 21 params, 172 bytes
├── ArrayModel(Dense(1 => 3)) 2 arrays, 6 params, 112 bytes
╰── BagModel ↦ SegmentedLSE(2) ↦ Dense(2 => 3) 4 arrays, 13 params, 220 bytes
╰── ArrayModel(Chain(Dense(2 => 2), Dense(2 => 2))) 4 arrays, 12 params, 224 bytes
```
See also: [`AbstractMillNode`](@ref), [`AbstractMillModel`](@ref), [`ProductNode`](@ref), [`BagNode`](@ref), [`ArrayNode`](@ref).
Expand Down
10 changes: 5 additions & 5 deletions src/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Print summary of parameters of node `n`.
# Examples
```jldoctest
julia> n = ProductNode(ArrayNode(randn(2, 3)))
ProductNode 3 obs, 8 bytes
╰── ArrayNode(2×3 Array with Float64 elements) 3 obs, 96 bytes
ProductNode 3 obs, 0 bytes
╰── ArrayNode(2×3 Array with Float64 elements) 3 obs, 104 bytes
julia> datasummary(n)
"Data summary: 3 obs, 112 bytes."
"Data summary: 3 obs, 104 bytes."
```
See also: [`modelsummary`](@ref).
Expand Down Expand Up @@ -104,10 +104,10 @@ Print summary of parameters of model `m`.
```jldoctest
julia> m = ProductModel(ArrayModel(Dense(2, 3)))
ProductModel ↦ identity
╰── ArrayModel(Dense(2 => 3)) 2 arrays, 9 params, 116 bytes
╰── ArrayModel(Dense(2 => 3)) 2 arrays, 9 params, 124 bytes
julia> modelsummary(m)
"Model summary: 2 arrays, 9 params, 116 bytes"
"Model summary: 2 arrays, 9 params, 124 bytes"
```
See also: [`datasummary`](@ref).
Expand Down
Loading

0 comments on commit 89a231f

Please sign in to comment.