We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
stock-rnn/data_model.py
Line 48 in 2019be9
是不是应该改为 seq = [seq[0] / seq[0][0] - 1.0] + [curr / seq[i-1][-1] - 1.0 for i, curr in enumerate(seq[1:])]
The text was updated successfully, but these errors were encountered:
Let's check!
from __future__ import division import numpy as np def split_and_normalize_prices(seq, input_size): seq = [np.array(seq[i * input_size: (i + 1) * input_size]) for i in range(len(seq) // input_size)] print "After split:", seq seq = [seq[0] / seq[0][0] - 1.0] + [curr / seq[i][-1] - 1.0 for i, curr in enumerate(seq[1:])] print "After normalization:", seq return seq
With this function defined, split_and_normalize_prices(range(1, 11), 4) prints out:
split_and_normalize_prices(range(1, 11), 4)
After split: [array([1, 2, 3, 4]), array([5, 6, 7, 8])] After normalization: [array([ 0., 1., 2., 3.]), array([ 0.25, 0.5 , 0.75, 1. ])]
I believe this is expected behavior :)
Sorry, something went wrong.
No branches or pull requests
stock-rnn/data_model.py
Line 48 in 2019be9
是不是应该改为
seq = [seq[0] / seq[0][0] - 1.0] + [curr / seq[i-1][-1] - 1.0 for i, curr in enumerate(seq[1:])]
The text was updated successfully, but these errors were encountered: