I am following this lesson:
https://gluon.mxnet.io/chapter02_supervised-learning/linear-regression-scratch.html
In the script to plot losses over time(near the end) is this statement
############################################
# Script to plot the losses over time
############################################
def plot(losses, X, sample_size=100):
xs = list(range(len(losses)))
f, (fg1, fg2) = plt.subplots(1, 2)
fg1.set_title('Loss during training')
fg1.plot(xs, losses, '-r')
fg2.set_title('Estimated vs real function')
fg2.plot(X[:sample_size, 1].asnumpy(),
net(X[:sample_size, :]).asnumpy(), 'or', label='Estimated')
fg2.plot(X[:sample_size, 1].asnumpy(),
real_fn(X[:sample_size, :]).asnumpy(), '*g', label='Real')
fg2.legend()
plt.show()
Where does this function named ‘net’ come from?
net(X[:sample_size, :]).asnumpy()
It is never explicitly imported.