blob: 338b7f8a13f673004930f851a0e0e4b4ffdaf7d8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
function load_data(::Symbol; ::Int) :: Tuple
# <- @keyword.function
# ^ @function.call
# ^ @punctuation.bracket
# ^^ @operator
# ^ @type.builtin
# ^ @punctuation.delimiter
# ^^ @operator
# ^^^ @type.builtin
# ^ @punctuation.bracket
# ^^ @operator
# ^ @type.builtin
dataset = CIFAR10(; Tx = Float32, split = split)
# ^^^^^^^ @variable
# ^ @operator
# ^ @function.call
# ^ @operator
# ^ @type.builtin
X = reshape(dataset.features[:, :, :, begin:n_obs], :, n_obs) # flattening the image pixels
# ^^^^^ @variable.builtin
y = categorical2onehot(dataset.targets[begin:n_obs], N_LABELS)
# ^^^^^ @variable.builtin
return X, y
# ^^^^^^ @keyword.return
end
# <- @keyword.function
|