tuner package#

Module contents#

Use this module to work with the EON tuner.

edgeimpulse.experimental.tuner.check_tuner(
timeout_sec=60,
wait_for_completion=True,
) OptimizeStateResponse[source]#

Check the current state of the tuner and optionally waits until the tuner has completed.

Parameters:
  • timeout_sec (int, optional) – The maximum time to wait for the tuner to start trials, in seconds. Defaults to 60.

  • wait_for_completion (bool, optional) – If True, waits for the tuner to complete; if False, returns immediately after checking the tuner state. Defaults to True.

Returns:

The current state of the tuner.

Return type:

OptimizeStateResponse

Raises:

Exception – If the timeout_sec is reached while waiting for trials to start.

edgeimpulse.experimental.tuner.print_tuner_coordinator_logs(limit: int = 500) None[source]#

Retrieve and print logs for the tuner coordinator job.

Returns:

None

edgeimpulse.experimental.tuner.print_tuner_job_logs(limit: int = 500) None[source]#

Retrieve and print logs for the tuner job.

Returns:

None

edgeimpulse.experimental.tuner.set_impulse_from_trial(
trial_id: str,
) StartJobResponse[source]#

Replace the current impulse configuration with the one used by the trial.

Parameters:

trial_id (string) – The trial id

edgeimpulse.experimental.tuner.start_custom_tuner(
config: OptimizeConfig,
) StartJobResponse[source]#

Start a tuner job with custom configuration.

Parameters:

config (OptimizeConfig) – The custom configuration for the tuner job.

Returns:

The response object indicating the status of the job.

Return type:

StartJobResponse

edgeimpulse.experimental.tuner.start_tuner(
target_device: str,
classification_type: str,
dataset_category: str,
target_latency: int,
tuning_max_trials: int | None = None,
name: str | None = None,
) StartJobResponse[source]#

Start the EON tuner with default settings. Use start_custom_tuner to specify config.

Parameters:
  • target_device (str) – The target device for optimization. Use `get_profile_devices() to get the the available devices.

  • classification_type (str) – The type of classification task. Can be any of classification, regression

  • dataset_category (str) – The category of the dataset. Can be any of speech_keyword, speech_continuous, audio_event, audio_continuous, transfer_learning, motion_event, motion_continuous, audio_syntiant

  • target_latency (int) – The target latency for the model in ms.

  • tuning_max_trials (int, optional) – The maximum number of tuning trials. None means let tuner decide. Defaults to None.

  • name (str, optional) – Name to give this run. Default is None.

Returns:

The response containing information about the started job.

Return type:

StartJobResponse

edgeimpulse.experimental.tuner.tuner_report_as_df(
state: OptimizeStateResponse,
)[source]#

Get a tuner trial report dataframe with model metrics and block configuration.

This method needs pandas to be installed.

Generate a dataframe on the tuner trials including used input, model, learn block configuration and model validation metrics.

Parameters:

state (OptimizeStateResponse) – The tuner state containing tuner trials.

Returns:

A DataFrame containing all model parameters and validation metrics.

Return type:

pd.DataFrame