npu.pipeline.state.pipeline_state

Classes

PipelineState(**kwargs)

Exceptions

PipelineStateException([message])

exception npu.pipeline.state.pipeline_state.PipelineStateException(message='')
Author:

Alberto M. Esmoris Pena

Class for exceptions related to the pipeline state. See NAIPSException.

__init__(message='')
class npu.pipeline.state.pipeline_state.PipelineState(**kwargs)
Author:

Alberto M. Esmoris Pena

Abstract class providing the interface for any pipeline state and a common

baseline implementation.

Variables:

step (int) – The step of the pipeline. Typically, it is initialized to zero and updated for each call to the update method.

__init__(**kwargs)

Handle the root-level (most basic) initialization of any pipeline’s state.

Parameters:

kwargs – The attributes for the PipelineState.

update(comp, **kwargs)

Update the pipeline’s state for a given component that has been executed in the pipeline.

Parameters:

comp – The component that has been executed.

Returns:

The updated pipeline state (also updated in place).

prepare_iter(**kwargs)

The logic to prepare an iteration. This method must handle any member attribute that needs to be updated at the beginning of each iteration.

An iteration consists of applying the many steps of the pipeline to one case. For instance, the same sequential pipeline can be used to train models using two different datasets. In this case, the first model will be generated during the first iteration, while the second model will be generated during the second iteration.

The prepare_iter method is necessary to have a pipeline state that does not propagate particularities of the first case to the second, e.g., to avoid considering the last state of the feature names in the first iteration as the initial feature names in the second iteration.

Parameters:

kwargs – The key-word arguments to prepare the iteration.

Returns:

The pipeline state itself is updated and returned.

Return type:

PipelineState