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, |
| Function | plot |
create tar file filename [+ ...] + '.tar.gz' of folder name. |
| Function | seconds2str |
return *d**h** or *h** or *m**s or *.*sec |
| Function | smartlogygrid |
turn on grid and also minor grid depending on y-limits |
| Variable | __author__ |
Undocumented |
| Variable | clip |
plot option, sometimes True is useful to get a good frame |
| Variable | cma |
iterable of variable indices or last index which will be annotated |
| Variable | cma |
number of variables above annotations are omitted |
| Variable | corr |
plot format string to plot correlation in plot_divers, was 'c', could be 'gray' or 'C5' or '#008000' or '.--c', '' means to plot nothing |
| Variable | last |
Undocumented |
| Variable | last |
Undocumented |
| Function | _fix |
minimize space wasted below x=0 |
| Function | _id |
Undocumented |
| Function | _monotone |
make x monotone if not iabscissa. |
| Function | _remove |
remove trailing sequence repeatedly |
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,
Noneevaluates 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 cma.CMADataLogger.plot to see all valid keyword arguments.
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.
iterable of variable indices or last index which will be annotated
plot format string to plot correlation in plot_divers, was 'c', could be 'gray'
or 'C5' or '#008000' or '.--c', '' means to plot nothing