common¶

Common components shared between server and client.

Functions

array_from_numpy(ndarray)

Create Array from NumPy ndarray.

bytes_to_ndarray(tensor)

Deserialize NumPy ndarray from bytes.

configure(identifier[, filename, host])

Configure logging to file and/or remote log server.

event(event_type[, event_details])

Submit create_event to ThreadPoolExecutor to avoid blocking.

log(level, msg, *args, **kwargs)

Log 'msg % args' with the integer severity 'level'.

ndarray_to_bytes(ndarray)

Serialize NumPy ndarray to bytes.

ndarrays_to_parameters(ndarrays)

Convert NumPy ndarrays to parameters object.

now()

Construct a datetime from time.time() with time zone set to UTC.

parameters_to_ndarrays(parameters)

Convert parameters object to NumPy ndarrays.

Classes

Array(dtype, shape, stype, data)

Array type.

ClientMessage([get_properties_res, ...])

ClientMessage is a container used to hold one result message.

Code(value)

Client status codes.

Config

alias of dict[str, bool | bytes | float | int | str]

ConfigsRecord([configs_dict, keep_input])

Configs record.

Context(run_id, node_id, node_config, state, ...)

Context of your run.

DisconnectRes(reason)

DisconnectRes message from client to server.

Error(code[, reason])

A dataclass that stores information about an error that occurred.

EvaluateIns(parameters, config)

Evaluate instructions for a client.

EvaluateRes(status, loss, num_examples, metrics)

Evaluate response from a client.

EventType(value)

Types of telemetry events.

FitIns(parameters, config)

Fit instructions for a client.

FitRes(status, parameters, num_examples, metrics)

Fit response from a client.

GetParametersIns(config)

Parameters request for a client.

GetParametersRes(status, parameters)

Response when asked to return parameters.

GetPropertiesIns(config)

Properties request for a client.

GetPropertiesRes(status, properties)

Properties response from a client.

Message(metadata[, content, error])

State of your application from the viewpoint of the entity using it.

MessageType()

Message type.

MessageTypeLegacy()

Legacy message type.

Metadata(run_id, message_id, src_node_id, ...)

A dataclass holding metadata associated with the current message.

Metrics

alias of dict[str, bool | bytes | float | int | str]

MetricsRecord([metrics_dict, keep_input])

Metrics recod.

NDArray

alias of ndarray[Any, dtype[Any]]

NDArrays

alias of list[ndarray[Any, dtype[Any]]]

Parameters(tensors, tensor_type)

Model parameters.

ParametersRecord([array_dict, keep_input])

Parameters record.

Properties

alias of dict[str, bool | bytes | float | int | str]

ReconnectIns(seconds)

ReconnectIns message from server to client.

RecordSet([parameters_records, ...])

RecordSet stores groups of parameters, metrics and configs.

ServerMessage([get_properties_ins, ...])

ServerMessage is a container used to hold one instruction message.

Status(code, message)

Client status.