project5_machine_learning/machinelearning/models.py
def train(self, dataset):
        """
        Train the perceptron until convergence.
        """
        "*** YOUR CODE HERE ***"
        while True:
            flag = True
            batchsize = 1
            for x, y in dataset.iterate_once(batchsize):
                y = nn.as_scalar(y)
                if self.get_prediction(x) != y:
                    flag = False
                    self.w.update(x, y)
            if flag:
                break

        Train the perceptron until convergence.
        
Train the perceptron until convergence.
Train the perceptron until convergence .
def train(self, dataset):
        while True:
            flag = True
            batchsize = 1
            for x, y in dataset.iterate_once(batchsize):
                y = nn.as_scalar(y)
                if self.get_prediction(x) != y:
                    flag = False
                    self.w.update(x, y)
            if flag:
                break
def train ( self , dataset ) : "*** YOUR CODE HERE ***" while True : flag = True batchsize = 1 for x , y in dataset . iterate_once ( batchsize ) : y = nn . as_scalar ( y ) if self . get_prediction ( x ) != y : flag = False self . w . update ( x , y ) if flag : break
Train the perceptron until convergence.
Train the perceptron until convergence .
"""
        Train the perceptron until convergence.
        """ "*** YOUR CODE HERE ***"
self
dataset