BinaryReader is not explained in wiki
I was just wondering, if there is any explanation of BinaryData format in wiki page? Binary files are very compact and faster to generate in comparison to text files.
I would also appreciate an explanation for the binary reader. I am looking for examples for it now...
We are moving away from the existing Reader architecture, so the BinaryReader is deprecated (or will be soon). A new binary reader for the new architecture is being written, but not ready. The other existing binary reader is the speech reader (HTKFeatureDeserializer), which works for single streams of dense feature vectors/tensors.
HTK feature archives are just column-major float32 matrices with a 12-byte header, and a descriptor text file. The format is described at the end of this page.
That's wonderful to hear! I was trying to write my own custom Reader a while back and was completely lost. I'm glad to hear you're working on a new architecture.
Have a look at ITK's ImageIOBase. If there was an ITKImageReader, you could read almost any image format of any dimension without needing to write too much code. It'll even silently convert between pixel types. You could always load float/double data without needing to worry about whether the raw data is stored that way. https://itk.org/Doxygen/html/classitk_1_1ImageIOBase.html https://itk.org/Doxygen/html/classitk_1_1ImageIOFactory.html https://itk.org/Doxygen/html/classitk_1_1Image.html
Although, admittedly ITK is not too friendly if you're not using CMake. One would have to put the numerous dependencies in the Visual Studio prop sheets manually and this is very painful!
@frankseide I am trying to write my image datasets into the binary format that can be read by BinaryReader into CNTK. I am wondering if there are some examples? Or it is not an easy task?
Thank you for your reply!
@LowerySJ Hi, did you find any example? Thank you!
@pinzhang10 , sorry I did not find any examples. Good luck with your work!
The binary reader used Window only APIs and only works on Windows. It was designed as a cache to the UCIFastReader so that you only need to parse the text file once.
@LowerySJ Thank you very much for your reply. I think I may need to write our customized reader.
@dongyu888 Thank you for your comment. That means the BinaryReader is not used to read binary format input directly. If I want to use it in this way, I need to follow the code in UCIFastReader and write a customized reader by myself?
no, you just need to turn on the cache mode and the text fike will be converted to the binary mode automatically.
Thanks, Dong Yu (俞栋)Sent from my smart phone. Please forgive my typos.
@dongyu888 Thank you for your comment. That means the BinaryReader is not used to read binary format input directly. If I want to use it in this way, I need to follow the code in UCIFastReader and write a customized reader by myself?
You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Microsoft/CNTK/issues/562#issuecomment-229539277
@dongyu888 My problem is: I won't be able to have a text file since it will be too big in our project. I have to convert the data in our format into binary format and read it in later using BinaryReader directly into CNTK. I am wondering if there is a simple way for me to do it or I need to write our customized writer and reader to do the whole procedure? Thank you!
i think you can just write your data to the binary format directly. if you can not find doc you may need to read the binary reader code to understand the format.
Thanks, Dong Yu (俞栋)Sent from my smart phone. Please forgive my typos.
@dongyu888 My problem is: I won't be able to have a text file since it will be too big in our project. I have to convert the data in our format into binary format and read it in later using BinaryReader directly into CNTK. I am wondering if there is a simple way for me to do it or I need to write our customized writer and reader to do the whole procedure? Thank you!
You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Microsoft/CNTK/issues/562#issuecomment-229826517
@dongyu888 OK, got it. Thank you very much for your reply!