Cryptocurrency-predicting RNN Model – Deep Learning w/ Python, TensorFlow and Keras p.11




[ad_1]

Welcome to the next tutorial covering deep learning with Python, Tensorflow, and Keras. We’ve been working on a cryptocurrency price movement prediction recurrent neural network, focusing mainly on the pre-processing that we’ve got to do. In this tutorial, we’re going to be finishing up by building our model and training it.

Text tutorials and sample code: https://pythonprogramming.net/crypto-rnn-model-deep-learning-python-tensorflow-keras/

Discord: https://discord.gg/sentdex
Support the content: https://pythonprogramming.net/support-donate/
Twitter: https://twitter.com/sentdex
Facebook: https://www.facebook.com/pythonprogramming.net/
Twitch: https://www.twitch.tv/sentdex
G+: https://plus.google.com/+sentdex

Source


[ad_2]

Comment List

  • sentdex
    December 24, 2020

    is anyone else getting a "Value Error" on your callbacks?

  • sentdex
    December 24, 2020

    I ran the code from your website. Looks like train_y and validation_y are lists and must be converted to np.arrays before running

  • sentdex
    December 24, 2020

    What does it want?((

    Exception has occurred: TypeError
    Error converting shape to a TensorShape: only integer scalar arrays can be converted to a scalar index.
    File "/Users/viktor.usakov/Library/Mobile Documents/com~apple~CloudDocs/Projects/StockPricePredicting/predict.py", line 119, in <module>
    model.add(CuDNNLSTM(128, input_shape=(train_x[1:]), return_sequences=True))

  • sentdex
    December 24, 2020

    I want to classify anomaly detection using RNN keras.tf but I have a problem where the accuracy value increases but the val_accuracy value does not change and just remains constant at 50%. this is my complete code available on google colab https://colab.research.google.com/drive/1saoNuCxj08JCxZ_7taIjhp8sJEIV-T5U?usp=sharing

  • sentdex
    December 24, 2020

    So I implemented this model with minor changes and used on stocks. Things got weird, the val_accuracy start off at 0.67 and its decreasing. I think it might because the model still overfits. Using shuffling or normalization does not help at all. Its weird because it start off pretty good, but won't improve. Any ideas?

  • sentdex
    December 24, 2020

    Hi Sir,
    I am trying to fit weather data into my RNN in a similar way you did, however my outputs are not binary, but rather a normalized scale from zero to one indicating the amount of Directly Incoming Radiation. How can I tweak the model so the outputs are non binary? I know it sounds stupid, but the range of outputs are 'infinte' in a way, so I don't know what to write on my Dense Layer.
    Thank you very much

  • sentdex
    December 24, 2020

    the accuracy of this method doesn't pass 51% when it comes to forex data. does anyone know why?

  • sentdex
    December 24, 2020

    The series is missing the Functional API type of model. It is also missing the unsupervised learning types of examples. And offcourse the one you said Audio!! I know this series was done two years ago and now you are busy in new nnfs series but it would be great if you could add this things as well. Thanks! ✌🏻

  • sentdex
    December 24, 2020

    doesn't train_x contain data of all the four cryptocurrencies so while your running the model for a single cryptocurrency doesn't it include all the four cryptocurrency columns as input

  • sentdex
    December 24, 2020

    since TF 2.0, instead of using CuDNNLASTM, use just LSTM (https://keras.io/guides/working_with_rnns/#performance-optimization-and-cudnn-kernels)

  • sentdex
    December 24, 2020

    ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float).
    Anyone knows how to solve this error?

  • sentdex
    December 24, 2020

    Hey, I'm new to Python and tensor flow and have just finished the tut. I want to start experimenting but i can't get model.predict to work, or really know how to structure the data for it. Would anyone be able to give me a hand?

  • sentdex
    December 24, 2020

    I am getting a validation accuracy of 1 in second epoch..
    Bug I guess . . LOL
    but yes val_acc of 1, dunno what went wrong

  • sentdex
    December 24, 2020

    Hey sentdex! , you have a unique way  in your tutorials , and i enjoy watching them 
    I just wonder if you can explain how to create a proper sequence  
    from currently  ‘live raw data’ sequences
    that currently happing in the stock market, that is a
    sequences that fits to the previously created model, properly. 
    how to preprocessing it in the why preprocessing(df)  function do when it was trained?do i need to use the size of the validation df? when scaling and preprocessing it ? or i can use any size that i want 
    for example : 
    if the 5% of the the trained data was 1000
    do i need to preprocess 1000 latest values? from the ‘live data’
    and use then the latest one from them? when making a predication using the model predict method 
    the main question is how to feed a proper preprocessed data from currently happing live raw data, into a previously created model ?

  • sentdex
    December 24, 2020

    Great tutorial! Thanks a lot for doing this @sentdex. You are amazing!

    If you are getting a 'val_acc KeyError' when using ModelCheckpoint, just replace the 'val_acc' in filepath and the parameters to ModelCheckpoint with 'val_accuracy'.
    Ohh, and also use '.hd5' instead of '.model'.

    Sample code (I separated formatting part just for ease of understanding):
    checkpoint_filepath = "models/RNN_Final-{epoch:02d}-{val_accuracy.3f}.hd5"
    checkpoint = ModelCheckpoint(filepath=checkpoint_filepath, monitor='val_accuracy', verbose=1, save_best_only=True, mode='max')

  • sentdex
    December 24, 2020

    @sentdex, can you make a video how data is being fed to your LSTM model? That would be great

  • sentdex
    December 24, 2020

    Everything was working fine until the last part when you build rnn. But then an error pops up while you run it on command prompt. Is there any other way to observe output and making graph
    rather than using cmd and tensor website. Can you explain the last part in the video that starts after 13 minutes.

  • sentdex
    December 24, 2020

    now you need to use .hdf5 for the filepath (see https://github.com/keras-team/keras/issues/6104)

  • sentdex
    December 24, 2020

    hey sentdex uhmmm I love your tutorials man! learned a lot 😀

    I got a question hmmm is this really it? i think you forgot to remove the input_shape of the last to LSTM layers

    model.add(LSTM(128,activation="relu",input_shape=(train_x.shape[1:]),return_sequences=True))

    model.add(Dropout(0.1))

    model.add(BatchNormalization())

    the input_shape() should be removed right cause input_shape only goes at the first layer where it is obviously the input layer right? THANKSSSSSSSSSSSSSSS 😀

  • sentdex
    December 24, 2020

    Everything worked well. I just needed to change the arraytype from float64 to float32 as TensorFlow was being weird.

    return np.array(x).astype("float32"), np.array(y)

Write a comment