Open Lipe991 opened 6 years ago
Same, I've tried changing a lot of parameters and modifying the data structure, but I can't get rid of it. The error appears in model.fit (and also when testing model.evaluate) at line 105 in 2b_cnn.js
I would love a thorough explanation for why this happens in this case in particular. I've been banging my head against it for a while now and the head is losing.
I implement this in Python and Js, same error with data shapes in Dense Layer.
glad I'm not the only one seeing this error.
I'm afraid it's my fault - I wrote the original (and as yet uncompleted) code! The CNN wasn't fully implemented yet!
NINJA EDIT - 9.30.18: Very sorry all please see the comment added below. Also, forgive the excessive !
's. Thanks!
no fix ?
did anyone manage to figure this out...
There are major errors with the code. It is not in a functioning state and that makes me wonder it was even tested before the video was recorded?
Firstly, data.highs
is mapped to epoch times here:
then comes the reshaping part. Why not reshape it prior when the dates are being converted to epoch?
That does not make sense. ( https://js.tensorflow.org/api/0.12.5/#reshape )
and then the part that left me speechless was this...
Why would you map a price series that way? Not even sure what was the goal...
Could someone enlighten me. I'm not sure how the reshaped list should look like.
It wasn't tested, it's just an idea but that wasn't made very clear in the video. I've played around with it a lot and gotten it to a state where it works fairly well with a simple NN consisting only of dense layers. Next step is to get my head around formatting the data as matrices and implementing a CNN, but I'm learning as I'm going and some of the maths is hard.
Same problems here!
Same here, kinda disappointment.
@llSourcell Hi, do you notice this issue?
There are major errors with the code. It is not in a functioning state and that makes me wonder it was even tested before the video was recorded?
Firstly,
data.highs
is mapped to epoch times here:Financial_Forecasting_with_TensorflowJS/public/scripts/2a_cnn.js
Line 35 in 3244c20
dates.push(new Date(data[i]['Date'] + 'T00:00:00.000').getTime()) then comes the reshaping part. Why not reshape it prior when the dates are being converted to epoch?
Financial_Forecasting_with_TensorflowJS/public/scripts/2b_cnn.js
Line 94 in 3244c20
tdates.reshape([1, 1960, 1]), That does not make sense. ( https://js.tensorflow.org/api/0.12.5/#reshape )
and then the part that left me speechless was this...
Financial_Forecasting_with_TensorflowJS/public/scripts/2b_cnn.js
Line 95 in 3244c20
thighs.reshape([1, 1960, 1]), { Why would you map a price series that way? Not even sure what was the goal...
Could someone enlighten me. I'm not sure how the reshaped list should look like.
Hi All!
I'm @Thoughtscript - I wanted to apologize about the confusion this has caused! Yikes!
First, let me be very clear that I'm not in any way affiliated with @llSourcell.
This code was NOT PRODUCTION WORTHY and INCOMPLETE - as noted on the original repo listed here - it's a WORK IN PROGRESS.
Actually, I'm not sure how it ended up in a video or attracting any interest whatsoever.
The code was being completed for an article to be posted on the top-ranked consulting firm X-Team's blog. Unfortunately, the company decided to move in another direction with its writing and I've since moved over to Microsoft (though I remain affiliated with X-Team's great community).
Every other repo listed under my @Thoughtscript account without a WIP flag should be fully functional (with any issues, if they exist, noted). This particular project (which you'll note bears my name on in the pictures), is actually no longer maintained.
Any questions, feel free to send me an email at adam.gerard@gmail.com. Sorry for any confusion this has caused.
Cheers!
PS - maybe try:
Hi @Thoughtscript , thanks for your kind explanation and mostly for noticing this issue!
Now the big question is, what was the working demo which @llSourcell showed us in his Live stream. https://youtu.be/5Uw1iSwvHH8?t=47m53s
Anyway, I think this is not a proper learning material after all.
Anyway, I think this is not a proper learning material after all.
exactly - this is generating a lot of confusion. for beginners this whole subject is hard to grasp and it is made even harder with all the other backend stuff going on.
siraj makes stuff look really easy by skipping a lot of difficult and crucial steps and this repo here is the perfect example i wasn't even aware that this is not his code - but maybe i just didn't pay attention ¯_(ツ)_/¯
I tried to use the code but it didn't worked for me. So the closest working solution that I got was this one: https://towardsdatascience.com/stock-price-prediction-system-using-1d-cnn-with-tensorflow-js-machine-learning-easy-and-fun-fe5323e68ffb
Hope that helps.
I've got an error trying to run your code,
Uncaught (in promise) Error: Error when checking target: expected dense_Dense1 to have shape [,57,10], but got array with shape [1,1960,1].