CDF Files

The CDF files title_ID_train.cdf and title_ID_test.cdf are binary files that store the data required for training and testing 1D CNNs in a format recognizable by the executable file.

Suppose that the training data consists of N frames (i.e. 1D arrays) (X1, X2, .. , XN) and each frame consists of Nf samples. Each frame is associated with a classification vector Ci of length Nc that classifies the frame into one of Nc classes. For example, the classification vector [0, 1, 0, .. , 0] indicates that the frame corresponds to the 2nd class.

The training CDF file should then include the following items arranged in a single column vector. The column vector includes the CNN attributes, then the classification vectors, and finally the input frames:

Part 1 :CDF attributes:

  • ID: ID of the CDF file.
  • N: number of training frames.
  • Nf: frame size.
  • Number of input channels = 1.
  • Nc: number of classes.

Part 2: List the N classification vectors one by one

  • C1,1
  • C1,2
  • C1,Nc
  • CN,1
  • CN,2
  • CN,Nc

Part 3: List the associated N input frames one by one

  • X1,1
  • X1,2
  • X1,Nf
  • XN,1
  • XN,2
  • XN,Nf

To generate a cdf file using Matlab, you can simple store the aforementioned items in a column vector COL and use the following code to save the vector into a CDF file:

ftr = fopen('example_1_train.cdf'],'w'); fwrite(ftr,COL,'float');

Please note that the same procedure can be followed to generate the testing CDF title_ID_test.cdf.