joelgrus / data-science-from-scratch

code for Data Science From Scratch book
MIT License
8.63k stars 4.5k forks source link

estimate_gradiente function type annotations no output #73

Closed giordafrancis closed 5 years ago

giordafrancis commented 5 years ago

Hi there,

Not sure if this is an issue but , chapter 8 Gradient descent; estimate_gradient function should it return a Vector type? def estimate_gradient(f: Callable[[Vector], float], c: Vector, h: float = 0.0001) -> Vector: return [partial_difference_quotient(f, v, i, h) for i in range(len(v))]
either way thanks for the great book :)

joelgrus commented 5 years ago

you're correct, I guess I just missed annotating that return type (the type annotations are optional, so it doesn't hurt anything to not have them, but I meant to put them everywhere)