logger class mainly to be used with CMAEvolutionStrategy
Class |
|
data logger for class CMAEvolutionStrategy . |
Class |
|
log an arbitrary number of data (a data row) per "timestep". |
Class |
|
use to fake a Logger in non-verbose setting |
Function | custom |
reduce wasted margin area from 19.0% to 4.0% and make both grids default and |
Function | disp |
displays selected data from (files written by) the class CMADataLogger . |
Function | plot |
plot data from files written by a CMADataLogger , see CMADataLogger.plot . |
Function | plot |
create tar file filename [+ ...] + '.tar.gz' of folder name . |
Function | smartlogygrid |
turn on grid and also minor grid depending on y-limits |
Variable | __author__ |
Undocumented |
Variable | last |
Undocumented |
Variable | last |
Undocumented |
Function | _fix |
minimize space wasted below x=0 |
Function | _monotone |
make x monotone if not iabscissa. |
reduce wasted margin area from 19.0% to 4.0% and make both grids default and
show legend when labels are available.
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 'outcma/cma' 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 |
plot data from files written by a CMADataLogger
, see CMADataLogger.plot
.
cma.plot() plots the data from the default output folder (which is by default always overwritten). cma.plot(name, **argsdict) is a shortcut for cma.CMADataLogger(name).plot(**argsdict).
name
is the filename prefix of the logger, None
evaluates to the
default 'outcmaes/' (hence writing in a subfolder).
The explictly given arguments are for backwards compatibility of their
default setting and may disappear. All arguments are documented in
CMADataLogger.plot
.
create tar file filename [+ ...] + '.tar.gz' of folder name
.
The resulting tar file serves to recreate the current cma.plot
elsewhere.
name
defaults to the folder plotted with cma.plot
by default.
filename
defaults to name
while adding a unique time stamp if
unique
is true.
Return the path of the created file (may be absolute or relative).
Details
This is a convenience replacement for executing tar -czf filename.tar.gz name in a system shell where name defaults to the default plot data folder and filename is created to be unique.
This function calls CMADataLogger.zip
to do the real work.