Remove cycle marker at epoch_start.

        Parameters
        ----------
        epoch_start: int
            start time of epoch, in seconds
499051
def remove_cycle_mrkr(self, epoch_start):
        
        if self.rater is None:
            raise IndexError('You need to have at least one rater')
        cycles = self.rater.find('cycles')
        for one_mrkr in cycles.iterfind('cyc_start'):
            if int(one_mrkr.text) == epoch_start:
                cycles.remove(one_mrkr)
                self.save()
                return

        for one_mrkr in cycles.iterfind('cyc_end'):
            if int(one_mrkr.text) == epoch_start:
                cycles.remove(one_mrkr)
                self.save()
                return

        raise KeyError('cycle marker at ' + str(epoch_start) + ' not found')
244116
def remove_points_from_interval(self, start, end):
        
        for s, e, v in self.iterperiods(start, end):
            try:
                del self._d[s]
            except KeyError:
                pass
625933
def on_epoch_end(self, epoch, logs=None):
        
        if logs is None:
            logs = dict()
        logger.debug(logs)
        nni.report_intermediate_result(logs["val_acc"])
459342
def on_epoch_end(self, pbar, epoch, last_metrics, **kwargs):
        ""
        if not hasattr(self, 'last_gen') or not self.show_img: return
        data = self.learn.data
        img = self.last_gen[0]
        norm = getattr(data,'norm',False)
        if norm and norm.keywords.get('do_y',False): img = data.denorm(img)
        img = data.train_ds.y.reconstruct(img)
        self.imgs.append(img)
        self.titles.append(f'Epoch {epoch}')
        pbar.show_imgs(self.imgs, self.titles)
        return add_metrics(last_metrics, [getattr(self.smoothenerG,'smooth',None),getattr(self.smoothenerC,'smooth',None)])
909292
def int_global_to_local_start(self, index, axis=0):
        
        if index >= self.__mask[axis].stop-self.__halos[1][axis]:
            return None

        if index < self.__mask[axis].start:
            return 0

        return index-self.__mask[axis].start
1145179
def _mark_started(self):
        
        log = self._params.get('log', self._discard)

        now = time.time()
        self._started = now

        limit = self._config_running.get('time_limit')
        try:
            limit = float(_fmt_context(self._get(limit, default='0'), self._context))
            if limit > 0:
                log.debug("Applying task '%s' time limit of %s", self._name, deltafmt(limit))
                self._limit = now + limit
        except Exception as e:
            log.warn("Task '%s' time_limit value '%s' invalid -- %s",
                self._name, limit, e, exc_info=log.isEnabledFor(logging.DEBUG))
91923
def _run_epoch(
        self,
        item_features,
        user_features,
        interactions,
        sample_weight,
        num_threads,
        loss,
    ):
        

        if loss in ("warp", "bpr", "warp-kos"):
            # The CSR conversion needs to happen before shuffle indices are created.
            # Calling .tocsr may result in a change in the data arrays of the COO matrix,
            positives_lookup = CSRMatrix(
                self._get_positives_lookup_matrix(interactions)
            )

        # Create shuffle indexes.
        shuffle_indices = np.arange(len(interactions.data), dtype=np.int32)
        self.random_state.shuffle(shuffle_indices)

        lightfm_data = self._get_lightfm_data()

        # Call the estimation routines.
        if loss == "warp":
            fit_warp(
                CSRMatrix(item_features),
                CSRMatrix(user_features),
                positives_lookup,
                interactions.row,
                interactions.col,
                interactions.data,
                sample_weight,
                shuffle_indices,
                lightfm_data,
                self.learning_rate,
                self.item_alpha,
                self.user_alpha,
                num_threads,
                self.random_state,
            )
        elif loss == "bpr":
            fit_bpr(
                CSRMatrix(item_features),
                CSRMatrix(user_features),
                positives_lookup,
                interactions.row,
                interactions.col,
                interactions.data,
                sample_weight,
                shuffle_indices,
                lightfm_data,
                self.learning_rate,
                self.item_alpha,
                self.user_alpha,
                num_threads,
                self.random_state,
            )
        elif loss == "warp-kos":
            fit_warp_kos(
                CSRMatrix(item_features),
                CSRMatrix(user_features),
                positives_lookup,
                interactions.row,
                shuffle_indices,
                lightfm_data,
                self.learning_rate,
                self.item_alpha,
                self.user_alpha,
                self.k,
                self.n,
                num_threads,
                self.random_state,
            )
        else:
            fit_logistic(
                CSRMatrix(item_features),
                CSRMatrix(user_features),
                interactions.row,
                interactions.col,
                interactions.data,
                sample_weight,
                shuffle_indices,
                lightfm_data,
                self.learning_rate,
                self.item_alpha,
                self.user_alpha,
                num_threads,
            )
817286
def remove_range(self, start, end, callback=None):
        '''
        '''
        N = len(self)
        if start < 0:
            start = max(N + start, 0)
        if start >= N:
            return 0
        if end is None:
            end = N
        elif end < 0:
            end = max(N + end, 0)
        else:
            end = min(end, N)
        if start >= end:
            return 0
        node = self._head
        index = 0
        chain = [None] * self._level
        for i in range(self._level-1, -1, -1):
            while node.next[i] and (index + node.width[i]) <= start:
                index += node.width[i]
                node = node.next[i]
            chain[i] = node
        node = node.next[0]
        initial = self._size
        while node and index < end:
            next = node.next[0]
            self._remove_node(node, chain)
            index += 1
            if callback:
                callback(node.score, node.value)
            node = next
        return initial - self._size
276096
def _remove_soma_initial_point(tree):
    ''''''
    if tree.points[0][COLS.TYPE] == POINT_TYPE.SOMA:
        tree.points = tree.points[1:]
102887
def reset(self):
        
        self._start = 0
        self._first_start = 0
        self._stop = time.perf_counter()
        self._array = None
        self._array_len = 0
        self.intervals = []
        self._intervals_len = 0
781204
def after_epoch(self, **_) -> None:
        
        if not self._total_batch_count_saved:
            self._total_batch_count = self._current_batch_count.copy()
            self._total_batch_count_saved = True
        self._current_batch_count.clear()
        self._current_stream_start = None
        self._current_stream_name = None
        erase_line()
1229619
def set_epoch(self, epoch):
        
        if epoch is None:
            self._epoch = None
            return
        if isinstance(epoch, (Number, Decimal)):
            self._epoch = float(epoch)
        else:
            self._epoch = float(to_gps(epoch))
14504
def on_epoch_end(self, epoch: int, smooth_loss: Tensor, last_metrics: MetricsList, **kwargs: Any) -> bool:
        ""
        last_metrics = ifnone(last_metrics, [])
        stats = [str(stat) if isinstance(stat, int) else '#na#' if stat is None else f'{stat:.6f}'
                 for name, stat in zip(self.learn.recorder.names, [epoch, smooth_loss] + last_metrics)]
        if self.add_time: stats.append(format_time(time() - self.start_epoch))
        str_stats = ','.join(stats)
        self.file.write(str_stats + '\n')
896964
def on_epoch_end(self, epoch:int, num_batch:int, smooth_loss:Tensor,
                     last_metrics=MetricsList, **kwargs:Any)->bool:
        ""
        self.nb_batches.append(num_batch)
        if last_metrics is not None: self.val_losses.append(last_metrics[0])
        else: last_metrics = [] if self.no_val else [None]
        if len(last_metrics) > 1: self.metrics.append(last_metrics[1:])
        self.format_stats([epoch, smooth_loss] + last_metrics)
734323
def start(label, at=None):
    """"""
    t = at if at is not None else time.time()
    marker = Marker().start(t)
    labels[label] = marker.dumps()
930338
function metricStart(ctx) {
	ctx.startTime = Date.now();
	ctx.startHrTime = process.hrtime();
	ctx.duration = 0;

	if (ctx.metrics) {
		const payload = generateMetricPayload(ctx);
		ctx.broker.emit("metrics.trace.span.start", payload);
	}
}
405071
def on_epoch_end(self, **kwargs):
        ""
        for p in (self.learn.model.parameters()):
                if p.requires_grad: p.grad.div_(self.acc_samples)
        if not self.drop_last: self.learn.opt.step()
        self.learn.opt.zero_grad()