CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Unable to address, or use elements of .z output either in config.cntk and in an eval section

Open amzador2 opened this issue 8 years ago • 2 comments

I am learning BrainScript and the config files using the CIFAR-10 demo and my own 32x32x3 images. The CIFAR-10 demos work fine, but I cannot find any clear documentation regarding using the z output array elements separately e.g. z[i]. I wish to output the predicted label for a given new image after training a set, to be identified by an evaluation config file - Guesser.cntk (as available via Dr. McCaffrey's page at Microsoft). I managed to get Softmax (z) to work as well as getting "one-hot" output from Hardmax (Softmax (z)). I want the label number (0...6), and as I am using CNTK 2.0 beta 5, there is no Argmax routine. If I could address the z[i] elements separately, I could either use if statements, count up to the first non-zero element, or I could create an array as a column vector with integers 0 - 6 and find the dot product with each image's one-hot array. I cannot access these arrays in the config file, and I cannot do basic array algebra in it to generate the label itself. Any help would be appreciated. ImageHandsOn_Solution5.zip Guesser.zip

amzador2 avatar Mar 08 '18 08:03 amzador2

Hi,

Beta 5 is very old, can't you move to new ve3rsion. Also is there a reason of using BrainScript instead of Python? Here the updated tutorials: https://github.com/Microsoft/CNTK/blob/master/Tutorials/CNTK_201B_CIFAR-10_ImageHandsOn.ipynb

ebarsoumMS avatar Mar 09 '18 01:03 ebarsoumMS

The code works other than this detail, and switching CNTK versions and languages is not going to fix this problem soon, as I would have to get up to speed from zero in Python. Please help me out.

amzador2 avatar Mar 09 '18 07:03 amzador2