QNNs for Stock Price Trend Prediction background cover

QNNs for Stock Price Trend Prediction

Develop quantum neural network models using PyTorch to predict stock price trends based on limit order book data.

Quantum Signals

Hosted by

Quantum Signals

Hasarindu Perera
hasarinduperera

3

Posted

Getting an error when running the dummy model

Hi there, I am getting below error when running the notebook.
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[4], line 2
      1 # Get predictions from the model
----> 2 predictions = model(torch.Tensor(input[0]))
      4 # Move predictions to CPU and convert to NumPy array
      5 predictions = predictions.cpu().numpy()

TypeError: 'method' object is not subscriptable
I believe maybe it is because the notebook uses input as a variable?
# Get predictions from the model
predictions = model(torch.Tensor(input[0]))

# Move predictions to CPU and convert to NumPy array
predictions = predictions.cpu().numpy()
Anyways I tried to change that part and run aqora test but got another error.
# Example input to test the model
sample_input = torch.rand((1, 10))  # Random input with 10 features

# Get predictions from the model
predictions = model(sample_input)

# Move predictions to CPU and convert to NumPy array
predictions = predictions.cpu().detach().numpy()

Order by:


Want to join this discussion?

Join our community today and start discussing with our members by participating in exciting events, competitions, and challenges. Sign up now to engage with quantum experts!