Converts an array of MNIST labels into a form that can be input to the network_type instance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | labels(:) |
pure function label_digits(labels) result(res)
!! Converts an array of MNIST labels into a form
!! that can be input to the network_type instance.
real(rk), intent(in) :: labels(:)
real(rk) :: res(10, size(labels))
integer(ik) :: i
do i = 1, size(labels)
res(:,i) = digits(labels(i))
end do
end function label_digits