Open junzhang3366 opened 8 years ago
@junzhang3366 please don't change the signature of the functions, these are in place so that default values for sigma/epsilon are set, so you can call the function with just 3 arguments f
,df
and x
. If you want these values changed you can just call the function with
gradient_descent(f,df,x,sigma=0.25,epsilon=1e-16)
for example.
Keyword arguments can be called positionally as well, the following is equivalent to Meghana's example:
# define: f, df, and x
gradient_descent(f, df, x, 0.25, 1e-16)
If I change original
def gradient_descent(f, df, x, sigma=0.5, epsilon=1e-8)
to
def gradient_descent(f, df, x, sigma, epsilon)
.Do you allow us to do it?