{
  "fetched_at": "2026-10-19T07:15:46Z",
  "source_url": "https://www.kaggle.com/competitions/Fall-11-785-homework-3-part-2/data",
  "pages": [
    {
      "name": "rules",
      "content": "CMU Academic Integrity Policy applies. Submit only your own work. Ask on Piazza if you have questions. Good luck!",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "data-description",
      "content": "## Data Files\n\nData files are available for download from this page.\n## File descriptions\n\n    \n- **wsj0_test.npy** - test features\n- **wsj0_train.npy** - training features\n- **wsj0_train_merged_labels.npy** - training labels\n- **wsj0_dev.npy** - development/validation features\n- **wsj0_dev_merged_labels.npy** - development/validation labels\n- **wsj0_test.npy** - test features\n- **sample_submission.csv** - sample submission in correct format. Submission is a single silence phoneme (\".\") for each utterance.\n- **phoneme_list.py** - List of phoneme full names, and list of phoneme single-character encodings.\n\n## Feature Files\n\nSame data layout as previously.\n## Label Files\n\nArray length is the number of utterances. Each item in the array is an array that is the length of the number of phonemes in that utterance. The labels are [0-45], 46 phonemes.",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "Description",
      "content": "## HW3P2\n\nThis is the contest for 11-785 homework 3 part 2.\n\nThe WSJ dataset will be used for this contest.  We are going to be using unaligned labels in this contest. That means you are given the list of phonemes for each utterance, but not which frames correspond to which phonemes. \n\nInference of the alignment will require using CTC loss. \n\n## What does the data look like?\n\nInput data is an array of utterances, each of which is shaped (frames, frequencies).\n\nLabels are simply the list of phonemes in the utterance [0-45]. There are 46 phoneme labels. The phoneme array will be as long as however many phonemes are in the utterance. We provide a lookup mapping each phoneme to a single character for the purposes of this competition. Example below:\n\nThe first sentence in the development set is the following:\n\n    THE FEMALE PRODUCES A LITTER OF TWO TO FOUR YOUNG IN NOVEMBER AND DECEMBER\n\nThe first item in the dev datafile is an array of ints. If you were to print those integers using our map of phonemes to characters, you would print the following:\n\n    .DhfImElpRhdUsizhlitrhvtUtifoR?hGinnOvembrAnddisembr_.\n\nIf you sound it out, you can convince yourself that these are the phonemes for the sentence above.\n## The Task\n\nPredict the phonemes contained in utterances in the test set. You are not given aligned phonemes in the training data, and you are not asked to produce alignment for the test data.\n",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "Evaluation",
      "content": "You will be evaluated using Kaggle's character-level string edit distance. Since we mapped each phoneme to a single character, that means you are being evaluated on phoneme edit distance.\n\nWe are using Levenshtein distance, which counts how many additions deletions and modifications are required to make one sequence into another.\n\nhttps://en.wikipedia.org/wiki/Levenshtein_distance\n\nYour submission should be a CSV file. The headers should be \"Id\", and \"Predicted\". - Id refers to the 0-based index of utterance in the test set - Predicted is the phoneme string\n\nSee sample submission for details.",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "CTC",
      "content": "### CTC Loss\n \nAs described above, there is no alignment between utterances and their corresponding phonemes. Thus, Train your network using CTC loss. Decode your predictions, preferably using beam search. Use the list of phonemes provided on the data page to make each prediction into a text string.\n\nTensor flow has built-in CTC loss function. But for Pytorch, You can use a docker image that has the required CTC-loss library, Wrap-CTC, installed. The docker image name is **`cmudeeplearning11785/machine_learning_gpu`**.  You can read the documentation for wrap-CTC [here][1]. \n\n\n**Using Warp CTC in pytorch** \n\nThe module assumes the blank position is at `0`. If there are `n` labels, the model output should be of size `n+1`. The targets passed to the loss function should be from `1` to `n` instead of from `0` to `n-1`. \n\nThe loss function takes four inputs. The first input is a tensor of your model network output. The second input is a tensor of all the labels should be concatenated into one single 1D tensor. The third input is a tensor containing the size of each output sequence from the network. The fourth input is a tensor containing the label of each target.  \n\nYour submission should contain the predicted strings for each item in the test set.\n\n### CTC Decoding\n\nFor the Kaggle competition, the provided docker image has a pytorch library that you can use to perform beam search, [here][2] is the link to the library. Tensorflow has it's own implementation of beam search.   \n\nThis homework has an additional auto-graded section. The auto-graded section will require you to implement two CTC decoding algorithms. These are **Greedy or best path search** and **Beam search**.  \n\n**Greedy or best path search:** At each time step your model will output a probability distribution of all the symbols. In best path search, you will pick the maximum probable symbol at each time step. \n\n**Beam Search:** In beam search, you will keep the best scoring beams at each time step. This will be done iteratively and at the final time step, the best scoring beam will be selected. For the complete algorithm, please go through [this][4] reference.\n\nGo to [autolab][3]  and download the handout. Inside the handout, You will find a `hw3_part2_ctc_decoding.py` file. The file has two methods `beam_search_decoder` and `best_path_decoder`. Your task is to implement these methods and submit the file to autolab. \n\n - In the handout, You will also find the following sample data files. These files include sample probabilities, sequence lengths and decoded labels. List of labels can be found in the file `phoneme_list.py` in the data section. \n\nNote: In the provided sample probabilities the probability of the blank symbol is assumed to be at the last index.   \n\n- **Beam_search_decoded_output.txt**: This file has decoded symbols using beam search algorithm. \n\n- **Beam_search_probs.npy**: A numpy array of sample probabilities of shape ( **batch_size** , **maximum sequence length** , **length of labels + 1** )\n\n- **Beam_search_seqs.npy**: A numpy array of shape ( **batch_size** ), which has the sequence length of each element in the batch.\n\n- **Best_path_search_decoded_output.txt**: This file has decoded symbols using best path search algorithm. \n\n- **Best_path_search_probs.npy**: A numpy array of sample probabilities of shape (**batch_size**, **maximum sequence length**, **length of labels + 1** )\n\n- **Best_path_search_seqs.npy**: A numpy array of shape (**batch_size**), which has the sequence length of each element in the batch.\n\n**Best path search**\n\nArguments\n\n 1. The post-soft-max probabilities of the model. It should be of shape (batch_size, maximum sequence length, number of total labels + 1 ).\n 2. A list of labels without the blank symbol\n 3. The length of the sequence of each element in the batch. It should be of shape (bath_size)\n 4. Index of the blank symbol in the probability matrix\n 5. A flag if True, consecutive repetitions are allowed. If false, two consecutive time steps will not have the same label. \n\nReturns list of output label sequences with length (batch_size)\n\n**Beam Search Decoder**\n\nArguments\n\n 1. The post-soft-max probabilities of the model. It should be of shape (batch_size, maximum sequence length, number of total labels + 1 ).\n 2. A list of labels without the blank symbol\n 3. The length of the sequence of each element in the batch. It should be of shape (bath_size)\n 4. Index of the blank symbol in the probability matrix\n 5. Size of the beam\n\nReturns list of output label sequences with length (batch_size) \n\n\n\n  [1]: https://github.com/SeanNaren/warp-ctc\n  [2]: https://github.com/parlance/ctcdecode\n  [3]: http://autolab.andrew.cmu.edu/courses/11785-f18/assessments/homework3part2\n  [4]: http://proceedings.mlr.press/v32/graves14.pdf",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    }
  ]
}