USGS-R / river-dl

Deep learning model for predicting environmental variables on river systems
Creative Commons Zero v1.0 Universal
21 stars 14 forks source link

Use soft DTW as loss function? #187

Open jsadler2 opened 2 years ago

jsadler2 commented 2 years ago

I'd be interested in trying soft-DTW (dynamic time warping) as a loss function. I don't know a whole lot about DTW, but from what I understand, it compares two time series more based on their shape and not as much on a point-by-point basis (as something like RMSE does).

One question I have: how it would handle missing labels? I guess we'd need to dig into the equations... (https://arxiv.org/abs/1703.01541)

Also, that I'm writing this, I'm not sure that we'd even want to be comparing "shapes" over individual points. We could always make it a part of the loss function if we aren't wanting to totally abandon the point comparisons.

janetrbarclay commented 2 years ago

This is an interesting concept - somewhat similar to the gw loss (where we assume a sinusoidal shape and specify the amplitude, mean, and phase shift) but much more flexible. I think Lauren Koenig has done some dynamic time warping work so she may have some ideas.


Janet Barclay U.S. Geological Survey New England Water Science Center Connecticut Office 101 Pitkin St. East Hartford, CT 06108

Phone (office) 860 291-6763 Fax 860 291-6799 Email @.**@*.**@*.***> https://www.usgs.gov/staff-profiles/janet-barclay


From: Jeff Sadler @.> Sent: Monday, February 28, 2022 11:45 AM To: USGS-R/river-dl @.> Cc: Subscribed @.***> Subject: [EXTERNAL] [USGS-R/river-dl] Use soft DTW as loss function? (Issue #187)

This email has been received from outside of DOI - Use caution before clicking on links, opening attachments, or responding.

I'd be interested in trying soft-DTW (dynamic time warping) as a loss function. I don't know a whole lot about DTW, but from what I understand, it compares two time series more based on their shape and not as much on a point-by-point basis (as something like RMSE does).

One question I have: how it would handle missing labels? I guess we'd need to dig into the equations... (https://arxiv.org/abs/1703.01541https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Farxiv.org%2Fabs%2F1703.01541&data=04%7C01%7Cjbarclay%40usgs.gov%7Ceaa17b7ab0604efc0ef508d9faea9bb9%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C637816708265445614%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=tideFR8wwm4b9tLTBVkOgLauZGXYWEioP2jbNwznxCU%3D&reserved=0)

Also, that I'm writing this, I'm not sure that we'd even want to be comparing "shapes" over individual points. We could always make it a part of the loss function if we aren't wanting to totally abandon the point comparisons.

— Reply to this email directly, view it on GitHubhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FUSGS-R%2Friver-dl%2Fissues%2F187&data=04%7C01%7Cjbarclay%40usgs.gov%7Ceaa17b7ab0604efc0ef508d9faea9bb9%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C637816708265445614%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=LWZV%2BK5ZKgZciPjMhNllPa4MFYdabE6rdAzcbneMLvo%3D&reserved=0, or unsubscribehttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA5H7UCEQQIXYI5XOOAOMCDU5OREFANCNFSM5PRTIIOA&data=04%7C01%7Cjbarclay%40usgs.gov%7Ceaa17b7ab0604efc0ef508d9faea9bb9%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C637816708265445614%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wWEum%2BmLrr%2BSsP79G4D1YrpXloEZbr%2B6C%2BPsp3RMPnk%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Cjbarclay%40usgs.gov%7Ceaa17b7ab0604efc0ef508d9faea9bb9%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C637816708265445614%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jcSnzBKtw1Cn0ef4IyyV1%2BsRc3R3fOZHz3pWJClLJq0%3D&reserved=0 or Androidhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Cjbarclay%40usgs.gov%7Ceaa17b7ab0604efc0ef508d9faea9bb9%7C0693b5ba4b184d7b9341f32f400a5494%7C0%7C0%7C637816708265445614%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=m%2BDvwzFOcIkAsbQPiO4EslkrVObeNcZLk0dt%2BkNxas8%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>