class_docstr: Logs a series of values.
  
  The values are displayed and/or output to the file
  ``<name>-series.txt``.
  
  Example:
  
  .. code-block:: python
  
      mons = MonitorSeries('mon', interval=2)
      for i in range(10):
          mons.add(i, i * 2)
  
  Args:
      name (str): Name of the monitor. Used in the log.
      monitor (~nnabla.monitor.Monitor): Monitor class instance.
      interval (int): Interval of flush the outputs. The values added by
          ``.add()`` are averaged during interval.
      verbose (bool): Output to screen.
class_docstr_tok: ["Logs","a","series","of","values",".","The","values","are","displayed","and\/or","output","to","the","file","``","<","name",">","-series.txt","``",".","Example",":","..","code-block",":",":","python","mons","=","MonitorSeries","(","'mon","'",",","interval=2",")","for","i","in","range","(","10",")",":","mons.add","(","i",",","i","*","2",")","Args",":","name","(","str",")",":","Name","of","the","monitor",".","Used","in","the","log",".","monitor","(","~nnabla.monitor.Monitor",")",":","Monitor","class","instance",".","interval","(","int",")",":","Interval","of","flush","the","outputs",".","The","values","added","by","``",".add","(",")","``","are","averaged","during","interval",".","verbose","(","bool",")",":","Output","to","screen","."]
docstr: Add a value to the series.
  
  Args:
      index (int): Index.
      value (float): Value.
docstr_tok: ["Add","a","value","to","the","series",".","Args",":","index","(","int",")",":","Index",".","value","(","float",")",":","Value","."]
code: def add(self, index, value):
      """Add a value to the series.
  
      Args:
          index (int): Index.
          value (float): Value.
  
      """
      self.buf.append(value)
      if (index - self.flush_at) < self.interval:
          return
      value = np.mean(self.buf)
      if self.verbose:
          logger.info(
              "iter={} {{{}}}={}".format(index, self.name, value)
          )
      if self.sp is not None:
          with open(self.sp, "a") as fd:
              print("{} {:g}".format(index, value), file=fd)
      self.flush_at = index
      self.buf = []
  
imports: from __future__ import print_function
  import numpy
  import os
  import time
  from nnabla.logger import logger
label_desc: Use image node_id 2 for calling the MonitorSeries obj's underlying member method code with example usage: obj.add(index, value) without return types