<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 The CLSTM command line tools take their training data in HDF5 files (you will evenutally also be able to train directly from images saved on disk, as in ocropy, but that's not quite implemented yet). This illustrates how to store images into an HDF5 file and then how to run the clstmctc training tool on the data.
The UW3-500 Dataset
We illustrate loading data with the uw3-500.tgz dataset, available from tmbdev.net.
Step1:  Let's untar the file unless it has already been untarred.
Step2:  The UW3-500 dataset is a collection of text line images and corresponding ground truth transcription. It's organized as a directory tree of the form book/&lt;page_no&gt;/&lt;line_id&gt;.bin.png etc.
Step3:  Let's now run clstmctc training. We report every 100 training steps. Since we didn't dewarp or size-normalize the lines, we need to use a dewarp=center argument to training.
<ASSISTANT_TASK:>
Python Code:
!test -f uw3-500.tgz || wget -nd http://www.tmbdev.net/ocrdata/uw3-500.tgz
Explanation: The CLSTM command line tools take their training data in HDF5 files (you will evenutally also be able to train directly from images saved on disk, as in ocropy, but that's not quite implemented yet). This illustrates how to store images into an HDF5 file and then how to run the clstmctc training tool on the data.
The UW3-500 Dataset
We illustrate loading data with the uw3-500.tgz dataset, available from tmbdev.net.
End of explanation
!test -d book || tar -zxvf uw3-500.tgz
Explanation: Let's untar the file unless it has already been untarred.
End of explanation
!ls book/0005/010001.*
Explanation: The UW3-500 dataset is a collection of text line images and corresponding ground truth transcription. It's organized as a directory tree of the form book/&lt;page_no&gt;/&lt;line_id&gt;.bin.png etc.
End of explanation
!dewarp=center report_every=500 save_name=test save_every=10000 ntrain=11000 ../clstmctc uw3-500.h5
!ls book/*/*.bin.png | sort -r > uw3.files
!sed 100q uw3.files > uw3-test.files
!sed 1,100d uw3.files > uw3-train.files
!wc -l uw3*.files
!params=1 save_name=uw3small save_every=1000 report_every=100 maxtrain=50000 test_every=1000 ../clstmocrtrain uw3-train.files uw3-test.files
Explanation: Let's now run clstmctc training. We report every 100 training steps. Since we didn't dewarp or size-normalize the lines, we need to use a dewarp=center argument to training.
End of explanation
<END_TASK>