Scidata.FashionMNIST.labels_info

You're seeing just the function labels_info, go back to Scidata.FashionMNIST module for more information.

Shows descriptions of dataset labels.

Examples

iex> transform_labels = fn {b, t, _} -> b |> Nx.from_binary(t) end
#Function<44.97283095/1 in :erl_eval.expr/5>
iex> {_, labels} = Scidata.FashionMNIST.download(transform_labels: transform_labels)
{{<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...>>,
  {:u, 8}, {60000, 28, 28}}, #Nx.Tensor<
   u8[60000]
   [9, 0, 0, 3, 0, 2, 7, 2, 5, 5, 0, 9, 5, 5, 7, 9, 1, 0, 6, 4, 3, 1, 4, 8, 4, 3, 0, 2,
    4, 4, 5, 3, 6, 6, 0, 8, 5, 2, 1, 6, 6, 7, 9, 5, 9, 2, 7, 3, ...]
>}
iex> label_names = Scidata.FashionMNIST.labels_info()
["t_shirt/top", "trouser", "pullover", "dress", "coat", "sandal", "shirt",
 "sneaker", "bag", "ankle_boot"]
iex> labels |> Nx.to_flat_list() |> Enum.map(fn label_index -> Enum.at(label_names, label_index) end)
["ankle_boot", "t_shirt/top", "t_shirt/top", "dress", "t_shirt/top", "pullover",
 "sneaker", "pullover", "sandal", "sandal", "t_shirt/top", "ankle_boot", ...]