Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Can you add a DEMO of LSTM for time series ,Please #9

Closed
sharpwood opened this issue Nov 20, 2017 · 41 comments
Closed

Can you add a DEMO of LSTM for time series ,Please #9

sharpwood opened this issue Nov 20, 2017 · 41 comments
Assignees
Projects
Milestone

Comments

@sharpwood
Copy link

SiaNet is great ! Thanks for your work.
Can you add a DEMO of LSTM for time series .
thanks!

@deepakkumar1984
Copy link
Member

Thanks mate! sure will add to my plan

@deepakkumar1984 deepakkumar1984 self-assigned this Nov 20, 2017
@deepakkumar1984 deepakkumar1984 added this to the 0.3 milestone Nov 20, 2017
@sharpwood
Copy link
Author

Thanks very much。
I see you mark this issue as a question, is it possible that the existing version of the function can be implemented? But I see that class Recurrent has not been cited
If the existing version can be implemented, can you give a line of key code, thank you.

@deepakkumar1984
Copy link
Member

Sorry my bad. I have to implement LSTM, GRU and RNN properly and provide examples. One the plan of development.

@sharpwood
Copy link
Author

👍

@sharpwood
Copy link
Author

LSTM has been added to the layer folder. Is it available now?

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Nov 22, 2017 via email

@sharpwood
Copy link
Author

I added a LSTM layer, but it was wrong when traning: Objects that can be empty must have a value

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Nov 22, 2017 via email

@sharpwood
Copy link
Author

I only try add a line :
model.Add(new LSTM(dim:20,cellDim:1));
in HousingRegression BuildModel method

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Nov 22, 2017

Fixed the issue with the LSTM. Can you please check now. Although I am not sure if LSTM will work with MSE loss function. Also with Sparse input like starting with Embedding layer. Please advice?

@deepakkumar1984
Copy link
Member

Will try to implement this example: https://machinelearningmastery.com/time-series-prediction-lstm-recurrent-neural-networks-python-keras/

Hope to complete by tomorrow

@sharpwood
Copy link
Author

that is great!!!

@sharpwood
Copy link
Author

image

@sharpwood
Copy link
Author

model.Add(new LSTM(20, cellDim: 5));
still in HousingRegression

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Nov 22, 2017 via email

@sharpwood
Copy link
Author

image

@deepakkumar1984
Copy link
Member

Should work now! Please take the latest

@sharpwood
Copy link
Author

That is ok.
When will TimeSeriesPrediction be finished?

@deepakkumar1984
Copy link
Member

I added the example code and testing in progress. Having some issue with training. Will try to complete by tomorrow

@deepakkumar1984
Copy link
Member

Try out this example code with some of your sample data: https://github.com/deepakkumar1984/SiaNet/blob/master/SieNet.Examples/TimeSeriesPrediction.cs

@sharpwood
Copy link
Author

I changed lookback to 3, how to define LSTM shape, as if it was different from Keras

@deepakkumar1984
Copy link
Member

The lookback is the shape of the input. The number of lookback will convert the series data to tabular dataset with 3 columns which will be the input shape.

I have updated the time series example, could you please try again?

model.Add(new LSTM(dim: 4, shape: Shape.Create(lookback)));

@sharpwood
Copy link
Author

I have got last version, it works ,thanks.
If I have multiple features in csv file, how to define the shape?

@deepakkumar1984
Copy link
Member

Ok Its not implemented for multivariate. Let me work on that now and have another example ready for you.

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Nov 28, 2017 via email

@sharpwood
Copy link
Author

I think it may be that I don't make it clear. My English is poor.
I mean not a multi-layer LSTM, but a number of features input data.
For example:
image

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Nov 29, 2017 via email

@sharpwood
Copy link
Author

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Nov 29, 2017 via email

@sharpwood
Copy link
Author

Reshape layer has been committed , Would you update the example?

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Dec 1, 2017 via email

@deepakkumar1984 deepakkumar1984 added this to ToDo in v0.5 Dec 1, 2017
@deepakkumar1984 deepakkumar1984 moved this from ToDo to In Progress in v0.5 Dec 1, 2017
@bmigette
Copy link

bmigette commented Dec 4, 2017

Looks interesting :) Will follow up this project / thread.

@sharpwood
Copy link
Author

How's the example program going?

@deepakkumar1984
Copy link
Member

I will have something by tomorrow. Was working on other fixes on priority.

@deepakkumar1984
Copy link
Member

Please use this example to use Reshape layer: https://github.com/deepakkumar1984/SiaNet/blob/master/SieNet.Examples/MiltiVariateTimeSeriesPrediction.cs

@bmigette
Copy link

bmigette commented Dec 7, 2017

Do you have any documentation that explains what are shapes, and why do we need a reshape layer ?
Nevermind, found explanation here: https://www.tensorflow.org/programmers_guide/tensors :)

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Dec 7, 2017 via email

@sharpwood
Copy link
Author

Normalize and ConvertTimeSeries method seems to have some problems.

Normalize method generate some NaN values , and The ConvertTimeSeries method does not seem to be able to handle multi - column data.

@deepakkumar1984
Copy link
Member

deepakkumar1984 commented Dec 7, 2017

The data frame is bit basic now. Need to enhance with missing values and load datatype other than float. For now you need to sanitize the dataset by yourself and then load it. You can use the framework like Deedle to load the csv and make it ready for training. I may plan to make use of Deedle in the project and way of converting Deedle output to CNTK value.

@deepakkumar1984 deepakkumar1984 moved this from In Progress to ToDo in v0.5 Nov 22, 2018
@deepakkumar1984
Copy link
Member

Closing it off as there is no activity in last 180 days

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
v0.5
  
ToDo
Development

No branches or pull requests

3 participants