huseinzol05 / Stock-Prediction-Models

Gathers machine learning and deep learning models for Stock forecasting including trading bots and simulations
Apache License 2.0
7.96k stars 2.81k forks source link

Model under evolution-strategy-bayesian-agent.ipynb #36

Closed soulaw-mkii closed 5 years ago

soulaw-mkii commented 5 years ago

Hi Husein,

Thanks for sharing the great works. I am newbie to AI, can understand ES in general.

When I read your code, I have few questions. Grateful if you can shed some light:

def predict(self, inputs):
    feed = np.dot(inputs, self.weights[0]) + self.weights[-1]
    decision = np.dot(feed, self.weights[1])
    buy = np.dot(feed, self.weights[2])
    return decision, buy
  1. In class Model, the output is decision/action , a list of three. What's the actions in your design correspondingly? Hold == 0 , Buy == 1, Sell == 2?
  2. In Agent.act(), np.argmax(decision[0]) is returned. Does decision[0] holds the 3 likelihood of hold/buy/sell? Am I correct?
  3. For the weights[2] (or buy) , it controls the trade quantity as the 2nd output layer. Can I say you let the agent suggest trade size based on the price delta between two price window? Is the value range pre-determined ? e.g. 1-1000 or a black box ?

Best Regards, Steve

huseinzol05 commented 5 years ago
  1. True, as you stated.
  2. Correct.
  3. Determined by the model.