From 30aa814c4d0a4e088d99b169e259e6cd5f0eec22 Mon Sep 17 00:00:00 2001 From: Dhairya Gandhi Date: Sun, 3 Feb 2019 18:43:16 +0530 Subject: [PATCH] fixes #582 --- src/onehot.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/onehot.jl b/src/onehot.jl index 307611cc..c82dce23 100644 --- a/src/onehot.jl +++ b/src/onehot.jl @@ -78,6 +78,8 @@ onecold(y::AbstractVector, labels = 1:length(y)) = labels[Base.argmax(y)] onecold(y::AbstractMatrix, labels...) = dropdims(mapslices(y -> onecold(y, labels...), y, dims=1), dims=1) +onecold(y::OneHotMatrix, labels...) = map(x -> onecold(x, labels...), y.data) + function argmax(xs...) Base.depwarn("`argmax(...)` is deprecated, use `onecold(...)` instead.", :argmax) return onecold(xs...)