glyph.cli package

Submodules

glyph.cli.glyph_remote module

class Communicator(ip, port)[source]

Bases: object

Holds the socket for 0mq communication.

Parameters:
  • ip – ip of the client
  • port – port of the client
connect()[source]
recv(serializer=<module 'json' from '/home/docs/.pyenv/versions/3.6.8/lib/python3.6/json/__init__.py'>)[source]
send(msg, serializer=<module 'json' from '/home/docs/.pyenv/versions/3.6.8/lib/python3.6/json/__init__.py'>)[source]
class EvalQueue(com, result_queue, expect)[source]

Bases: queue.Queue

run(chunk_size=100)[source]
class ExperimentProtocol[source]

Bases: enum.EnumMeta

Communication Protocol with remote experiments.

CONFIG = 'CONFIG'
EXPERIMENT = 'EXPERIMENT'
METADATA = 'METADATA'
SHUTDOWN = 'SHUTDOWN'
class Individual(content)[source]

Bases: glyph.gp.individual.AExpressionTree

Abstract base class for the genotype.

Derived classes need to specify a primitive set from which the expression tree can be build, as well as a phenotype method.

class NDTree(trees)[source]

Bases: glyph.gp.individual.ANDimTree

base

alias of Individual

class RemoteApp(config, gp_runner, checkpoint_file=None, callbacks=(<function make_checkpoint>, <function log>))[source]

Bases: glyph.application.Application

An application based on GPRunner.

Controls execution of the runner and adds checkpointing and logging functionality; also defines a set of available command line options and their default values.

To create a full console application one can use the factory function default_console_app().

Parameters:
  • config (dict or argparse.Namespace) – Container holding all configs
  • gp_runner – Instance of GPRunner
  • checkpoint_file – Path to checkpoint_file
  • callbacks
checkpoint()[source]

Checkpoint current state of evolution.

classmethod from_checkpoint(file_name, com)[source]

Create application from checkpoint file.

run(break_condition=None)[source]

For details see application.Application. Will checkpoint and close zmq connection on keyboard interruption.

class RemoteAssessmentRunner(com, complexity_measure=None, multi_objective=False, method='Nelder-Mead', options={'smart_options': {'use': False}}, caching=True, persistent_caching=None, simplify=False, chunk_size=30, send_symbolic=False, reevaluate=False)[source]

Bases: object

Contains assessment logic. Uses zmq connection to request evaluation.

evaluate_single(individual, *consts, meta=None)[source]

Evaluate a single individual.

measure(individual, meta=None)[source]

Construct fitness for given individual.

predicate(ind)[source]

Does this individual need to be evaluated?

recv

Backwards compatibility

send

Backwards compatibility

update_fitness(population, meta=None)[source]
build_pset_gp(primitives, structural_constants=False, cmin=-1, cmax=1)[source]

Build a primitive set used in remote evaluation.

Locally, all primitives correspond to the id() function.

const_opt_options_transform(options)[source]
get_version_info()[source]
handle_const_opt_config(args)[source]
handle_gpconfig(config, com)[source]

Will try to load config from file or from remote and update the cli/default config accordingly.

log_info(args)[source]
main()[source]
make_callback(factories, args)[source]
make_remote_app(callbacks=(), callback_factories=(), parser=None)[source]
send_meta_data(app)[source]
update_namespace(ns, up)[source]

Update the argparse.Namespace ns with a dictionairy up.

Module contents