Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A time series data example for LSTM #41

Open
webroot opened this issue Dec 24, 2020 · 1 comment
Open

A time series data example for LSTM #41

webroot opened this issue Dec 24, 2020 · 1 comment

Comments

@webroot
Copy link

webroot commented Dec 24, 2020

I have inputs (dimension 2) and outputs (1) sequence like below all numbers are normalized ( -1 to 1 )

below is copied 2 samples from training data

(-0.70,-0.23) (-0.70,-0.23) (-0.70,-0.23) (-0.70,-0.23) (-0.70,-0.23) 0.03
(-0.61,-0.26) (-0.61,-0.26) (-0.61,-0.26) (-0.61,-0.26) (-0.61,-0.26) -0.20

here last column is a output vector of size 1 and before that we have 5 unrolling pairs of data points, Can you pls point me how to write training routine for above example. I didn't understand much from your rnn-bit example is quite different use case and textgen is difficult to understand.

I tried like below, but i dont think its KANN_F_TRUTH array is correctly populated

for (int j = 0; j < num_rows - batch_size_; j += batch_size_) {

			int k;
			for (k = 0; k < ulen; ++k) {
				for (int b = 0; b < batch_size_; ++b) {
					int s = j + b;/// shuf[j + b];
					for (int i = 0; i < input_; ++i)
						x[k][b*input_ + i] = data.x[s][k][i];
					
					for (int i = 0; i < output_; ++i)
						y[k][b*output_ + i] = data.y[s][i]; // <--------------------------- some fix required here
				}
			}
			
				
			cost += kann_cost(ua, 0, 1) * ulen * batch_size_;
			n_cerr += kann_class_error(ua, &k);
			tot_base += k;
			//kad_check_grad(ua->n, ua->v, ua->n-1);
			kann_RMSprop(n_var, error, NULL, 0.9f, ua->g, ua->x, r);
			tot += ulen * batch_size_;
			
		}
@tomasmalcata
Copy link

tomasmalcata commented May 9, 2021

Did you find any answer for this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants