noether.core.writers.prefixed_log_writer

Classes

PrefixedLogWriter

Proxy over LogWriter that prepends a prefix to every logged key.

Module Contents

class noether.core.writers.prefixed_log_writer.PrefixedLogWriter(inner, prefix)

Proxy over LogWriter that prepends a prefix to every logged key.

Used by composite callbacks (e.g. EmaCallback) that run child evaluation callbacks under alternate model weights, so that the child’s metric keys don’t collide with the live-model metrics. All non-logging methods (flush, __enter__/__exit__, etc.) are delegated to the wrapped writer so the underlying cache/history stay consistent.

Parameters:
add_scalar(key, value, logger=None, format_str=None)

Forward to the underlying writer with the key prefixed.

Parameters:
Return type:

None

add_nonscalar(key, value)

Forward to the underlying writer with the key prefixed.

Parameters:
  • key (str)

  • value (Any)

Return type:

None

get_all_metric_values(key)

Look up values under the prefixed key.

Parameters:

key (str)

Return type:

list[float]