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

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

        Arguments:
            callback_data (HDF5 dataset): shared data between callbacks
            model (Model): model object
            epoch (int): index of current epoch
            minibatch (int): index of minibatch that is ending
        """
        costs = np.array([c.cost for c in model.cost.costs])
        self.cost_history.append(costs)
        mean_cost = sum(self.cost_history) / len(self.cost_history)
        mbstart = callback_data['time_markers/minibatch'][epoch-1] if epoch > 0 else 0
        callback_data['multicost/train'][mbstart + minibatch, :] = mean_cost.squeeze()

        # Extract all nested-multicosts
        costs_allbranches = np.array([self.multicost_recurse(c) for c in model.cost.costs])
        # Subtract non-trunk branches from summed trunk cost to get individual branch costs
        costs_allbranches = self.separate_branch_costs(costs_allbranches)
        callback_data['multicost/train_allbranches'][mbstart + minibatch, :] =\
            costs_allbranches.squeeze()
def on_minibatch_end ( self , callback_data , model , epoch , minibatch ) : costs = np . array ( [ c . cost for c in model . cost . costs ] ) self . cost_history . append ( costs ) mean_cost = sum ( self . cost_history ) / len ( self . cost_history ) mbstart = callback_data [ 'time_markers/minibatch' ] [ epoch - 1 ] if epoch > 0 else 0 callback_data [ 'multicost/train' ] [ mbstart + minibatch , : ] = mean_cost . squeeze ( ) # Extract all nested-multicosts costs_allbranches = np . array ( [ self . multicost_recurse ( c ) for c in model . cost . costs ] ) # Subtract non-trunk branches from summed trunk cost to get individual branch costs costs_allbranches = self . separate_branch_costs ( costs_allbranches ) callback_data [ 'multicost/train_allbranches' ] [ mbstart + minibatch , : ] = costs_allbranches . squeeze ( )