{
  "id": 275349,
  "title": "7th place solution",
  "url": "/competitions/g2net-gravitational-wave-detection/writeups/yan-zhang-7th-place-solution",
  "author_name": "",
  "post_date": "2021-09-30T03:13:48.893877500Z",
  "votes": 29,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Preprocess:<br>\n30Hz highpass filtering<br>\nNormalized by the absolute means of individual observations</p>\n<p>Augmentation:<br>\nRoll +/-500 points (p=0.5)<br>\nScale 0.85-1.15 (p=0.5)<br>\nMultiply -1 (p=0.5)</p>\n<h1>All implemented using TF trained on TPU</h1>\n<h1>The bellow frontend is used by all models. dim=128</h1>\n<p>input = L.Input(shape=(3, 4096)) # 3 observations<br>\nx = tf.reshape(input,(-1,4096,1)) # 3 observations folded into batch<br>\nx = wavenet(x, dim, dilations=12, kernel_size=5)<br>\nx = L.Dense(dim//4)(x)<br>\nx = wavenet(x, dim, dilations=12, kernel_size=5)<br>\nx = L.Dense(dim//4)(x)<br>\nx = L.Dense(dim)(x)<br>\nx = tf.reshape(x, (-1,3,4096,dim))<br>\nx = tf.transpose(x,(0,2,3,1))<br>\nx = L.BatchNormalization()(x)<br>\nx = L.Activation('gelu')(x)</p>\n<p>Model1:<br>\nEfficient B3 (size=128*128), CV 87.79-88.04<br>\nModel2:<br>\nWavenet + GRU, CV 87.80-88.05<br>\nModel3:<br>\nWavenet, CV 87.83-88.07</p>",
  "messages": [
    {
      "id": "1528914",
      "postDate": "09/30/2021 03:13:48",
      "content": "<p>Preprocess:<br>\n30Hz highpass filtering<br>\nNormalized by the absolute means of individual observations</p>\n<p>Augmentation:<br>\nRoll +/-500 points (p=0.5)<br>\nScale 0.85-1.15 (p=0.5)<br>\nMultiply -1 (p=0.5)</p>\n<h1>All implemented using TF trained on TPU</h1>\n<h1>The bellow frontend is used by all models. dim=128</h1>\n<p>input = L.Input(shape=(3, 4096)) # 3 observations<br>\nx = tf.reshape(input,(-1,4096,1)) # 3 observations folded into batch<br>\nx = wavenet(x, dim, dilations=12, kernel_size=5)<br>\nx = L.Dense(dim//4)(x)<br>\nx = wavenet(x, dim, dilations=12, kernel_size=5)<br>\nx = L.Dense(dim//4)(x)<br>\nx = L.Dense(dim)(x)<br>\nx = tf.reshape(x, (-1,3,4096,dim))<br>\nx = tf.transpose(x,(0,2,3,1))<br>\nx = L.BatchNormalization()(x)<br>\nx = L.Activation('gelu')(x)</p>\n<p>Model1:<br>\nEfficient B3 (size=128*128), CV 87.79-88.04<br>\nModel2:<br>\nWavenet + GRU, CV 87.80-88.05<br>\nModel3:<br>\nWavenet, CV 87.83-88.07</p>",
      "rawMarkdown": "Preprocess:\n30Hz highpass filtering\nNormalized by the absolute means of individual observations\n \nAugmentation:\nRoll +/-500 points (p=0.5)\nScale 0.85-1.15 (p=0.5)\nMultiply -1 (p=0.5)\n \n# All implemented using TF trained on TPU \n#The bellow frontend is used by all models. dim=128\n\ninput = L.Input(shape=(3, 4096)) # 3 observations\nx = tf.reshape(input,(-1,4096,1)) # 3 observations folded into batch\nx = wavenet(x, dim, dilations=12, kernel_size=5)\nx = L.Dense(dim//4)(x)\nx = wavenet(x, dim, dilations=12, kernel_size=5)\nx = L.Dense(dim//4)(x)\nx = L.Dense(dim)(x)\nx = tf.reshape(x, (-1,3,4096,dim))\nx = tf.transpose(x,(0,2,3,1))\nx = L.BatchNormalization()(x)\nx = L.Activation('gelu')(x)\n        \nModel1:\nEfficient B3 (size=128*128), CV 87.79-88.04\nModel2:\nWavenet + GRU, CV 87.80-88.05\nModel3:\nWavenet, CV 87.83-88.07",
      "votes": null
    },
    {
      "id": "1530146",
      "postDate": "10/01/2021 01:11:22",
      "content": "<p>Could you share \"wavenet\" block you used as well</p>",
      "rawMarkdown": "Could you share \"wavenet\" block you used as well",
      "votes": null
    },
    {
      "id": "1530147",
      "postDate": "10/01/2021 01:15:00",
      "content": "<p>here it is.</p>\n<p>def wavenet(x, dim, n, kernel_size=3):<br>\n            dilation_rates = [2**i for i in range(n)]<br>\n            x = L.Conv1D(filters = dim, <br>\n                                   kernel_size = 1,<br>\n                                   padding = 'same')(x)<br>\n            res_x = x</p>\n<pre><code>        for dilation_rate in dilation_rates:\n            tanh_out = L.Conv1D(filters = dim,\n                          kernel_size = kernel_size,\n                          padding = 'same', \n                          activation = 'tanh', \n                          dilation_rate = dilation_rate)(x)\n\n            sigm_out = L.Conv1D(filters = dim,\n                          kernel_size = kernel_size,\n                          padding = 'same',\n                          activation = 'sigmoid', \n                          dilation_rate = dilation_rate)(x)\n\n            x = tanh_out*sigm_out             \n            x = L.Conv1D(filters = dim,kernel_size = 1,padding = 'same')(x)\n            res_x = res_x + x\n\n        return res_x\n</code></pre>",
      "rawMarkdown": "here it is.\n\ndef wavenet(x, dim, n, kernel_size=3):\n            dilation_rates = [2**i for i in range(n)]\n            x = L.Conv1D(filters = dim, \n                                   kernel_size = 1,\n                                   padding = 'same')(x)\n            res_x = x\n\n            for dilation_rate in dilation_rates:\n                tanh_out = L.Conv1D(filters = dim,\n                              kernel_size = kernel_size,\n                              padding = 'same', \n                              activation = 'tanh', \n                              dilation_rate = dilation_rate)(x)\n\n                sigm_out = L.Conv1D(filters = dim,\n                              kernel_size = kernel_size,\n                              padding = 'same',\n                              activation = 'sigmoid', \n                              dilation_rate = dilation_rate)(x)\n\n                x = tanh_out*sigm_out             \n                x = L.Conv1D(filters = dim,kernel_size = 1,padding = 'same')(x)\n                res_x = res_x + x\n\n            return res_x",
      "votes": null
    },
    {
      "id": "1559892",
      "postDate": "10/27/2021 08:06:35",
      "content": "<p>Hey All,</p>\n<p>Thank you all for taking part in our competition. The participation has been overwhelmingly positive. We are currently conducting a survey to gauge the demographic and outreach achieved. Kindly spare 2min and fill in this survey <a href=\"https://forms.gle/QP9L16niPexozyhu5\" target=\"_blank\">https://forms.gle/QP9L16niPexozyhu5</a>.</p>\n<p>Thank you all,</p>\n<p>Regards,<br>\nChris</p>",
      "rawMarkdown": "Hey All,\n\nThank you all for taking part in our competition. The participation has been overwhelmingly positive. We are currently conducting a survey to gauge the demographic and outreach achieved. Kindly spare 2min and fill in this survey https://forms.gle/QP9L16niPexozyhu5.\n\nThank you all,\n\nRegards,\nChris",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1530146,
      "author_name": "vaghefi",
      "author_url": "",
      "post_date": "10/01/2021 01:11:22",
      "content": "<p>Could you share \"wavenet\" block you used as well</p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1530147,
      "author_name": "annealer",
      "author_url": "",
      "post_date": "10/01/2021 01:15:00",
      "content": "<p>here it is.</p>\n<p>def wavenet(x, dim, n, kernel_size=3):<br>\n            dilation_rates = [2**i for i in range(n)]<br>\n            x = L.Conv1D(filters = dim, <br>\n                                   kernel_size = 1,<br>\n                                   padding = 'same')(x)<br>\n            res_x = x</p>\n<pre><code>        for dilation_rate in dilation_rates:\n            tanh_out = L.Conv1D(filters = dim,\n                          kernel_size = kernel_size,\n                          padding = 'same', \n                          activation = 'tanh', \n                          dilation_rate = dilation_rate)(x)\n\n            sigm_out = L.Conv1D(filters = dim,\n                          kernel_size = kernel_size,\n                          padding = 'same',\n                          activation = 'sigmoid', \n                          dilation_rate = dilation_rate)(x)\n\n            x = tanh_out*sigm_out             \n            x = L.Conv1D(filters = dim,kernel_size = 1,padding = 'same')(x)\n            res_x = res_x + x\n\n        return res_x\n</code></pre>",
      "votes": null,
      "replies": []
    },
    {
      "id": 1559892,
      "author_name": "zerafachris",
      "author_url": "",
      "post_date": "10/27/2021 08:06:35",
      "content": "<p>Hey All,</p>\n<p>Thank you all for taking part in our competition. The participation has been overwhelmingly positive. We are currently conducting a survey to gauge the demographic and outreach achieved. Kindly spare 2min and fill in this survey <a href=\"https://forms.gle/QP9L16niPexozyhu5\" target=\"_blank\">https://forms.gle/QP9L16niPexozyhu5</a>.</p>\n<p>Thank you all,</p>\n<p>Regards,<br>\nChris</p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1528914": "Preprocess:\n30Hz highpass filtering\nNormalized by the absolute means of individual observations\n \nAugmentation:\nRoll +/-500 points (p=0.5)\nScale 0.85-1.15 (p=0.5)\nMultiply -1 (p=0.5)\n \n# All implemented using TF trained on TPU \n#The bellow frontend is used by all models. dim=128\n\ninput = L.Input(shape=(3, 4096)) # 3 observations\nx = tf.reshape(input,(-1,4096,1)) # 3 observations folded into batch\nx = wavenet(x, dim, dilations=12, kernel_size=5)\nx = L.Dense(dim//4)(x)\nx = wavenet(x, dim, dilations=12, kernel_size=5)\nx = L.Dense(dim//4)(x)\nx = L.Dense(dim)(x)\nx = tf.reshape(x, (-1,3,4096,dim))\nx = tf.transpose(x,(0,2,3,1))\nx = L.BatchNormalization()(x)\nx = L.Activation('gelu')(x)\n        \nModel1:\nEfficient B3 (size=128*128), CV 87.79-88.04\nModel2:\nWavenet + GRU, CV 87.80-88.05\nModel3:\nWavenet, CV 87.83-88.07",
    "1530146": "Could you share \"wavenet\" block you used as well",
    "1530147": "here it is.\n\ndef wavenet(x, dim, n, kernel_size=3):\n            dilation_rates = [2**i for i in range(n)]\n            x = L.Conv1D(filters = dim, \n                                   kernel_size = 1,\n                                   padding = 'same')(x)\n            res_x = x\n\n            for dilation_rate in dilation_rates:\n                tanh_out = L.Conv1D(filters = dim,\n                              kernel_size = kernel_size,\n                              padding = 'same', \n                              activation = 'tanh', \n                              dilation_rate = dilation_rate)(x)\n\n                sigm_out = L.Conv1D(filters = dim,\n                              kernel_size = kernel_size,\n                              padding = 'same',\n                              activation = 'sigmoid', \n                              dilation_rate = dilation_rate)(x)\n\n                x = tanh_out*sigm_out             \n                x = L.Conv1D(filters = dim,kernel_size = 1,padding = 'same')(x)\n                res_x = res_x + x\n\n            return res_x",
    "1559892": "Hey All,\n\nThank you all for taking part in our competition. The participation has been overwhelmingly positive. We are currently conducting a survey to gauge the demographic and outreach achieved. Kindly spare 2min and fill in this survey https://forms.gle/QP9L16niPexozyhu5.\n\nThank you all,\n\nRegards,\nChris"
  },
  "source": "meta"
}