rasbt / python-machine-learning-book-3rd-edition

The "Python Machine Learning (3rd edition)" book code repository
https://www.amazon.com/Python-Machine-Learning-scikit-learn-TensorFlow/dp/1789955750/
MIT License
4.6k stars 1.99k forks source link

range error chapter 15 part 1 #123

Closed elfelround closed 4 years ago

elfelround commented 4 years ago

hiya,

on chapter 15 part 1

page 526 on book function conv1d:

for i in range(0, int(len(x)/s),s)

this is a quick fix, only works with current example, if you augment padding by one it wont work,

id recommend this

for i in range(0, int((len(x_padded) - len(w_rot) / s)) + 1, s):