bsmart.scans.CMAES

Optimisation using CMAES

https://github.com/CyberAgentAILab/cmaes

BSMArt scan written by M. Goodsell

Requires:

pip3 install cmaes

Information

BSMArt Name: CMAES

Requires:
  • cmaes

  • numpy

Settings:

  • Points: Number of points

  • CMAES MaxLoss: Float

  • CMAESEpisodes: Int

  • CMAESPopulationSize: Int

  • CMAESMaxGenerations: Int

  • CMAESMean: Float

  • CMAESSigma: Float

  • Sigma Tolerance: Float

  • Initial Sample: Path to file

class bsmart.scans.CMAES.NewScan(inputs, log)[source]

Bases: Scan

Scanner class for CMAES Scans

get_losses(observables)[source]

Returns a list of losses.

The C-function loss should be zero if the observable is within allowed bounds, and greater than zero outside it.
If we include a validity condition, then other observables, evaluated afterwards, will be returned as NaN.

-> We should assign these the maximum loss ~ 710.

This is then compatible with the explicit use of ‘hierarchical observables’, where all other observables are set to the maximum.

initialise()[source]

method to allow the user scan to overload run settings etc during the initialisation process

postprocess(Point, observables, data_point, temp_dir, log, lock=None)[source]

return the likelihood; we won’t get this far if the point failed to be generated

run()[source]

CMAES scan: just runs CMA-ES. It takes a minus-log-likelihood at the function to minimise. Excellent algorithm for finding best points

smooth_cap_loss(x)[source]

Caps the loss by applying a sigmoid. This is useful for losses that are unbounded.