{
  "id": 58623,
  "title": "let discuss deep network architecture here",
  "url": "/competitions/trackml-particle-identification/discussion/58623",
  "author_name": "",
  "post_date": "2018-06-11T10:03:25.549915900Z",
  "votes": 14,
  "comment_count": 16,
  "views": 0,
  "content": "<p>i haven't tried the below. but here is one possibility here:</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/341256/9590/Slide4.PNG\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/341256/9591/Slide5.PNG\" alt=\"enter image description here\"></p>",
  "messages": [
    {
      "id": "341256",
      "postDate": "06/11/2018 10:03:25",
      "content": "<p>i haven't tried the below. but here is one possibility here:</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/341256/9590/Slide4.PNG\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/341256/9591/Slide5.PNG\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "i haven't tried the below. but here is one possibility here:\n\n  ![enter image description here][1]\n\n  ![enter image description here][2]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/341256/9590/Slide4.PNG\n  [2]: https://storage.googleapis.com/kaggle-forum-message-attachments/341256/9591/Slide5.PNG",
      "votes": null
    },
    {
      "id": "341258",
      "postDate": "06/11/2018 10:10:22",
      "content": "<p>pytorch kdtree and sampling can be found at:</p>\n\n<p><a href=\"https://github.com/erikwijmans/Pointnet2_PyTorch\">https://github.com/erikwijmans/Pointnet2_PyTorch</a></p>\n\n<p>\"PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space\" -Charles R. Qi Li Yi Hao Su Leonidas J. Guibas, NIPS 2017</p>",
      "rawMarkdown": "pytorch kdtree and sampling can be found at:\n\nhttps://github.com/erikwijmans/Pointnet2_PyTorch\n\n\"PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space\" -Charles R. Qi Li Yi Hao Su Leonidas J. Guibas, NIPS 2017",
      "votes": null
    },
    {
      "id": "342966",
      "postDate": "06/14/2018 13:03:18",
      "content": "<p>Hi Heng,\nI have been working with PointNet (a keras version) and have some indication that the model is capable of recognizing the track pattern out of several thousand points. (see the discussion item: (<a href=\"https://www.kaggle.com/c/trackml-particle-identification/discussion/58782\">https://www.kaggle.com/c/trackml-particle-identification/discussion/58782</a>).\nI had to split the input into transverse momentum bins in order not to make too big a change in the model. As I'm just a user of models with little insight on their actual inner works, I have only made changes at the very last FC layers to be able to identify at most 256 tracks in one event. </p>\n\n<p>I would rather have the model processing all tracks together because I'm not sure how to do the learning piece-wise. I can always change the number of filters in the 1D convolutions and see if the model learns something or even fits in the 10GB\nof a GPU, but I should consult with experts as well.</p>\n\n<p>I sent and email to the PointNet authors at Stanford yesterday and I'm still hoping for a reply. \nThe model increases the 1D conv. number of filters to 1024 at the 5th convolution and then drops to 256 (my change). I understand that with more filters the model can identify more features. Using the Hough transform the only feature of relevance appears to me as \"points aligned along a line\". </p>\n\n<p>If I expect some 3K tracks in the events, should I change the number of filters at the fifth convolution to something like 4096 ?</p>\n\n<p>It would be great I you could give me some hints. Thanks</p>",
      "rawMarkdown": "Hi Heng,\nI have been working with PointNet (a keras version) and have some indication that the model is capable of recognizing the track pattern out of several thousand points. (see the discussion item: (https://www.kaggle.com/c/trackml-particle-identification/discussion/58782).\nI had to split the input into transverse momentum bins in order not to make too big a change in the model. As I'm just a user of models with little insight on their actual inner works, I have only made changes at the very last FC layers to be able to identify at most 256 tracks in one event. \n\nI would rather have the model processing all tracks together because I'm not sure how to do the learning piece-wise. I can always change the number of filters in the 1D convolutions and see if the model learns something or even fits in the 10GB\nof a GPU, but I should consult with experts as well.\n\nI sent and email to the PointNet authors at Stanford yesterday and I'm still hoping for a reply. \nThe model increases the 1D conv. number of filters to 1024 at the 5th convolution and then drops to 256 (my change). I understand that with more filters the model can identify more features. Using the Hough transform the only feature of relevance appears to me as \"points aligned along a line\". \n\nIf I expect some 3K tracks in the events, should I change the number of filters at the fifth convolution to something like 4096 ?\n\nIt would be great I you could give me some hints. Thanks",
      "votes": null
    },
    {
      "id": "343861",
      "postDate": "06/16/2018 11:26:22",
      "content": "<p>I'm thinking of training multiple very simple LTSMs to do different tasks. For example, one is only to predict the next hit using the first 3-5 predicted hits that belong to the same track. The problem is granularity of the output class. If the output class (one-hot encoding) presents all possible coordinates either in the polar system or Cartesian system, the size is going to blow up, says, <code>x*y*z</code>, so we may need to grid the 3D-output box to predict the possible \"cube\" of the next hit, but the prediction error would be pretty high, but on the other hand it allows more grey area too. In this sense it almost looks like a CNN problem to me again, I tend to avoid CNN in this competition. This thought has lots of flaws, but I'm hoping for more discussions in deep learning architecture. </p>",
      "rawMarkdown": "I'm thinking of training multiple very simple LTSMs to do different tasks. For example, one is only to predict the next hit using the first 3-5 predicted hits that belong to the same track. The problem is granularity of the output class. If the output class (one-hot encoding) presents all possible coordinates either in the polar system or Cartesian system, the size is going to blow up, says, `x*y*z`, so we may need to grid the 3D-output box to predict the possible \"cube\" of the next hit, but the prediction error would be pretty high, but on the other hand it allows more grey area too. In this sense it almost looks like a CNN problem to me again, I tend to avoid CNN in this competition. This thought has lots of flaws, but I'm hoping for more discussions in deep learning architecture.",
      "votes": null
    },
    {
      "id": "343927",
      "postDate": "06/16/2018 14:40:05",
      "content": "<p>@Nicole Finnie</p>\n\n<p>i am trying to write the code below. The idea is simple:</p>\n\n<ol>\n<li><p>given an affinity matrix (pairwise similarity), generate track candidates. e.g. choosing the strong links sequentially, or spectral clustering (but i have to implement some automatic way to determine the no. of clusters)</p></li>\n<li><p>for a given current track candidate, classify each point of the track as valid or invalid and also the probability of the link. This is used to update the affinity matrix.</p></li>\n</ol>\n\n<p>The process is repeated.</p>\n\n<pre><code>class GraphNet(nn.Module):\ndef __init__(self, dim):\n    super(GraphNet, self).__init__()\n\n    self.conv1 = ConvBlock(track_size= 2, dim=dim)\n    self.conv2 = ConvBlock(track_size= 4, dim=dim)\n    self.conv3 = ConvBlock(track_size= 8, dim=dim)\n    self.conv4 = ConvBlock(track_size=16, dim=dim)\n\ndef forward(self, point, radius, track):\n    num_point= len(point)\n    affinity = torch.zeros((num_point,num_point)).float().cuda() \n    x        = point.permute(1,0)\n\n    logit    = self.conv1(x, radius, track)\n    affinity = logit_to_affinity(logit, track, affinity)\n\n    track    = affinity_to_track(affinity)\n    logit    = self.conv2(x, radius, track)\n    affinity = logit_to_affinity(logit, track, affinity)\n\n    track    = affinity_to_track(affinity)\n    logit    = self.conv3(x, radius, track)\n    affinity = logit_to_affinity(logit, track, affinity)\n\n    ...\n\n    return affinity\n</code></pre>",
      "rawMarkdown": "Nicole Finnie\n\ni am trying to write the code below. The idea is simple:\n\n1. given an affinity matrix (pairwise similarity), generate track candidates. e.g. choosing the strong links sequentially, or spectral clustering (but i have to implement some automatic way to determine the no. of clusters)\n\n2. for a given current track candidate, classify each point of the track as valid or invalid and also the probability of the link. This is used to update the affinity matrix.\n\nThe process is repeated.\n \n\n\n\n\n\n    class GraphNet(nn.Module):\n    def __init__(self, dim):\n        super(GraphNet, self).__init__()\n\n        self.conv1 = ConvBlock(track_size= 2, dim=dim)\n        self.conv2 = ConvBlock(track_size= 4, dim=dim)\n        self.conv3 = ConvBlock(track_size= 8, dim=dim)\n        self.conv4 = ConvBlock(track_size=16, dim=dim)\n\n    def forward(self, point, radius, track):\n        num_point= len(point)\n        affinity = torch.zeros((num_point,num_point)).float().cuda() \n        x        = point.permute(1,0)\n        \n        logit    = self.conv1(x, radius, track)\n        affinity = logit_to_affinity(logit, track, affinity)\n\n        track    = affinity_to_track(affinity)\n        logit    = self.conv2(x, radius, track)\n        affinity = logit_to_affinity(logit, track, affinity)\n\n        track    = affinity_to_track(affinity)\n        logit    = self.conv3(x, radius, track)\n        affinity = logit_to_affinity(logit, track, affinity)\n        \n        ...\n\n        return affinity",
      "votes": null
    },
    {
      "id": "344262",
      "postDate": "06/17/2018 12:58:56",
      "content": "<p>this is how learning of affinity matrix will look like.</p>\n\n<p>left: ground truth.</p>\n\n<p>right : results on a  training sample (a cone slice) over training iterations.</p>\n\n<p>for one training sample, input is about  100K pairs (consider only pair where radius(hit1)&gt;radius(hit2)). For one scale, if threshold at recall = 100%, precision is about 1%, giving false positive of about 6k pairs. This effectively reduce the search space to 6/100 of input for linking the pair to triplet, etc ....</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/344262/9629/animated.gif\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "this is how learning of affinity matrix will look like.\n\nleft: ground truth.\n\nright : results on a  training sample (a cone slice) over training iterations.\n\nfor one training sample, input is about  100K pairs (consider only pair where radius(hit1)&gt;radius(hit2)). For one scale, if threshold at recall = 100%, precision is about 1%, giving false positive of about 6k pairs. This effectively reduce the search space to 6/100 of input for linking the pair to triplet, etc ....\n\n  ![enter image description here][1]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/344262/9629/animated.gif",
      "votes": null
    },
    {
      "id": "344322",
      "postDate": "06/17/2018 16:26:12",
      "content": "<p>@Nicole Finnie</p>\n\n<p>Do it the combinatorial kalman filter way. you can call it combinatorial-LSTM. With reference to my track extension code:</p>\n\n<ol>\n<li><p>given a track</p></li>\n<li><p>use kdtree to find \"nearest\" neighbours</p></li>\n<li><p>consider only neighbours that are in the same direction of the given track</p></li>\n<li><p>feed the valid neighbours to LSTM</p></li>\n</ol>",
      "rawMarkdown": "Nicole Finnie\n\nDo it the combinatorial kalman filter way. you can call it combinatorial-LSTM. With reference to my track extension code:\n\n1. given a track\n\n2. use kdtree to find \"nearest\" neighbours\n\n3. consider only neighbours that are in the same direction of the given track\n\n4. feed the valid neighbours to LSTM",
      "votes": null
    },
    {
      "id": "344328",
      "postDate": "06/17/2018 16:51:17",
      "content": "<p>you can also read this: sketch-rnn. They are using LSTM to predict the path in hand-writing</p>\n\n<p><a href=\"https://distill.pub/2016/handwriting/\">https://distill.pub/2016/handwriting/</a></p>\n\n<p><a href=\"http://blog.otoro.net/2015/12/12/handwriting-generation-demo-in-tensorflow/\">http://blog.otoro.net/2015/12/12/handwriting-generation-demo-in-tensorflow/</a></p>\n\n<p><img src=\"https://distill.pub/2016/handwriting/assets/strokes/jpg/2-65-8.jpg\" alt=\"enter image description here\"></p>\n\n<p>\"A Neural Representation of Sketch Drawings\"\n<a href=\"https://arxiv.org/pdf/1704.03477.pdf\">https://arxiv.org/pdf/1704.03477.pdf</a></p>",
      "rawMarkdown": "you can also read this: sketch-rnn. They are using LSTM to predict the path in hand-writing\n\n\n\nhttps://distill.pub/2016/handwriting/\n\nhttp://blog.otoro.net/2015/12/12/handwriting-generation-demo-in-tensorflow/\n\n  ![enter image description here][1]\n\n\n\"A Neural Representation of Sketch Drawings\"\nhttps://arxiv.org/pdf/1704.03477.pdf\n\n\n  [1]: https://distill.pub/2016/handwriting/assets/strokes/jpg/2-65-8.jpg",
      "votes": null
    },
    {
      "id": "344339",
      "postDate": "06/17/2018 17:39:04",
      "content": "<p>@Heng, Thanks for sharing. Is there a reason to find the nearest neighbours to feed the LSTM for training when you have the ground truth? My original idea was a bit different, feeding the LSTM with the ground truth, says, the first 5 hits and it should learn to predict the next one,  but there are a lot more issues to deal with than I thought. </p>\n\n<ol>\n<li>Some hits are across <code>pi</code> / <code>-pi</code>  if I train it with cylindrical coordinates. For prediction I may miss those hits if the LSTM can only predict (mapped) continuity. </li>\n<li>Some hits (very common) are at almost the same coordinates, so with either LSTM/CNN or dbscan, we have to face the same track fitting problem when it comes to those ambiguous hits. And that makes me wonder if training a DL model is the way to go since it may not outperform a traditional clustering approach. </li>\n</ol>\n\n<p>However, I think it's an area CERN would like us to explore, so I'm hoping people will move on to a DL supervised learning approach, including myself. I'm still struggling with the clustering. </p>",
      "rawMarkdown": "Heng, Thanks for sharing. Is there a reason to find the nearest neighbours to feed the LSTM for training when you have the ground truth? My original idea was a bit different, feeding the LSTM with the ground truth, says, the first 5 hits and it should learn to predict the next one,  but there are a lot more issues to deal with than I thought. \n\n 1. Some hits are across `pi` / `-pi`  if I train it with cylindrical coordinates. For prediction I may miss those hits if the LSTM can only predict (mapped) continuity. \n 2. Some hits (very common) are at almost the same coordinates, so with either LSTM/CNN or dbscan, we have to face the same track fitting problem when it comes to those ambiguous hits. And that makes me wonder if training a DL model is the way to go since it may not outperform a traditional clustering approach. \n\nHowever, I think it's an area CERN would like us to explore, so I'm hoping people will move on to a DL supervised learning approach, including myself. I'm still struggling with the clustering.",
      "votes": null
    },
    {
      "id": "344396",
      "postDate": "06/17/2018 21:31:19",
      "content": "<p>there are 2 ways. At inference:</p>\n\n<ol>\n<li><p>input 5 hits --&gt; LSTM --&gt; predict the 6th location (and uncertainty, etc)</p></li>\n<li><p>input 5 hits + possible 6th candidates (e.g. from kNN) --&gt;LSTM --&gt;predict if each of the candidates are valid or not</p></li>\n</ol>",
      "rawMarkdown": "there are 2 ways. At inference:\n\n1. input 5 hits --&gt; LSTM --&gt; predict the 6th location (and uncertainty, etc)\n\n2. input 5 hits + possible 6th candidates (e.g. from kNN) --&gt;LSTM --&gt;predict if each of the candidates are valid or not",
      "votes": null
    },
    {
      "id": "344397",
      "postDate": "06/17/2018 21:33:16",
      "content": "<p>\"Some hits are across pi / -pi if I train it with cylindrical coordinates\" ... </p>\n\n<p>for direction, either:</p>\n\n<ol>\n<li><p>predict the change, e.g. \"delta angle\"</p></li>\n<li><p>predict unit vector (cos and sin), rather than the angle itself</p></li>\n</ol>",
      "rawMarkdown": "\"Some hits are across pi / -pi if I train it with cylindrical coordinates\" ... \n\nfor direction, either:\n\n1. predict the change, e.g. \"delta angle\"\n\n2. predict unit vector (cos and sin), rather than the angle itself",
      "votes": null
    },
    {
      "id": "346849",
      "postDate": "06/22/2018 15:06:55",
      "content": "<p>you can modify the idea from the paper. Learn a set of \"probing direction vectors\" to detect lines?</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/346849/9661/FNPP.png\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "you can modify the idea from the paper. Learn a set of \"probing direction vectors\" to detect lines?\n\n  ![enter image description here][1]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/346849/9661/FNPP.png",
      "votes": null
    },
    {
      "id": "346851",
      "postDate": "06/22/2018 15:09:04",
      "content": "<p>Another possibility</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/346851/9662/direct1.png\" alt=\"enter image description here\"></p>\n\n<p>ideally, this is what the network should be encapsulating. You can force the network to do this by enforcing supervisory signal (and corresponding loss) at each of the sub-blocks:</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/346851/9663/direct2.png\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "Another possibility\n\n\n  ![enter image description here][1]\n\nideally, this is what the network should be encapsulating. You can force the network to do this by enforcing supervisory signal (and corresponding loss) at each of the sub-blocks:\n\n  ![enter image description here][2]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/346851/9662/direct1.png\n  [2]: https://storage.googleapis.com/kaggle-forum-message-attachments/346851/9663/direct2.png",
      "votes": null
    },
    {
      "id": "347565",
      "postDate": "06/24/2018 17:46:21",
      "content": "<p>turns out that things are \"easier\" than expected:</p>\n\n<ol>\n<li><p>transform to a,r,z coordinates.</p></li>\n<li><p>predict tracks on \"selected layers of points\" (rather than cone slices)</p></li>\n<li><p>if the layers are few, tracks are quite straight. There will always be some projection to map stright 3d line onto single 2d point. </p></li>\n<li><p>you can do a knn on the 2d projection and do a line fit on the clusters found.</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9685/Slide5.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9683/Slide4.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9684/Slide3.png\" alt=\"enter image description here\"></p></li>\n</ol>",
      "rawMarkdown": "turns out that things are \"easier\" than expected:\n\n1. transform to a,r,z coordinates.\n\n2. predict tracks on \"selected layers of points\" (rather than cone slices)\n\n3. if the layers are few, tracks are quite straight. There will always be some projection to map stright 3d line onto single 2d point. \n\n4. you can do a knn on the 2d projection and do a line fit on the clusters found.\n\n\n\n   ![enter image description here][1]\n\n  ![enter image description here][2]\n\n  ![enter image description here][3]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9685/Slide5.png\n  [2]: https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9683/Slide4.png\n  [3]: https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9684/Slide3.png",
      "votes": null
    },
    {
      "id": "347568",
      "postDate": "06/24/2018 18:05:19",
      "content": "<p>For 1, you'd still hit the pi discontinuity problem using <code>a = arctan(y/x)</code>, and these are your suggestions a few days ago:</p>\n\n<pre><code>predict the change, e.g. \"delta angle\"\n\npredict unit vector (cos and sin), rather than the angle itself\n</code></pre>\n\n<p>Did you still throw <code>a</code> to your model directly?</p>",
      "rawMarkdown": "For 1, you'd still hit the pi discontinuity problem using `a = arctan(y/x)`, and these are your suggestions a few days ago:\n\n    predict the change, e.g. \"delta angle\"\n    \n    predict unit vector (cos and sin), rather than the angle itself\n\nDid you still throw `a` to your model directly?",
      "votes": null
    },
    {
      "id": "347715",
      "postDate": "06/25/2018 06:28:29",
      "content": "<p>as shown below:</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/347715/9686/update.png\" alt=\"enter image description here\"></p>",
      "rawMarkdown": "as shown below:\n\n  ![enter image description here][1]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/347715/9686/update.png",
      "votes": null
    },
    {
      "id": "347906",
      "postDate": "06/25/2018 16:47:39",
      "content": "<p>@Heng Would you please explain the following:</p>\n\n<p>1- The purpose of KNN clustering in the first figure.\n2- What do you mean by track fitting and how do you do it?</p>\n\n<p>Thanks</p>",
      "rawMarkdown": "Heng Would you please explain the following:\n\n1- The purpose of KNN clustering in the first figure.\n2- What do you mean by track fitting and how do you do it?\n\nThanks",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 341258,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "06/11/2018 10:10:22",
      "content": "<p>pytorch kdtree and sampling can be found at:</p>\n\n<p><a href=\"https://github.com/erikwijmans/Pointnet2_PyTorch\">https://github.com/erikwijmans/Pointnet2_PyTorch</a></p>\n\n<p>\"PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space\" -Charles R. Qi Li Yi Hao Su Leonidas J. Guibas, NIPS 2017</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 342966,
      "author_name": "rdebbe",
      "author_url": "",
      "post_date": "06/14/2018 13:03:18",
      "content": "<p>Hi Heng,\nI have been working with PointNet (a keras version) and have some indication that the model is capable of recognizing the track pattern out of several thousand points. (see the discussion item: (<a href=\"https://www.kaggle.com/c/trackml-particle-identification/discussion/58782\">https://www.kaggle.com/c/trackml-particle-identification/discussion/58782</a>).\nI had to split the input into transverse momentum bins in order not to make too big a change in the model. As I'm just a user of models with little insight on their actual inner works, I have only made changes at the very last FC layers to be able to identify at most 256 tracks in one event. </p>\n\n<p>I would rather have the model processing all tracks together because I'm not sure how to do the learning piece-wise. I can always change the number of filters in the 1D convolutions and see if the model learns something or even fits in the 10GB\nof a GPU, but I should consult with experts as well.</p>\n\n<p>I sent and email to the PointNet authors at Stanford yesterday and I'm still hoping for a reply. \nThe model increases the 1D conv. number of filters to 1024 at the 5th convolution and then drops to 256 (my change). I understand that with more filters the model can identify more features. Using the Hough transform the only feature of relevance appears to me as \"points aligned along a line\". </p>\n\n<p>If I expect some 3K tracks in the events, should I change the number of filters at the fifth convolution to something like 4096 ?</p>\n\n<p>It would be great I you could give me some hints. Thanks</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 343861,
      "author_name": "nicolefinnie",
      "author_url": "",
      "post_date": "06/16/2018 11:26:22",
      "content": "<p>I'm thinking of training multiple very simple LTSMs to do different tasks. For example, one is only to predict the next hit using the first 3-5 predicted hits that belong to the same track. The problem is granularity of the output class. If the output class (one-hot encoding) presents all possible coordinates either in the polar system or Cartesian system, the size is going to blow up, says, <code>x*y*z</code>, so we may need to grid the 3D-output box to predict the possible \"cube\" of the next hit, but the prediction error would be pretty high, but on the other hand it allows more grey area too. In this sense it almost looks like a CNN problem to me again, I tend to avoid CNN in this competition. This thought has lots of flaws, but I'm hoping for more discussions in deep learning architecture. </p>",
      "votes": null,
      "replies": [
        {
          "id": 344322,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "06/17/2018 16:26:12",
          "content": "<p>@Nicole Finnie</p>\n\n<p>Do it the combinatorial kalman filter way. you can call it combinatorial-LSTM. With reference to my track extension code:</p>\n\n<ol>\n<li><p>given a track</p></li>\n<li><p>use kdtree to find \"nearest\" neighbours</p></li>\n<li><p>consider only neighbours that are in the same direction of the given track</p></li>\n<li><p>feed the valid neighbours to LSTM</p></li>\n</ol>",
          "votes": null,
          "replies": []
        },
        {
          "id": 344328,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "06/17/2018 16:51:17",
          "content": "<p>you can also read this: sketch-rnn. They are using LSTM to predict the path in hand-writing</p>\n\n<p><a href=\"https://distill.pub/2016/handwriting/\">https://distill.pub/2016/handwriting/</a></p>\n\n<p><a href=\"http://blog.otoro.net/2015/12/12/handwriting-generation-demo-in-tensorflow/\">http://blog.otoro.net/2015/12/12/handwriting-generation-demo-in-tensorflow/</a></p>\n\n<p><img src=\"https://distill.pub/2016/handwriting/assets/strokes/jpg/2-65-8.jpg\" alt=\"enter image description here\"></p>\n\n<p>\"A Neural Representation of Sketch Drawings\"\n<a href=\"https://arxiv.org/pdf/1704.03477.pdf\">https://arxiv.org/pdf/1704.03477.pdf</a></p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 344339,
          "author_name": "nicolefinnie",
          "author_url": "",
          "post_date": "06/17/2018 17:39:04",
          "content": "<p>@Heng, Thanks for sharing. Is there a reason to find the nearest neighbours to feed the LSTM for training when you have the ground truth? My original idea was a bit different, feeding the LSTM with the ground truth, says, the first 5 hits and it should learn to predict the next one,  but there are a lot more issues to deal with than I thought. </p>\n\n<ol>\n<li>Some hits are across <code>pi</code> / <code>-pi</code>  if I train it with cylindrical coordinates. For prediction I may miss those hits if the LSTM can only predict (mapped) continuity. </li>\n<li>Some hits (very common) are at almost the same coordinates, so with either LSTM/CNN or dbscan, we have to face the same track fitting problem when it comes to those ambiguous hits. And that makes me wonder if training a DL model is the way to go since it may not outperform a traditional clustering approach. </li>\n</ol>\n\n<p>However, I think it's an area CERN would like us to explore, so I'm hoping people will move on to a DL supervised learning approach, including myself. I'm still struggling with the clustering. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 344396,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "06/17/2018 21:31:19",
          "content": "<p>there are 2 ways. At inference:</p>\n\n<ol>\n<li><p>input 5 hits --&gt; LSTM --&gt; predict the 6th location (and uncertainty, etc)</p></li>\n<li><p>input 5 hits + possible 6th candidates (e.g. from kNN) --&gt;LSTM --&gt;predict if each of the candidates are valid or not</p></li>\n</ol>",
          "votes": null,
          "replies": []
        },
        {
          "id": 344397,
          "author_name": "hengck23",
          "author_url": "",
          "post_date": "06/17/2018 21:33:16",
          "content": "<p>\"Some hits are across pi / -pi if I train it with cylindrical coordinates\" ... </p>\n\n<p>for direction, either:</p>\n\n<ol>\n<li><p>predict the change, e.g. \"delta angle\"</p></li>\n<li><p>predict unit vector (cos and sin), rather than the angle itself</p></li>\n</ol>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 343927,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "06/16/2018 14:40:05",
      "content": "<p>@Nicole Finnie</p>\n\n<p>i am trying to write the code below. The idea is simple:</p>\n\n<ol>\n<li><p>given an affinity matrix (pairwise similarity), generate track candidates. e.g. choosing the strong links sequentially, or spectral clustering (but i have to implement some automatic way to determine the no. of clusters)</p></li>\n<li><p>for a given current track candidate, classify each point of the track as valid or invalid and also the probability of the link. This is used to update the affinity matrix.</p></li>\n</ol>\n\n<p>The process is repeated.</p>\n\n<pre><code>class GraphNet(nn.Module):\ndef __init__(self, dim):\n    super(GraphNet, self).__init__()\n\n    self.conv1 = ConvBlock(track_size= 2, dim=dim)\n    self.conv2 = ConvBlock(track_size= 4, dim=dim)\n    self.conv3 = ConvBlock(track_size= 8, dim=dim)\n    self.conv4 = ConvBlock(track_size=16, dim=dim)\n\ndef forward(self, point, radius, track):\n    num_point= len(point)\n    affinity = torch.zeros((num_point,num_point)).float().cuda() \n    x        = point.permute(1,0)\n\n    logit    = self.conv1(x, radius, track)\n    affinity = logit_to_affinity(logit, track, affinity)\n\n    track    = affinity_to_track(affinity)\n    logit    = self.conv2(x, radius, track)\n    affinity = logit_to_affinity(logit, track, affinity)\n\n    track    = affinity_to_track(affinity)\n    logit    = self.conv3(x, radius, track)\n    affinity = logit_to_affinity(logit, track, affinity)\n\n    ...\n\n    return affinity\n</code></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 344262,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "06/17/2018 12:58:56",
      "content": "<p>this is how learning of affinity matrix will look like.</p>\n\n<p>left: ground truth.</p>\n\n<p>right : results on a  training sample (a cone slice) over training iterations.</p>\n\n<p>for one training sample, input is about  100K pairs (consider only pair where radius(hit1)&gt;radius(hit2)). For one scale, if threshold at recall = 100%, precision is about 1%, giving false positive of about 6k pairs. This effectively reduce the search space to 6/100 of input for linking the pair to triplet, etc ....</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/344262/9629/animated.gif\" alt=\"enter image description here\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 346849,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "06/22/2018 15:06:55",
      "content": "<p>you can modify the idea from the paper. Learn a set of \"probing direction vectors\" to detect lines?</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/346849/9661/FNPP.png\" alt=\"enter image description here\"></p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 346851,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "06/22/2018 15:09:04",
      "content": "<p>Another possibility</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/346851/9662/direct1.png\" alt=\"enter image description here\"></p>\n\n<p>ideally, this is what the network should be encapsulating. You can force the network to do this by enforcing supervisory signal (and corresponding loss) at each of the sub-blocks:</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/346851/9663/direct2.png\" alt=\"enter image description here\"></p>",
      "votes": null,
      "replies": [
        {
          "id": 347906,
          "author_name": "bhartha",
          "author_url": "",
          "post_date": "06/25/2018 16:47:39",
          "content": "<p>@Heng Would you please explain the following:</p>\n\n<p>1- The purpose of KNN clustering in the first figure.\n2- What do you mean by track fitting and how do you do it?</p>\n\n<p>Thanks</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 347565,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "06/24/2018 17:46:21",
      "content": "<p>turns out that things are \"easier\" than expected:</p>\n\n<ol>\n<li><p>transform to a,r,z coordinates.</p></li>\n<li><p>predict tracks on \"selected layers of points\" (rather than cone slices)</p></li>\n<li><p>if the layers are few, tracks are quite straight. There will always be some projection to map stright 3d line onto single 2d point. </p></li>\n<li><p>you can do a knn on the 2d projection and do a line fit on the clusters found.</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9685/Slide5.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9683/Slide4.png\" alt=\"enter image description here\"></p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9684/Slide3.png\" alt=\"enter image description here\"></p></li>\n</ol>",
      "votes": null,
      "replies": [
        {
          "id": 347568,
          "author_name": "nicolefinnie",
          "author_url": "",
          "post_date": "06/24/2018 18:05:19",
          "content": "<p>For 1, you'd still hit the pi discontinuity problem using <code>a = arctan(y/x)</code>, and these are your suggestions a few days ago:</p>\n\n<pre><code>predict the change, e.g. \"delta angle\"\n\npredict unit vector (cos and sin), rather than the angle itself\n</code></pre>\n\n<p>Did you still throw <code>a</code> to your model directly?</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 347715,
      "author_name": "hengck23",
      "author_url": "",
      "post_date": "06/25/2018 06:28:29",
      "content": "<p>as shown below:</p>\n\n<p><img src=\"https://storage.googleapis.com/kaggle-forum-message-attachments/347715/9686/update.png\" alt=\"enter image description here\"></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "341256": "i haven't tried the below. but here is one possibility here:\n\n  ![enter image description here][1]\n\n  ![enter image description here][2]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/341256/9590/Slide4.PNG\n  [2]: https://storage.googleapis.com/kaggle-forum-message-attachments/341256/9591/Slide5.PNG",
    "341258": "pytorch kdtree and sampling can be found at:\n\nhttps://github.com/erikwijmans/Pointnet2_PyTorch\n\n\"PointNet++: Deep Hierarchical Feature Learning on Point Sets in a Metric Space\" -Charles R. Qi Li Yi Hao Su Leonidas J. Guibas, NIPS 2017",
    "342966": "Hi Heng,\nI have been working with PointNet (a keras version) and have some indication that the model is capable of recognizing the track pattern out of several thousand points. (see the discussion item: (https://www.kaggle.com/c/trackml-particle-identification/discussion/58782).\nI had to split the input into transverse momentum bins in order not to make too big a change in the model. As I'm just a user of models with little insight on their actual inner works, I have only made changes at the very last FC layers to be able to identify at most 256 tracks in one event. \n\nI would rather have the model processing all tracks together because I'm not sure how to do the learning piece-wise. I can always change the number of filters in the 1D convolutions and see if the model learns something or even fits in the 10GB\nof a GPU, but I should consult with experts as well.\n\nI sent and email to the PointNet authors at Stanford yesterday and I'm still hoping for a reply. \nThe model increases the 1D conv. number of filters to 1024 at the 5th convolution and then drops to 256 (my change). I understand that with more filters the model can identify more features. Using the Hough transform the only feature of relevance appears to me as \"points aligned along a line\". \n\nIf I expect some 3K tracks in the events, should I change the number of filters at the fifth convolution to something like 4096 ?\n\nIt would be great I you could give me some hints. Thanks",
    "343861": "I'm thinking of training multiple very simple LTSMs to do different tasks. For example, one is only to predict the next hit using the first 3-5 predicted hits that belong to the same track. The problem is granularity of the output class. If the output class (one-hot encoding) presents all possible coordinates either in the polar system or Cartesian system, the size is going to blow up, says, `x*y*z`, so we may need to grid the 3D-output box to predict the possible \"cube\" of the next hit, but the prediction error would be pretty high, but on the other hand it allows more grey area too. In this sense it almost looks like a CNN problem to me again, I tend to avoid CNN in this competition. This thought has lots of flaws, but I'm hoping for more discussions in deep learning architecture.",
    "343927": "Nicole Finnie\n\ni am trying to write the code below. The idea is simple:\n\n1. given an affinity matrix (pairwise similarity), generate track candidates. e.g. choosing the strong links sequentially, or spectral clustering (but i have to implement some automatic way to determine the no. of clusters)\n\n2. for a given current track candidate, classify each point of the track as valid or invalid and also the probability of the link. This is used to update the affinity matrix.\n\nThe process is repeated.\n \n\n\n\n\n\n    class GraphNet(nn.Module):\n    def __init__(self, dim):\n        super(GraphNet, self).__init__()\n\n        self.conv1 = ConvBlock(track_size= 2, dim=dim)\n        self.conv2 = ConvBlock(track_size= 4, dim=dim)\n        self.conv3 = ConvBlock(track_size= 8, dim=dim)\n        self.conv4 = ConvBlock(track_size=16, dim=dim)\n\n    def forward(self, point, radius, track):\n        num_point= len(point)\n        affinity = torch.zeros((num_point,num_point)).float().cuda() \n        x        = point.permute(1,0)\n        \n        logit    = self.conv1(x, radius, track)\n        affinity = logit_to_affinity(logit, track, affinity)\n\n        track    = affinity_to_track(affinity)\n        logit    = self.conv2(x, radius, track)\n        affinity = logit_to_affinity(logit, track, affinity)\n\n        track    = affinity_to_track(affinity)\n        logit    = self.conv3(x, radius, track)\n        affinity = logit_to_affinity(logit, track, affinity)\n        \n        ...\n\n        return affinity",
    "344262": "this is how learning of affinity matrix will look like.\n\nleft: ground truth.\n\nright : results on a  training sample (a cone slice) over training iterations.\n\nfor one training sample, input is about  100K pairs (consider only pair where radius(hit1)&gt;radius(hit2)). For one scale, if threshold at recall = 100%, precision is about 1%, giving false positive of about 6k pairs. This effectively reduce the search space to 6/100 of input for linking the pair to triplet, etc ....\n\n  ![enter image description here][1]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/344262/9629/animated.gif",
    "344322": "Nicole Finnie\n\nDo it the combinatorial kalman filter way. you can call it combinatorial-LSTM. With reference to my track extension code:\n\n1. given a track\n\n2. use kdtree to find \"nearest\" neighbours\n\n3. consider only neighbours that are in the same direction of the given track\n\n4. feed the valid neighbours to LSTM",
    "344328": "you can also read this: sketch-rnn. They are using LSTM to predict the path in hand-writing\n\n\n\nhttps://distill.pub/2016/handwriting/\n\nhttp://blog.otoro.net/2015/12/12/handwriting-generation-demo-in-tensorflow/\n\n  ![enter image description here][1]\n\n\n\"A Neural Representation of Sketch Drawings\"\nhttps://arxiv.org/pdf/1704.03477.pdf\n\n\n  [1]: https://distill.pub/2016/handwriting/assets/strokes/jpg/2-65-8.jpg",
    "344339": "Heng, Thanks for sharing. Is there a reason to find the nearest neighbours to feed the LSTM for training when you have the ground truth? My original idea was a bit different, feeding the LSTM with the ground truth, says, the first 5 hits and it should learn to predict the next one,  but there are a lot more issues to deal with than I thought. \n\n 1. Some hits are across `pi` / `-pi`  if I train it with cylindrical coordinates. For prediction I may miss those hits if the LSTM can only predict (mapped) continuity. \n 2. Some hits (very common) are at almost the same coordinates, so with either LSTM/CNN or dbscan, we have to face the same track fitting problem when it comes to those ambiguous hits. And that makes me wonder if training a DL model is the way to go since it may not outperform a traditional clustering approach. \n\nHowever, I think it's an area CERN would like us to explore, so I'm hoping people will move on to a DL supervised learning approach, including myself. I'm still struggling with the clustering.",
    "344396": "there are 2 ways. At inference:\n\n1. input 5 hits --&gt; LSTM --&gt; predict the 6th location (and uncertainty, etc)\n\n2. input 5 hits + possible 6th candidates (e.g. from kNN) --&gt;LSTM --&gt;predict if each of the candidates are valid or not",
    "344397": "\"Some hits are across pi / -pi if I train it with cylindrical coordinates\" ... \n\nfor direction, either:\n\n1. predict the change, e.g. \"delta angle\"\n\n2. predict unit vector (cos and sin), rather than the angle itself",
    "346849": "you can modify the idea from the paper. Learn a set of \"probing direction vectors\" to detect lines?\n\n  ![enter image description here][1]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/346849/9661/FNPP.png",
    "346851": "Another possibility\n\n\n  ![enter image description here][1]\n\nideally, this is what the network should be encapsulating. You can force the network to do this by enforcing supervisory signal (and corresponding loss) at each of the sub-blocks:\n\n  ![enter image description here][2]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/346851/9662/direct1.png\n  [2]: https://storage.googleapis.com/kaggle-forum-message-attachments/346851/9663/direct2.png",
    "347565": "turns out that things are \"easier\" than expected:\n\n1. transform to a,r,z coordinates.\n\n2. predict tracks on \"selected layers of points\" (rather than cone slices)\n\n3. if the layers are few, tracks are quite straight. There will always be some projection to map stright 3d line onto single 2d point. \n\n4. you can do a knn on the 2d projection and do a line fit on the clusters found.\n\n\n\n   ![enter image description here][1]\n\n  ![enter image description here][2]\n\n  ![enter image description here][3]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9685/Slide5.png\n  [2]: https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9683/Slide4.png\n  [3]: https://storage.googleapis.com/kaggle-forum-message-attachments/347565/9684/Slide3.png",
    "347568": "For 1, you'd still hit the pi discontinuity problem using `a = arctan(y/x)`, and these are your suggestions a few days ago:\n\n    predict the change, e.g. \"delta angle\"\n    \n    predict unit vector (cos and sin), rather than the angle itself\n\nDid you still throw `a` to your model directly?",
    "347715": "as shown below:\n\n  ![enter image description here][1]\n\n\n  [1]: https://storage.googleapis.com/kaggle-forum-message-attachments/347715/9686/update.png",
    "347906": "Heng Would you please explain the following:\n\n1- The purpose of KNN clustering in the first figure.\n2- What do you mean by track fitting and how do you do it?\n\nThanks"
  },
  "source": "meta"
}