{
  "id": 211856,
  "title": "Is RLE decoder order-dependent?  Is RLE partitionable?",
  "url": "/competitions/hubmap-kidney-segmentation/discussion/211856",
  "author_name": "",
  "post_date": "2021-01-16T14:57:39.958738600Z",
  "votes": 1,
  "comment_count": 1,
  "views": 0,
  "content": "<p>Suppose we have an image that has a very simple RLE:</p>\n<pre><code>120 30 240 70 380 60\n</code></pre>\n<p>Suppose I change the order of the entries:</p>\n<pre><code>240 70 380 60 120 30\n</code></pre>\n<p>Will the RLE decoder give the same result for both cases?   In principle, the two representations are equivalent, but I'm not sure that the implementation of the decoder depends on the ordering of the RLE.</p>\n<p>Second question:   Suppose I change the RLE above to:</p>\n<pre><code>120 15 135 15 240 70 380 60\n</code></pre>\n<p>that is, break up the <code>120 30</code> run into two contiguous sub-runs.   Will that decode the same way as the original RLE?</p>\n<p>The reason I'm asking this is that I'm having problems with OOM in the inference + RLE encoding and wondering whether I can get away with doing it \"in pieces\".   I believe that if this doesn't work, then I can always convert the \"out of order + \"partitioned\" RLE to canonical form (the original) by sorting and the sequentially merging contiguous runs.</p>",
  "messages": [
    {
      "id": "1155667",
      "postDate": "01/16/2021 14:57:39",
      "content": "<p>Suppose we have an image that has a very simple RLE:</p>\n<pre><code>120 30 240 70 380 60\n</code></pre>\n<p>Suppose I change the order of the entries:</p>\n<pre><code>240 70 380 60 120 30\n</code></pre>\n<p>Will the RLE decoder give the same result for both cases?   In principle, the two representations are equivalent, but I'm not sure that the implementation of the decoder depends on the ordering of the RLE.</p>\n<p>Second question:   Suppose I change the RLE above to:</p>\n<pre><code>120 15 135 15 240 70 380 60\n</code></pre>\n<p>that is, break up the <code>120 30</code> run into two contiguous sub-runs.   Will that decode the same way as the original RLE?</p>\n<p>The reason I'm asking this is that I'm having problems with OOM in the inference + RLE encoding and wondering whether I can get away with doing it \"in pieces\".   I believe that if this doesn't work, then I can always convert the \"out of order + \"partitioned\" RLE to canonical form (the original) by sorting and the sequentially merging contiguous runs.</p>",
      "rawMarkdown": "Suppose we have an image that has a very simple RLE:\n\n```\n120 30 240 70 380 60\n```\nSuppose I change the order of the entries:\n```\n240 70 380 60 120 30\n```\nWill the RLE decoder give the same result for both cases?   In principle, the two representations are equivalent, but I'm not sure that the implementation of the decoder depends on the ordering of the RLE.\n\nSecond question:   Suppose I change the RLE above to:\n```\n120 15 135 15 240 70 380 60\n```\nthat is, break up the ```120 30``` run into two contiguous sub-runs.   Will that decode the same way as the original RLE?\n\nThe reason I'm asking this is that I'm having problems with OOM in the inference + RLE encoding and wondering whether I can get away with doing it \"in pieces\".   I believe that if this doesn't work, then I can always convert the \"out of order + \"partitioned\" RLE to canonical form (the original) by sorting and the sequentially merging contiguous runs.",
      "votes": null
    },
    {
      "id": "1155970",
      "postDate": "01/16/2021 20:08:09",
      "content": "<p>As long as it is unique, 120 30 and 120 15 135 15 are equivalent and produces the exact same result when translating it to mask.  I could say the same about the order.  But to submit, we have this rule:</p>\n<p>\"The competition format requires a space delimited list of pairs. For example, '1 3 10 5' implies pixels 1,2,3,10,11,12,13,14 are to be included in the mask. The metric checks that the pairs are sorted, positive, and the decoded pixel values are not duplicated. The pixels are numbered from top to bottom, then left to right: 1 is pixel (1,1), 2 is pixel (2,1), etc.\"</p>",
      "rawMarkdown": "As long as it is unique, 120 30 and 120 15 135 15 are equivalent and produces the exact same result when translating it to mask.  I could say the same about the order.  But to submit, we have this rule:\n\n\"The competition format requires a space delimited list of pairs. For example, '1 3 10 5' implies pixels 1,2,3,10,11,12,13,14 are to be included in the mask. The metric checks that the pairs are sorted, positive, and the decoded pixel values are not duplicated. The pixels are numbered from top to bottom, then left to right: 1 is pixel (1,1), 2 is pixel (2,1), etc.\"",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1155970,
      "author_name": "rpsantosakaggle",
      "author_url": "",
      "post_date": "01/16/2021 20:08:09",
      "content": "<p>As long as it is unique, 120 30 and 120 15 135 15 are equivalent and produces the exact same result when translating it to mask.  I could say the same about the order.  But to submit, we have this rule:</p>\n<p>\"The competition format requires a space delimited list of pairs. For example, '1 3 10 5' implies pixels 1,2,3,10,11,12,13,14 are to be included in the mask. The metric checks that the pairs are sorted, positive, and the decoded pixel values are not duplicated. The pixels are numbered from top to bottom, then left to right: 1 is pixel (1,1), 2 is pixel (2,1), etc.\"</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1155667": "Suppose we have an image that has a very simple RLE:\n\n```\n120 30 240 70 380 60\n```\nSuppose I change the order of the entries:\n```\n240 70 380 60 120 30\n```\nWill the RLE decoder give the same result for both cases?   In principle, the two representations are equivalent, but I'm not sure that the implementation of the decoder depends on the ordering of the RLE.\n\nSecond question:   Suppose I change the RLE above to:\n```\n120 15 135 15 240 70 380 60\n```\nthat is, break up the ```120 30``` run into two contiguous sub-runs.   Will that decode the same way as the original RLE?\n\nThe reason I'm asking this is that I'm having problems with OOM in the inference + RLE encoding and wondering whether I can get away with doing it \"in pieces\".   I believe that if this doesn't work, then I can always convert the \"out of order + \"partitioned\" RLE to canonical form (the original) by sorting and the sequentially merging contiguous runs.",
    "1155970": "As long as it is unique, 120 30 and 120 15 135 15 are equivalent and produces the exact same result when translating it to mask.  I could say the same about the order.  But to submit, we have this rule:\n\n\"The competition format requires a space delimited list of pairs. For example, '1 3 10 5' implies pixels 1,2,3,10,11,12,13,14 are to be included in the mask. The metric checks that the pairs are sorted, positive, and the decoded pixel values are not duplicated. The pixels are numbered from top to bottom, then left to right: 1 is pixel (1,1), 2 is pixel (2,1), etc.\""
  },
  "source": "meta"
}