Merge #1208
1208: Fixing output format for `onehot` r=dhairyagandhi96 a=natema Currently `Flux.OneHotVector` is displayed as a binary vector (0/1) rather than a boolean one (true/false). This is also shown in successive examples in the same page. I fixed the `onehot(:b, [:a, :b, :c])` and `onehot(:c, [:a, :b, :c])` outputs in the first example of the page accordingly. Co-authored-by: natema <natema@users.noreply.github.com>
This commit is contained in:
commit
71ebd51e45
|
@ -7,15 +7,15 @@ julia> using Flux: onehot, onecold
|
|||
|
||||
julia> onehot(:b, [:a, :b, :c])
|
||||
3-element Flux.OneHotVector:
|
||||
false
|
||||
true
|
||||
false
|
||||
0
|
||||
1
|
||||
0
|
||||
|
||||
julia> onehot(:c, [:a, :b, :c])
|
||||
3-element Flux.OneHotVector:
|
||||
false
|
||||
false
|
||||
true
|
||||
0
|
||||
0
|
||||
1
|
||||
```
|
||||
|
||||
The inverse is `onecold` (which can take a general probability distribution, as well as just booleans).
|
||||
|
|
Loading…
Reference in New Issue