Model

Model

To integrate the FlockModel abstract base class (ABC) with the FLock SDK while retaining the requirement of input/output as bytes for the model parameters, you may need to make some modifications.

  1. Dataset initialisation:

    • In the FlockModel, the init_dataset method is designed to initialise the dataset from a file path. In FLock, you may need to ensure that the dataset is accessible via the path provided or alternatively, load the dataset through some other means such as an HTTP request if FLock supports that.

  2. Training:

    • In the train method, you're required to accept model parameters as bytes and return the updated model parameters as bytes. In FLock, you might need to create a route (e.g., /train) that accepts a POST request with the model parameters (and possibly the dataset) and returns the updated model parameters.

  3. Evaluation:

    • Similarly, for the evaluate method, create a route (e.g., /evaluate) that accepts a POST request with model parameters and returns the model accuracy.

  4. Aggregation:

    • For the aggregate method, create a route (e.g., /aggregate) that accepts a POST request with a list of model parameters and returns the aggregated model parameters.fe

  5. HTTP and JSON Handling:

    • Since FLock communicates over HTTP using JSON format, you will need to ensure that the byte data is properly encoded/decoded to/from JSON for transmission. This could be done using base64 encoding, which encodes binary data to ASCII string format which can be transmitted in JSON.

Last updated