问题:考虑我有5座房屋(m = 1,2,3,4,5),每座房屋都有2个特征(大小和卧室数,因此(J = 1,2)
现在我想应用Gradient Descent,我感到困惑的是哪个循环应该在外部,哪个循环应该在内部。请在下面的示例代码中提出建议?
这是我的理解(不仅仅针对数学或编程语言)
# Initialize empty list
my_list = list( )
# initialize some value of theta.
theta = some random value.
Do this until converge {
for j in 1,2{
for m in 1,2,3,4,5{
CACL = perform the caculation and append it in list we initilize on top of
}# m loop ends here
} # J loop ends here.
# apply the update rule on Q values
}