来自:https://github.com/Microsoft/CNTK/wiki/CNTKTextFormat-Reader
“序列ID是一个数字。可以省略,在这种情况下,行号将用作序列ID。”
假设我已经从这样的来源创建了一个小批量:
地图文件:
|labels 0 0 0 1 0 0 |features 3
|labels 0 0 0 0 0 1 |features 7
|labels 1 0 0 0 0 0 |features 1
|labels 1 0 0 0 0 0 |features 9
|labels 1 0 0 0 0 0 |features 4
代码:
from cntk import Trainer, StreamConfiguration, text_format_minibatch_source, learning_rate_schedule, UnitType
mb_source = text_format_minibatch_source('test_map2.txt', [
StreamConfiguration('features', 1),
StreamConfiguration('labels', 6)])
test_minibatch = mb_source.next_minibatch(5)
如何从小批量中检索序列ID?