(self, callback_data, model, epoch)
Called when an epoch is about to end

        Arguments:
            callback_data (HDF5 dataset): shared data between callbacks
            model (Model): model object
            epoch (int): index of epoch that is ending
Called when an epoch is about to end
Called when an epoch is about to end
def on_epoch_end(self, callback_data, model, epoch):
        """
        Called when an epoch is about to end

        Arguments:
            callback_data (HDF5 dataset): shared data between callbacks
            model (Model): model object
            epoch (int): index of epoch that is ending
        """

        for batch_index, (x, t) in enumerate(self.valid_set, 1):
            y = model.fprop(x, inference=True)

            # So that wider tensors don't wrap around
            np.set_printoptions(formatter={'float': '{: 0.1f}'.format},
                                linewidth=150)

            # Assume all sequences in minibatch have same length, then:
            # pull the mask buffer to host from device
            # get the list of all its columns that were nonzero
            # take the maximum of those, which is the total number of timesteps
            # divide by batch size to get time steps in one sequence for this minibatch
            # add 1 for indexing purposes
            columns = 1 + (np.max(t[1].get().nonzero()[1]) // self.be.bsz)

            # Print out the name and pretty version of each of X, y, and mask
            for name, item in zip(["Inputs", "Outputs", "Targets"],
                                  [x, y, t[0]]):

                neon_logger.display(name)

                # Only get the first sequence in the minibatch
                # There is no bias here - sequences are randomly generated
                printable = item.get()[:, ::self.be.bsz]
                neon_logger.display(printable[:, :columns])

            # Only do this for one minibatch - it's a diagnostic tool, not a log
            break
def on_epoch_end ( self , callback_data , model , epoch ) : for batch_index , ( x , t ) in enumerate ( self . valid_set , 1 ) : y = model . fprop ( x , inference = True ) # So that wider tensors don't wrap around np . set_printoptions ( formatter = { 'float' : '{: 0.1f}' . format } , linewidth = 150 ) # Assume all sequences in minibatch have same length, then: # pull the mask buffer to host from device # get the list of all its columns that were nonzero # take the maximum of those, which is the total number of timesteps # divide by batch size to get time steps in one sequence for this minibatch # add 1 for indexing purposes columns = 1 + ( np . max ( t [ 1 ] . get ( ) . nonzero ( ) [ 1 ] ) // self . be . bsz ) # Print out the name and pretty version of each of X, y, and mask for name , item in zip ( [ "Inputs" , "Outputs" , "Targets" ] , [ x , y , t [ 0 ] ] ) : neon_logger . display ( name ) # Only get the first sequence in the minibatch # There is no bias here - sequences are randomly generated printable = item . get ( ) [ : , : : self . be . bsz ] neon_logger . display ( printable [ : , : columns ] ) # Only do this for one minibatch - it's a diagnostic tool, not a log break