matroid / dlwithtf

TensorFlow for Deep Learning Book
http://shop.oreilly.com/product/0636920065869.do
321 stars 160 forks source link

Bug in ch3 example of logistic regression #16

Closed ninjrok closed 6 years ago

ninjrok commented 6 years ago

A type error is thrown when using '/' to calculate matrix sizes. Explicitly using the integer division operator ('//') seems to fix it. Very weird since N is being declared as an integer in the step before it.

Traceback (most recent call last): File "/home/ninja/Documents/github/dlwithtf/ch3/logistic_regression_tf.py", line 13, in <module> mean=np.array((-1, -1)), cov=.1*np.eye(2), size=(N/2,)) File "mtrand.pyx", line 4508, in mtrand.RandomState.multivariate_normal File "mtrand.pyx", line 1550, in mtrand.RandomState.standard_normal File "mtrand.pyx", line 167, in mtrand.cont0_array TypeError: 'float' object cannot be interpreted as an integer

I've also created a PR for this issue if you want to take a look.

https://github.com/matroid/dlwithtf/pull/15

rbharath commented 6 years ago

Closing since #15 has been merged.