1

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.

charlesreid1
  • 4,360
  • 4
  • 30
  • 52
Abhishek Kishore
  • 340
  • 2
  • 13
  • 1
    The example I am referring to is present here - https://github.com/dmlc/MXNet.jl – Abhishek Kishore Feb 01 '17 at 11:32
  • Don't forget to accept an answer once your question has been answered. See [What should I do when someone answers my question?](https://stackoverflow.com/help/someone-answers). – charlesreid1 Oct 12 '17 at 20:30

1 Answers1

1

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)

charlesreid1
  • 4,360
  • 4
  • 30
  • 52
Karishma Malkan
  • 2,069
  • 1
  • 16
  • 14
  • Thanks for explaining. – Abhishek Kishore Feb 05 '17 at 15:55
  • The actual function definition for `get_mnist_providers()` can be found in the repository the OP linked to, dmlc/MXNet.jl, in the file [mnist-data.jl](https://github.com/dmlc/MXNet.jl/blob/master/examples/mnist/mnist-data.jl#L1) – charlesreid1 Oct 12 '17 at 20:31