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])
|
julia> onehot(:b, [:a, :b, :c])
|
||||||
3-element Flux.OneHotVector:
|
3-element Flux.OneHotVector:
|
||||||
false
|
0
|
||||||
true
|
1
|
||||||
false
|
0
|
||||||
|
|
||||||
julia> onehot(:c, [:a, :b, :c])
|
julia> onehot(:c, [:a, :b, :c])
|
||||||
3-element Flux.OneHotVector:
|
3-element Flux.OneHotVector:
|
||||||
false
|
0
|
||||||
false
|
0
|
||||||
true
|
1
|
||||||
```
|
```
|
||||||
|
|
||||||
The inverse is `onecold` (which can take a general probability distribution, as well as just booleans).
|
The inverse is `onecold` (which can take a general probability distribution, as well as just booleans).
|
||||||
|
|
Loading…
Reference in New Issue