hw3/hw3_submission.py
def predict(self, x):
        """
        Use the trained weights of this linear classifier to predict labels for
        data points.
        Inputs:

        Returns:
        - y_pred: Predicted labels for the data in X. y_pred is a 1-dimensional
          array of length N, and each element is an integer giving the predicted
          class.
        """
        ############################################################
        ############################################################
        # BEGIN_YOUR_CODE
        # Calculate predicted y
        g1 = x.dot(self.W1) + self.b1
        h1 = self.activation(g1)
        g2 = h1.dot(self.W2) + self.b2
        y_hat = np.round(self.sigmoid(g2))
        pass

        # END_YOUR_CODE
        ############################################################
        ############################################################
        return y_hat

        Use the trained weights of this linear classifier to predict labels for
        data points.
        Inputs:

        Returns:
        - y_pred: Predicted labels for the data in X. y_pred is a 1-dimensional
          array of length N, and each element is an integer giving the predicted
          class.
        
Use the trained weights of this linear classifier to predict labels for
data points.
Inputs.
Use the trained weights of this linear classifier to predict labels for data points . Inputs .
def predict(self, x):
        g1 = x.dot(self.W1) + self.b1
        h1 = self.activation(g1)
        g2 = h1.dot(self.W2) + self.b2
        y_hat = np.round(self.sigmoid(g2))
        pass
        return y_hat
def predict ( self , x ) : g1 = x . dot ( self . W1 ) + self . b1 h1 = self . activation ( g1 ) g2 = h1 . dot ( self . W2 ) + self . b2 y_hat = np . round ( self . sigmoid ( g2 ) ) pass return y_hat
Use the trained weights of this linear classifier to predict labels for
data points.
Use the trained weights of this linear classifier to predict labels for data points .
"""
        Use the trained weights of this linear classifier to predict labels for
        data points.
        Inputs:

        Returns:
        - y_pred: Predicted labels for the data in X. y_pred is a 1-dimensional
          array of length N, and each element is an integer giving the predicted
          class.
        """ ############################################################ ############################################################ # BEGIN_YOUR_CODE # Calculate predicted y # END_YOUR_CODE ############################################################ ############################################################
None
self
x