FluxML / FluxML/OneHotArrays.jl

Not every OneHotVector `isa OneHotVector`

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
19
Forks
10
PR merge metrics
No merged PRs in 30d

Description

This `y` is a little odd. Is the problem just that `show` lies about its type, or that the alias `OneHotVector` is overly specific?
```julia
julia> x = onehotbatch(fill(2), 1:3)
3-element OneHotVector(::UInt32) with eltype Bool:

1

julia> x isa OneHotVector # no problem!
true

julia> dump(x)
OneHotVector{UInt32}
indices: UInt32 0x00000002
nlabels: Int64 3

julia> y = OneHotArray(fill(2), 3)
3-element OneHotVector(::Array{Int64, 0}) with eltype Bool:

1

julia> y isa OneHotVector # problem?
false

julia> dump(y) # has mutable storage
OneHotArray{Int64, 0, 1, Array{Int64, 0}}
indices: Array{Int64}(()) fill(2)
nlabels: Int64 3
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the `onehotbatch` and `OneHotArray` examples from the issue and inspect their displayed types and `dump` output. Determine whether the intended change concerns `show`, the `OneHotVector` alias, or the relationship between these representations; done means the project has a decided, consistent type/API behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
machine-learning
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.