Free AI web copilot to create summaries, insights and extended knowledge, download it at here
1912
Abstract
of capturing the information out of the data.</p><p id="4efe">In Eq. 1, we have a <i>distance metric </i>which can be any distance function (Cosine, Maximum Mean Discrepancy, Deep Correlation Alignment, etc). However, for this article, I am going to use <b>Deep Correlation Alignment </b>(<b><i>CORAL</i></b>) as our distribution distance function. Its formula can be seen in Eq. 2: ( For more information you can read the paper: <a href="https://arxiv.org/abs/1607.01719">Deep CORAL: Correlation Alignment for Deep Domain Adaptation</a>)</p><figure id="3fe0"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*v6uIc6AfksaMoz-YvkFZsw.png"><figcaption>Eq. 2</figcaption></figure>
<figure id="4c4a">
<div>
<div>
<iframe class="gist-iframe" src="/gist/yazdanfarreza/87d631184e6aa1c22f5d034e0585ef71.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
</div>
</div>
</figure></iframe></div></div></figure><p id="db58">Thus, equation 1 will be transformed into Equation 3:</p><figure id="c532"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*ecpZEOuBKu45xu0HuPChXA.png"><figcaption>Equation 3</figcaption></figure><blockquote id="5fb6"><p>Please note that you can other <i>distance metrics</i>. And, the equation 3 (eq 1 generally) can be solved with dynamic programming (DP).</p></blockquote><ul><li>K is a random value in {2, 3, 5, 7, 1}, by which we select each period (as you can see in Figure 1) with the size of nj. (you can use any optimization method, here it is a greedy strategy.)</li><li>If the period starts with A and ends with B, we have duration [start, end]. Firstly, we contemplate K equals 2 by selecting a separating point (C) from nine candidates (how?? by maximizing the distance between S_AC and S_CB).</li><li>When we calculated C, we
Options
give k, the value of 3, and so on.</li><li>The results of the main research showed that there is an optimal value of K to have the best performance (it is not very large or very small).</li></ul><p id="495e">So now, let’s have a look TDC from a code perspective: 😉</p>
<figure id="414e">
<div>
<div>
<iframe class="gist-iframe" src="/gist/yazdanfarreza/1173584d7de8cfffe69095a78682a28e.js" allowfullscreen="" frameborder="0" height="undefined" width="undefined">
</div>
</div>
</figure></iframe></div></div></figure><p id="d6dd">It might be interesting how is the performance of using various distances in TDC. Well, in the main research, researchers provided their results on different distance functions.</p><ul><li>Firstly, they set <i>K = 2</i> for <b>TDC </b>and then compared it with <b><i>one random domain split </i></b>and <b><i>the opposite domain split</i></b>.</li></ul><figure id="b014"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*G28Mht3OlGMfopfqlScusw.png"><figcaption><b>Figure 3</b></figcaption></figure><p id="248d">As you can see, the results of the paper’s TDC show better results in RMSE and MAE for the most distance functions.</p><p id="4ae7">That was all. 😉This was used in <a href="https://arxiv.org/abs/2108.04443">AdaRNN: Adaptive Learning and Forecasting of Time Series</a>, to train their model. Also, you can read my previous article in <a href="https://pub.towardsai.net/adaptive-learning-for-time-series-forecasting-b34e640b865b">Adaptive Learning for Time Series Forecasting</a>. I am going to write another article about implementing AdaRNN in PytorchLightning. If you find any errors in my articles or if there was anything to say, you can easily reach out to me on <a href="http://www.linkedin.com/in/rezayazdanfar">LinkedIn</a>.</p></article></body>