Skip to content

Commit da9c875

Browse files
committed
loss docstrings
1 parent 15329c4 commit da9c875

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/losses/functions.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ of label smoothing to binary distributions encoded in a single number.
106106
# Example
107107
```jldoctest
108108
julia> y = Flux.onehotbatch([1, 1, 1, 0, 1, 0], 0:1)
109-
2×6 Flux.OneHotArray{2,2,Vector{UInt32}}:
110-
0 0 0 1 0 1
111-
1 1 1 0 1 0
109+
2×6 OneHotMatrix(::Vector{UInt32}) with eltype Bool:
110+
⋅ ⋅ ⋅ 1 1
111+
1 1 1 1
112112
113113
julia> y_smoothed = Flux.label_smoothing(y, 0.2f0)
114114
2×6 Matrix{Float32}:
@@ -171,10 +171,10 @@ See also: [`logitcrossentropy`](@ref), [`binarycrossentropy`](@ref), [`logitbina
171171
# Example
172172
```jldoctest
173173
julia> y_label = Flux.onehotbatch([0, 1, 2, 1, 0], 0:2)
174-
3×5 Flux.OneHotArray{3,2,Vector{UInt32}}:
175-
1 0 0 0 1
176-
0 1 0 1 0
177-
0 0 1 0 0
174+
3×5 OneHotMatrix(::Vector{UInt32}) with eltype Bool:
175+
1 ⋅ ⋅ ⋅ 1
176+
1 1
177+
⋅ ⋅ 1 ⋅ ⋅
178178
179179
julia> y_model = softmax(reshape(-7:7, 3, 5) .* 1f0)
180180
3×5 Matrix{Float32}:
@@ -222,10 +222,10 @@ See also: [`binarycrossentropy`](@ref), [`logitbinarycrossentropy`](@ref), [`lab
222222
# Example
223223
```jldoctest
224224
julia> y_label = Flux.onehotbatch(collect("abcabaa"), 'a':'c')
225-
3×7 Flux.OneHotArray{3,2,Vector{UInt32}}:
226-
1 0 0 1 0 1 1
227-
0 1 0 0 1 0 0
228-
0 0 1 0 0 0 0
225+
3×7 OneHotMatrix(::Vector{UInt32}) with eltype Bool:
226+
1 ⋅ ⋅ 1 1 1
227+
1 ⋅ ⋅ 1 ⋅ ⋅
228+
⋅ ⋅ 1 ⋅ ⋅ ⋅ ⋅
229229
230230
julia> y_model = reshape(vcat(-9:0, 0:9, 7.5f0), 3, 7)
231231
3×7 Matrix{Float32}:
@@ -280,9 +280,9 @@ julia> all(p -> 0 < p < 1, y_prob[2,:]) # else DomainError
280280
true
281281
282282
julia> y_hot = Flux.onehotbatch(y_bin, 0:1)
283-
2×3 Flux.OneHotArray{2,2,Vector{UInt32}}:
284-
0 1 0
285-
1 0 1
283+
2×3 OneHotMatrix(::Vector{UInt32}) with eltype Bool:
284+
1
285+
1 1
286286
287287
julia> Flux.crossentropy(y_prob, y_hot)
288288
0.43989f0

0 commit comments

Comments
 (0)