Closed xinsuinizhuan closed 2 years ago
Others, how to convert vector
Hi again @xinsuinizhuan I'll answer your questions so you understand forecasting:
Thank you very much for all your questions, David.
how about the forecast result? I use the source data in airline_passengers.csv, as the minimum loss decrease, the forecast data shoud be good, but this result is so bad:
Others, how to convert vector to Tensor<type, 2>, and convert Tensor<type, 2> to vector?
Hi @xinsuinizhuan
LSTM layer is under development, so its performance won't be as good as desired. We apologize for that.
I can't help you with your vector doubt if you don't give us more information. What do you want to achieve exactly?
About Tensor to vector and vector to Tensor:
I read the data from txt and cvs file,and i put them into the vector, but when i want to forecast, i need to convert them to Tensor, as my data is:
std::vector
You can create an auxiliary DataSet for reading CSV files and obtaining data as a Tensor<type,2> . Following code illustrates how:
DataSet aux_data_set("path.csv", char file_delimiter, false)
Tensor<type, 2> mydata = aux_data_set.get_data()
I hope this works for you; thank you very much for your questions, David.
The airline_passengers example, i have two questions: 1、 const Index lags_number = 2; const Index steps_ahead_number = 1; Is it mean the pre tow rows records to forecasting the third record? then what the Calculate outputs mean? it is a 4x3 input ,and get the 4 output, it should not be 2x4 or 2x1? as the: Tensor<type, 2> input_data(1, 2); input_data.setValues({ {112,118} }); I use the 1x2 input data in source data, but the predict result is so bad: i also use the 4x3 input data in source data, but the predict result also is so bad: 2、how to set the train epochs, i use the : training_strategy.set_maximum_epochs_number(300); but it only train 109