Question: Implement the formula given above with numpy. Hint: 1. t first reshape to a column vector 2. Then multiply t by z Therefore the negative


Implement the formula given above with numpy. Hint: 1. t first reshape to a column vector 2. Then multiply t by z
Therefore the negative log-likelihood function becomes: L=n=1Nlog(tnwxn) def compute_loss(self, X,t): \# compute the loss \# X: feature matrix of shape [N,d] # t: input label of shape [N, # NOTE: return the average of the log-likelihood, NOT the sum. \# extend the input matrix \# compute the loss and return the loss N=X. Shape[ [] z= np.dot (X, self.w)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
