def gradientdescent(xtrn,ytrn,lrnrate=0.1,maxitr=100):
theta=np.zeros((2,))
errorlist=np.array([])
thetalist=np.array([])
for i in range(maxitr):
grad=gradient(xtrn,ytrn,theta)
errorlist=np.append(errorlist,error(xtrn,ytrn,theta))
thetalist=np.append(thetalist,theta)
theta[0]=theta[0]-lrnrate*grad[0]
theta[1]=theta[1]-lrnrate*grad[1]
return theta,errorlist,thetalist
how , I can find out theta without maxitr which is 100 in my code ?..