How to output node value?
i got trained model. But i cannot found a way to output network node value(DeepID)? any ideas, the example of 2d is confused to me。
By default, “write” will write nodes that are tagged as “output” in the network.
You can select that different nodes get output by the outputNodeNames option. Could you try to add an option like this:
outputNodeNames = DeepID
Thanks,
Frank
From: bb2103 [mailto:[email protected]] Sent: Tuesday, February 23, 2016 17:49 To: Microsoft/CNTK [email protected] Subject: [CNTK] How to output node value? (#155)
i got trained model. But i cannot found a way to output network node value(DeepID)? any ideas, the example of 2d is confused to me。
— Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/155.
Sry, im mean how to call cntk to get output value. In 2d example, its only add one output stage, you can just run it to get output. I feel its hard to Understand. Its there any steps like 'Caffe.FORWARD()'
If you want to write values to a file, please use a “write” command. It is similar to the “test” command, but change action to “write” and add a parameter outputPath = “…” with your target pathname.
I added an example to Simple.cntk, but it may take until Monday to get merged. Here is a simplified version:
Simple_Demo_Output=[ action = "write"
# Parameter values for the reader
reader = [
readerType = "UCIFastReader"
file = "$DataDir$/SimpleDataTest.txt"
randomize = "none"
features = [
dim = 2
start = 0
]
labels = [
start = 2
dim = 1
labelDim = 2
labelMappingFile = "$DataDir$/SimpleMapping.txt"
]
]
outputNodeNames = PosteriorProb : labels # Select the nodes to print. If this is not given, the nodes tagged as "output" are printed instead.
outputPath = "$OutputDir$/SimpleOutput" # Path to write to. ".NODENAME" will be appended.
#outputPath = "-" # As an alternative, this prints to stdout.
]
From: bb2103 [mailto:[email protected]] Sent: Friday, February 26, 2016 14:32 To: Microsoft/CNTK [email protected] Cc: Frank Seide [email protected] Subject: Re: [CNTK] How to output node value? (#155)
Sry, im mean how to call cntk to get output value. In 2d example, its only add one output stage, you can just run it to get output. I feel its hard to Understand. Its there any steps like 'Caffe.FORWARD()'
— Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/155#issuecomment-189509617.
3ks for ur patience. The last question, is the ndl network file is needed?
NDL allows you to define custom networks. For the most standard configurations, you can use the SimpleNetworkBuilder.
From: bb2103 [mailto:[email protected]] Sent: Friday, February 26, 2016 18:05 To: Microsoft/CNTK [email protected] Cc: Frank Seide [email protected] Subject: Re: [CNTK] How to output node value? (#155)
3ks for ur patience. The last question, is the ndl network file is needed?
— Reply to this email directly or view it on GitHubhttps://github.com/Microsoft/CNTK/issues/155#issuecomment-189555790.
@frankseide
Hi, for the code " outputNodeNames = PosteriorProb : labels", is PosteriorProb defined in cntk file or ndl file? If I want to output some intermediate nodes like the nodes "A" between layers, how should I use the name in ndl file for outputNodeNames ?
Thank you!
You need to use the name in the model which may be different from the name in the ndl due to macros used. You can find the correct node name by checking the validation log or dumping the node names using the dumpnode command.
@dongyu888 Thank you so much for your quick reply. I got the node names by checking the validation log. Really appreciate your great help!
Pin