Question: Plot the landscape of the loss function. For example, the following code will print the landscape of Z[i][j]. Z is the loss function value of
Plot the landscape of the loss function. For example, the following code will print the landscape of Z[i][j]. Z is the loss function
value of different ww and bb values.
X_data and y_data are the arrays of your samples.
e.g.bb = np.arange(0,100,1) #bias
ww = np.arange(-5, 5,0.1) #weight
Z = np.zeros((len(bb),len(ww)))
for i in range(len(bb)):
for j in range(len(ww)): b = bb[i]
w = ww[j] Z[j][i] = 0 for n in range(len(x_data)):
Z[j][i] = ...
Z[j][i] = ...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
