microsoft / CNTK

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit
https://docs.microsoft.com/cognitive-toolkit/
Other
17.52k stars 4.28k forks source link

LSTM Solar IOT Tutorial Example #2070

Closed srini1948 closed 7 years ago

srini1948 commented 7 years ago

The data set used in this sample solar.csv has a serious flaw: somewhere in the middle the time stamp format includes a UTC offset and as a result grouping of data on a "day" basis is incorrect. The problem starts at 2014-03-09 data. A new day begins I the evening instead of in the early morning when sensors start generating solar data. The program appears to work well for the wrong reason. If this error is corrected the performance is extremely poor.

sayanpa commented 7 years ago

Thanks Srini for pointing this out. I was able to spot the issue, trying a repro.

guschmue commented 7 years ago

Oh, the time offset. I fixed this in the past and don't see it in my local copy but must have forgotten to upload it. We'll upload a fix csv.

srini1948 commented 7 years ago

Thanks!

It works extremely well because you are feeding it initial values that are close to the end of the day when the maximum energy is recorded. The prediction becomes easy.

After correcting for the offset it still works well – but you have to train for 2000 epochs.

Srini

From: Guenther Schmuelling [mailto:notifications@github.com] Sent: Monday, July 03, 2017 6:34 PM To: Microsoft/CNTK Cc: srini1948; Author Subject: Re: [Microsoft/CNTK] LSTM Solar IOT Tutorial Example (#2070)

Oh, the time offset. I fixed this in the past and don't see it in my local copy but must have forgotten to upload it. We'll upload a fix csv.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/CNTK/issues/2070#issuecomment-312744261 , or mute the thread https://github.com/notifications/unsubscribe-auth/AYKGyLxqno4i0kV4jHUOUgyI0DUwS6kHks5sKWxXgaJpZM4OLVAk .Image removed by sender.

srini1948 commented 7 years ago

It is the solar csv file that gets downloaded from the site given in the example.

Guenther already replied to me saying he will fix it.

After the 99th day you will see that all the time stamps have a -7:00 offset. Instead of feeding the readings starting from the morning ( when prediction is difficult) you are now giving it readings from the evening which are very close to the final energy value – even with 40 or 50 epochs you see excellent results.

However, if you fix this error it takes a lot longer to train – 2000 epochs – but it works! You need to apply a learning rate schedule. Constant 0.005 is not good.

From: sayanpa [mailto:notifications@github.com] Sent: Monday, July 03, 2017 2:17 PM To: Microsoft/CNTK Cc: srini1948; Author Subject: Re: [Microsoft/CNTK] LSTM Solar IOT Tutorial Example (#2070)

Thanks Srini for pointing this out. Can you attach the solar.csv file that you are running into issues with. It will help me repro the problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Microsoft/CNTK/issues/2070#issuecomment-312707735 , or mute the thread https://github.com/notifications/unsubscribe-auth/AYKGyMj3RpFgRtCI1p-KZ4Qg3UBTF8dOks5sKTAogaJpZM4OLVAk .Image removed by sender.

srini1948 commented 7 years ago

Sayan,

I have the “Pong from Pixels” described by Karpathy:

http://karpathy.github.io/2016/05/31/rl/

working with CNTK using the Policy Gradient method described in the “cart-pole” RL example.

The loss function is different from Karpathy too.

The interesting observation is it trains well in 13,000 episodes as opposed to over 35,000 for the Karpathy version.

If I were to convert this to a Jupyter Notebook version can it be submitted to your tutorial collection?

Thanks.

Srini

Sent from Mail for Windows 10

From: sayanpa Sent: Monday, July 3, 2017 2:17 PM To: Microsoft/CNTK Cc: srini1948; Author Subject: Re: [Microsoft/CNTK] LSTM Solar IOT Tutorial Example (#2070)

Thanks Srini for pointing this out. Can you attach the solar.csv file that you are running into issues with. It will help me repro the problem. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

sayanpa commented 7 years ago

We definitely take contributions. Please use the deepRL framework. I believe it supports Pong game. Note we prefer tutorials that are supported in both windows and Linux environments.

srini1948 commented 7 years ago

The Atari games ( such as Pong) in OpenAI’s Arcade Learning Environment are officially supported only on Linux and MacOS.

I found a Github source from which using a few hacks I was able to compile “Atari-py” using VS 2015

DeepRL framework that describes “cart-pole” is what I was hoping to modify for this.

Let me see how far I get with this – I am new to Python and Jupyter Notebook

( Is there any plan to create a training front end in C# for CNTK?)

Sent from Mail for Windows 10

From: sayanpa Sent: Tuesday, August 15, 2017 10:33 AM To: Microsoft/CNTK Cc: srini1948; Author Subject: Re: [Microsoft/CNTK] LSTM Solar IOT Tutorial Example (#2070)

We definitely take contributions. Please use the deepRL framework. I believe it supports Pong game. Note we prefer tutorials that are supported in both windows and Linux environments. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

srini1948 commented 7 years ago

In the “cart-pole” RL tutorial for the policy gradient approach the comment in the tutorial says we use the “loss.forward” , loss.backward” to compute the gradients. Is there any paper or reference which explains this because the loss function used here is log(squared)?

Thanks.

Sent from Mail for Windows 10

From: sayanpa Sent: Tuesday, August 15, 2017 10:33 AM To: Microsoft/CNTK Cc: srini1948; Author Subject: Re: [Microsoft/CNTK] LSTM Solar IOT Tutorial Example (#2070)

We definitely take contributions. Please use the deepRL framework. I believe it supports Pong game. Note we prefer tutorials that are supported in both windows and Linux environments. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

sayanpa commented 7 years ago

Srini, can you please open a new issue since this one is on a different topic. Apologies for not asking this earlier.

cha-zhang commented 7 years ago

Closing due to lack of response. As @sayanpa suggested, please open a new issue.