class_docstr: The trainer for Segment Sum MLP model.
  
  Parameters
  ----------
  state: State
      The state of the trainer.
  batch_size : int
      The batch size.
  learning rate : float
      The learning rate.
  weight decay : float
      The weight decay.
  num_epoch_full : int
      The number of epochs used in full training.
  num_epoch_incremental : int
      The number of epochs used in incremental training.
  grad_clip_norm: float
      The norm of gradient clipping.
  train_verbose: int
      The verbose frequency for training in batches.
  test_interval: int
      The testing interval in epochs.
  test_split: float
      The fraction of data for testing.
  frozen: bool
      Determine whether to re-train the model or not.
  optimizer: "torch.optim.adam.Adam"
      The optimizer.
  scheduler: "torch.optim.lr_scheduler.StepLR"
      The scheduler.
class_docstr_tok: ["The","trainer","for","Segment","Sum","MLP","model",".","Parameters","--","--","--","--","--","state",":","State","The","state","of","the","trainer",".","batch_size",":","int","The","batch","size",".","learning","rate",":","float","The","learning","rate",".","weight","decay",":","float","The","weight","decay",".","num_epoch_full",":","int","The","number","of","epochs","used","in","full","training",".","num_epoch_incremental",":","int","The","number","of","epochs","used","in","incremental","training",".","grad_clip_norm",":","float","The","norm","of","gradient","clipping",".","train_verbose",":","int","The","verbose","frequency","for","training","in","batches",".","test_interval",":","int","The","testing","interval","in","epochs",".","test_split",":","float","The","fraction","of","data","for","testing",".","frozen",":","bool","Determine","whether","to","re-train","the","model","or","not",".","optimizer",":","``","torch.optim.adam.Adam","''","The","optimizer",".","scheduler",":","``","torch.optim.lr_scheduler.StepLR","''","The","scheduler","."]
docstr: Predicting (validating) on incremental data.
  
  Parameters
  ----------
  features: List[np.ndarray]
      The extracted features.
  results: Optional[np.ndarray]
      The measured results, can be None if used for predicting.
  
  Returns
  -------
  pred_results: np.ndarray
      The predicted results.
docstr_tok: ["Predicting","(","validating",")","on","incremental","data",".","Parameters","--","--","--","--","--","features",":","List","[","np.ndarray","]","The","extracted","features",".","results",":","Optional","[","np.ndarray","]","The","measured","results",",","can","be","None","if","used","for","predicting",".","Returns","--","--","--","-","pred_results",":","np.ndarray","The","predicted","results","."]
code: def predict_incremental(
      self,
      features: List[np.ndarray],
      results: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      """Predicting (validating) on incremental data.
  
      Parameters
      ----------
      features: List[np.ndarray]
          The extracted features.
      results: Optional[np.ndarray]
          The measured results, can be None if used for predicting.
  
      Returns
      -------
      pred_results: np.ndarray
          The predicted results.
      """
      if results is not None:
          results = np.min(results) / results
      loader = SegmentDataLoader(
          features, results, batch_size=self.batch_size, shuffle=False
      )
      self.state.model = self.state.model.to(self.device).eval()
      logger.info("Incremental testing size: %d", len(loader))
      pred_results, losses, scores = [], [], []
      for data in loader:
          (
              pred_results_batch,
              losses_batch,
              scores_batch,
          ) = self.predict_step(data)
          pred_results.append(pred_results_batch)
          losses.append(losses_batch)
          scores.append(scores_batch)
      pred_results = np.concatenate(pred_results)
      if results is not None:
          losses = (
              np.array(losses[:-1]).mean()
              if len(losses) > 1
              else losses[0]
          )
          logger.info(
              "Average test loss: %6f, top1 score: %5f, top5 score: %5f, top10 score: %5f",
              losses,
              np.array(scores)[:, 0].mean(),
              np.array(scores)[:, 1].mean(),
              np.array(scores)[:, 2].mean(),
          )
      return pred_results
  
imports: import glob
  import math
  import os
  import random
  import tempfile
  from collections import OrderedDict
  from itertools import chain
  from typing import Dict, List, NamedTuple, Optional, Tuple
  import numpy
  import torch
  import tvm
  from ...contrib.tar import tar, untar
  from ...runtime import NDArray
  from ...target import Target
  from ..cost_model import PyCostModel
  from ..database import JSONDatabase
  from ..feature_extractor import FeatureExtractor, PerStoreFeature
  from ..logging import get_logger
  from ..runner import RunnerResult
  from ..search_strategy import MeasureCandidate
  from ..tune_context import TuneContext
  from ..utils import derived_object, shash2hex
label_desc: Use image node_id 6 for calling the SegmentSumMLPTrainer obj's underlying member method code with example usage: obj.predict_incremental(features, results) and returns: pred_results