-
Notifications
You must be signed in to change notification settings - Fork 2
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
createHiddenLayerNetsForCount expect too small a number #1
Comments
Hi, Would you please provide some training samples for me to test that issue ? Thanks,
Kalvar
… Emilian Bold ***@***.***> 於 2018年1月6日 下午11:08 寫道:
It seems to me RNN createHiddenLayerNetsForCount expects at most patterns[0].features.count.
If I use a bigger number the app crashes.
If I have a time series, the number of features is small so it seems to me this might be a reason why the network doesn't really converge and I get no predictions.
Of course, I might also be miss-using the library. I appreciate you making it public, I didn't have to try implement all of that!
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 3 beyond bounds [0 .. 2]'
*** First throw call stack:
(
0 CoreFoundation 0x0000000104a70b0b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00000001044d5141 objc_exception_throw + 48
2 CoreFoundation 0x00000001049a5ffb -[__NSArrayM objectAtIndex:] + 203
3 RNN 0x0000000103593b40 -[RNNMath sumMatrix:anotherMatrix:] + 448
4 RNN 0x00000001035954cd -[RNNNet outputWithInputs:recurrentOutputs:] + 205
5 RNN 0x000000010358ca28 __37-[RNN(Training) forwardWithFeatures:]_block_invoke.47 + 120
6 CoreFoundation 0x0000000104a01652 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114
7 CoreFoundation 0x0000000104a014e2 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 194
8 RNN 0x000000010358c511 -[RNN(Training) forwardWithFeatures:] + 721
9 RNN 0x000000010358cdeb -[RNN(Training) trainingWithPattern:] + 187
10 RNN 0x000000010358ea12 __30-[RNN(Training) startTraining]_block_invoke + 114
11 CoreFoundation 0x0000000104a01652 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114
12 CoreFoundation 0x0000000104a014e2 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 194
13 RNN 0x000000010358e5ae -[RNN(Training) startTraining] + 478
14 RNN 0x0000000103590521 -[RNN trainingWithCompletion:] + 113
15 RNN 0x0000000103590674 -[RNN trainingWithIteration:completion:] + 132
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Looks to me like the code expects that the number of cells in the hidden layer must be smaller than the number of cells in the input layer. While I assumed I could increase that number to, perhaps, get better results. In your iOS-RNN sample file, if I replace this line with
I need to tweak some parameters and I assumed that besides For simple data (straight line) the network does train, but not for the (semi-random?) test data I'm using. It might be a case of garbage-in garbage-out. The series 'looks' simple and the training and predictions are way off: |
Please check the condition of forloop: for(int i = chunkSize; i < vals.count; i++){}, it won't be working on first time that i=7 and valus.count is 7 too. Hence, the patterns will be empty, then crashed. |
Please note I'm able to crash your own example from https://github.com/Kalvar/ios-RNN/tree/master/ios-RNN by just changing So, I sense there's something deeper here. Indeed, there's a small bug (the shame...) when chunkSize == number of train items, but the test data has alway been higher, so I didn't run into that. |
Okay, got your question, I'm checking now. |
It is a bug yes, I will fix it. |
Fixed createHiddenLayerNetsForCount crash bug. (Updated RNN version to 1.1) |
This fixes the I'm going to close this issue. I still don't see good convergence for my time series data. Would appreciate any hints you have for time series prediction using your library. I'm thinking about implementing a LSTM myself... |
It seems to me
RNN createHiddenLayerNetsForCount
expects at mostpatterns[0].features.count
.If I use a bigger number the app crashes.
If I have a time series, the number of features is small so it seems to me this might be a reason why the network doesn't really converge and I get no predictions.
Of course, I might also be miss-using the library. I appreciate you making it public, I didn't have to try implement all of that!
The text was updated successfully, but these errors were encountered: