def set_theta(self, theta):
"""
Function sets theta. Can be called from constructor or outside.
"""
if isinstance(theta, (np.ndarray, np.generic)):
self.theta = theta
elif isinstance(theta, list):
self.theta = np.array(theta)
else:
self.theta = None
self.history = self.set_list(
self.history, 0, (np.copy(self.theta), 0, None))
self.step_no = 0
评论列表
文章目录