Procedures to work with MNIST dataset, usable with data format as provided in this repo and not the original data format (idx).
TODO make MNIST work with arbitrary precision
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(:) |
Returns an array of 10 reals, with zeros everywhere and a one corresponding to the input number, for example: digits(0) = [1., 0., 0., 0., 0., 0., 0., 0., 0., 0.] digits(1) = [0., 1., 0., 0., 0., 0., 0., 0., 0., 0.] digits(6) = [0., 0., 0., 0., 0., 0., 1., 0., 0., 0.]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | x |
Loads the MNIST dataset into arrays.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(inout), | allocatable | :: | tr_images(:,:) | ||
| real(kind=rk), | intent(inout), | allocatable | :: | tr_labels(:) | ||
| real(kind=rk), | intent(inout), | allocatable | :: | te_images(:,:) | ||
| real(kind=rk), | intent(inout), | allocatable | :: | te_labels(:) | ||
| real(kind=rk), | intent(inout), | optional | allocatable | :: | va_images(:,:) | |
| real(kind=rk), | intent(inout), | optional | allocatable | :: | va_labels(:) |
Prints a single image and label to screen.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=rk), | intent(in) | :: | images(:,:) | |||
| real(kind=rk), | intent(in) | :: | labels(:) | |||
| integer(kind=ik), | intent(in) | :: | n |