Understand the example for Simple 3-layer MLP using MXNet in Julia

248 views Asked by At

I have a basic understanding of neural networks. I understand that there should be a y matrix (expected result) which stores 0 or 1 corresponding to different category labels. As an example, for digit recognition, if the number to be identified is 6 then the y vector should be [0,0,0,0,0,1,0,0,0,0]. However, when I see the MXNet example in MXNet.jl repository on Github, I could not identify any code which prepares this kind of result matrix. I think the magic lies in the get_mnist_providers() method which returns 2 providers:

train_provider, eval_provider = get_mnist_providers(batch_size)

I have no idea what these providers are - train_provider, eval_provider. Please help me understand these providers. I am trying to write an algorithm which has different classifications, so understanding this provider is vital.

1

There are 1 answers

2
Karishma Malkan On

You are right as to providing the y vector corresponding to labels. In MXNet there is the concept of iterators. The iterators are used to bind the data to the labels. What your get_mnist_providers method is probably doing is providing the data iterator which has the corresponding label attached to it.

For a more detailed understanding on how data iterators fit into the whole picture of model optimization, you can try this tutorial (links to mxnet-notebooks Github repository): linear-regression.ipynb

(You will need jupyter notebook to run the tutorial. just pip install jupyter and then run the command 'jupyter notebook' in the folder where the tutorial file exists)