Row 33469
Content Data
This page contains data entry 33469 from the Axioma AXP content repository. The structured data below represents the complete record for this entry.
I have a directory of files, where each file represents a raw radio waveform. It is saved as a sequence of samples, where each sample entry is written out as separate real and imaginary parts. Both parts are encoded as 32-bit floats, so one sample is 8 bytes. There are 2\^14 samples, so each file contains exactly 8 \* 2\^14 bytes. There is no header or footer present.
I'd like to read each file in as its own "element" into a dataset (avoid concatenating data from different files together). I thought [FixedLengthRecord](https://www.tensorflow.org/api_docs/python/tf/data/FixedLengthRecordDataset) would be appropriate, so I attempted to create a dataset like so:
fnames = tf.data.Dataset.list_files('data/**/*.bin') dataset = tf.data.FixedLengthRecordDataset(fnames, record_bytes= 8*2**14)
I'm not sure how exactly to inspect the structure of the dataset, but I know its element spec has a dtype of \`tf.string\` which is not desired. Ideally, I'd like to read the contents of each file into a 1D tensor of \`tf.complex64\`. I cannot find many examples of working with FixedLengthRecord data, much less in a format this simple. Any help would be appreciated.
| Field | Value |
|---|---|
| text | I have a directory of files, where each file represents a raw radio waveform. It is saved as a sequence of samples, where each sample entry is written out as separate real and imaginary parts. Both parts are encoded as 32-bit floats, so one sample is 8 bytes. There are 2\^14 samples, so each file contains exactly 8 \* 2\^14 bytes. There is no header or footer present. I'd like to read each file in as its own "element" into a dataset (avoid concatenating data from different files together). I … |
| label | r/tensorflow |
| dataType | post |
| communityName | r/tensorflow |
| datetime | 2024-05-21 |
| username_encoded | Z0FBQUFBQm5Lak1IWDd3WlI1RmxCaEQtMHJmN09nM2lLTWNZc3Fxb19hbkdVVTJQbWpRdHM0SUQ1ajZEandfVF9ETmtURDJySVZoemtqT1FaSVJ6X2hjX3Y2MzNWeFZEbkE9PQ== |
| url_encoded | Z0FBQUFBQm5Lak9YanNMQjdsVmRjVWxlc2V3RzF6M3FnNHdwTmdZRTFpNW00TzB1Y29KZ043Y2E0cjhkQmlXTTJxak9MUlVXdlRxdmVnaHFzNF9ISlotVzNZSWE0WGJQOUpRLTVkSzR5OHFleWplVFJqSTBCNnFpYTU4THBqR3NNUlNRT0luTzQ3Q3VTaTJ1TzkxSDJWbVBzNEcweTYwZE1pQ29Va2NHVkxqVlY0YnlxUFZYNi03M00yLVpqRDdoa0UtYWtIMm1GMjZm |
Raw Record
{
"text": "I have a directory of files, where each file represents a raw radio waveform. It is saved as a sequence of samples, where each sample entry is written out as separate real and imaginary parts. Both parts are encoded as 32-bit floats, so one sample is 8 bytes. There are 2\\^14 samples, so each file contains exactly 8 \\* 2\\^14 bytes. \nThere is no header or footer present.\n\nI'd like to read each file in as its own \"element\" into a dataset (avoid concatenating data from different files together). I thought [FixedLengthRecord](https://www.tensorflow.org/api_docs/python/tf/data/FixedLengthRecordDataset) would be appropriate, so I attempted to create a dataset like so:\n\n fnames = tf.data.Dataset.list_files('data/**/*.bin')\n dataset = tf.data.FixedLengthRecordDataset(fnames, record_bytes= 8*2**14)\n\nI'm not sure how exactly to inspect the structure of the dataset, but I know its element spec has a dtype of \\`tf.string\\` which is not desired. Ideally, I'd like to read the contents of each file into a 1D tensor of \\`tf.complex64\\`. I cannot find many examples of working with FixedLengthRecord data, much less in a format this simple. Any help would be appreciated.",
"label": "r/tensorflow",
"dataType": "post",
"communityName": "r/tensorflow",
"datetime": "2024-05-21",
"username_encoded": "Z0FBQUFBQm5Lak1IWDd3WlI1RmxCaEQtMHJmN09nM2lLTWNZc3Fxb19hbkdVVTJQbWpRdHM0SUQ1ajZEandfVF9ETmtURDJySVZoemtqT1FaSVJ6X2hjX3Y2MzNWeFZEbkE9PQ==",
"url_encoded": "Z0FBQUFBQm5Lak9YanNMQjdsVmRjVWxlc2V3RzF6M3FnNHdwTmdZRTFpNW00TzB1Y29KZ043Y2E0cjhkQmlXTTJxak9MUlVXdlRxdmVnaHFzNF9ISlotVzNZSWE0WGJQOUpRLTVkSzR5OHFleWplVFJqSTBCNnFpYTU4THBqR3NNUlNRT0luTzQ3Q3VTaTJ1TzkxSDJWbVBzNEcweTYwZE1pQ29Va2NHVkxqVlY0YnlxUFZYNi03M00yLVpqRDdoa0UtYWtIMm1GMjZm"
}
Entry Information
- Entry ID: 33469
- Repository: Axioma AXP
- Dataset: arrmlet/reddit_dataset_36
- Total Entries: 100,000