Note: Mapping in Polyaxon CE is supported in eager mode only with no concurrency management.

V1Mapping

polyaxon.polyflow.matrix.mapping.V1Mapping(kind='mapping', values=None, concurrency=None, early_stopping=None)

Mapping is a flexible way for dynamically executing a component sequentially or in parallel based on a list of parameter combinations.

  • Args:
    • kind: str, should be equal mapping
    • values: List[Dict]
    • concurrency: int, optional
    • early_stopping: List[EarlyStopping], optional

YAML usage

matrix:
  kind: mapping
  values:
  concurrency:
  earlyStopping:

Python usage

from polyaxon.polyflow import V1Mapping, V1FailureEarlyStopping
mapping = V1Mapping(
    values=[{...}, {...}, ...],
    concurrency=4,
    early_stopping=[V1FailureEarlyStopping(...)]
)

Fields

kind

The kind signals to the CLI, client, and other tools that this matrix is mapping.

If you are using the python client to create the mapping, this field is not required and is set by default.

matrix:
  kind: mapping

values

A List of dictionaries (key/value objects) that will be used to pass those dictionaries as params to each execution.

matrix:
  values:
    - lr: 0.001
      dropout: 0.1
    - lr: 0.01
      dropout: 0.2
    - lr: 0.1
      dropout: 0.3

concurrency

An optional value to set the number of concurrent operations.

This value only makes sense if less or equal to the total number of possible runs.
matrix:
  concurrency: 2

For more details about concurrency management, please check the concurrency section.

earlyStopping

A list of early stopping conditions to check for terminating all operations managed by the pipeline. If one of the early stopping conditions is met, a signal will be sent to terminate all running and pending operations.

matrix:
  earlyStopping: ...

For more details please check the early stopping section.