def disp(name=None, idx=None):
"""displays selected data from (files written by) the class
`CMADataLogger`.
The call ``cma.disp(name, idx)`` is a shortcut for
``cma.CMADataLogger(name).disp(idx)``.
Arguments
---------
`name`
name of the logger, filename prefix, `None` evaluates to
the default ``'outcmaes'``
`idx`
indices corresponding to rows in the data file; by
default the first five, then every 100-th, and the last
10 rows. Too large index values are removed.
The best ever observed iteration is also printed by default.
Examples
--------
::
import cma
from numpy import r_
# assume some data are available from previous runs
cma.disp(None, r_[0, -1]) # first and last
cma.disp(None, r_[0:int(1e9):100, -1]) # every 100-th and last
cma.disp(idx=r_[0, -10:0]) # first and ten last
cma.disp(idx=r_[0:int(1e9):1000, -10:0])
:See also: `CMADataLogger.disp`
"""
return CMADataLogger(name if name else CMADataLogger.default_prefix
).disp(idx)
# END cmaplt.py
评论列表
文章目录