RAMjET

ramjet.logging.wandb_logger

Code for a logging agent to wandb.

Module Contents

Classes

ExampleRequest A representation of a request for an example.
WandbLoggable An object which is loggable to wandb.
WandbLoggableLightCurve A wandb loggable light curve.
WandbLoggableInjection A wandb loggable containing logging data for injecting a signal into a light curve.
WandbLogger A class to log to wandb.
WandbLoggerCallback A callback for the training loop to call to utilize the wandb logger.
class ExampleRequest[source]

A representation of a request for an example.

class WandbLoggable[source]

Bases: abc.ABC

An object which is loggable to wandb.

log(self, summary_name: str, epoch: int)[source]

Logs self to wandb.

Parameters:
  • summary_name – The name of the summary to use on wandb.
  • epoch – The current epoch to log with.
static log_figure(summary_name: str, figure: plotly.graph_objects.Figure, epoch: int)[source]

Logs a figure to wandb.

Parameters:
  • summary_name – The name of the summary to use on wandb.
  • figure – The figure to be logged.
  • epoch – The current epoch to log with.
class WandbLoggableLightCurve(light_curve_name: str, light_curve: LightCurve)[source]

Bases: ramjet.logging.wandb_logger.WandbLoggable

A wandb loggable light curve.

__init__(self, light_curve_name: str, light_curve: LightCurve)[source]

Initialize self. See help(type(self)) for accurate signature.

log(self, summary_name: str, epoch: int)[source]

Logs self to wandb.

Parameters:
  • summary_name – The name of the summary to use on wandb.
  • epoch – The current epoch to log with.
class WandbLoggableInjection[source]

Bases: ramjet.logging.wandb_logger.WandbLoggable

A wandb loggable containing logging data for injecting a signal into a light curve.

__init__(self)[source]

Initialize self. See help(type(self)) for accurate signature.

log(self, summary_name: str, epoch: int)[source]

Logs self to wandb.

Parameters:
  • summary_name – The name of the summary to use on wandb.
  • epoch – The current epoch to log with.
class WandbLogger[source]

A class to log to wandb.

loggable_types
__init__(self)[source]

Initialize self. See help(type(self)) for accurate signature.

classmethod new(cls, entity: Optional[str] = None, project: Optional[str] = None)[source]

Creates a new logger.

Returns:The logger.
process_py_mapper_example_queues(self, epoch: int)[source]

Processes the example queues, logging the items to wandb.

request_examples_from_py_mapper_processes(self)[source]

Sends requests for examples to the other processes.

create_callback(self)[source]

Creates a callback for the fit loop to call the logger methods.

Returns:The callback.
create_request_queue_for_collection(self, name: str)[source]

Creates a queue to send requests for examples on.

Parameters:name – The name of the queue.
Returns:The queue.
create_example_queue_for_collection(self, name: str)[source]

Creates a queue to receive examples on.

Parameters:name – The name of the queue.
Returns:The queue.
static should_produce_example(request_queue: multiprocess.Queue)[source]

Checks a request queue to see if an example has been requested.

Parameters:request_queue – The request queue.
Returns:Whether an example was requested on the queue.
static submit_loggable(example_queue: multiprocess.Queue, loggable: WandbLoggable)[source]

Submits a loggable to a request queue to be logged by the main process.

Parameters:
  • example_queue – The queue to submit the loggable to.
  • loggable – The loggable to be submitted.
class WandbLoggerCallback(logger: WandbLogger)[source]

Bases: tensorflow.keras.callbacks.Callback

A callback for the training loop to call to utilize the wandb logger.

__init__(self, logger: WandbLogger)[source]
on_epoch_begin(self, epoch, logs=None)[source]

Called at the beginning of an epoch.

on_epoch_end(self, epoch, logs=None)[source]

Called at the end of an epoch.

static is_power(number: int, base: int)[source]

Checks if number is a power of the given base.

Parameters:
  • number – The number.
  • base – The base.
Returns:

Whether the number is a power of the base.