set_input

code_loader.leap_binder.set_input

The leap_binder.set_input binding function points to Input Encoder and name for reference.

code_loader.leap_binder.set_input(
    function=Callable[[int, PreprocessResponse], np.ndarray]
    name=str
)
Args

function

(Callable) This parameter points to the Input Encoder function mentioned above.

name

(str) with the given name of the input, e.g. image.

Examples

Basic Usage

from code_loader import leap_binder
from code_loader.contract.datasetclasses import PreprocessResponse
from code_loader.contract.enums import DatasetInputType

...
def image_input_encoder(idx: int, subset: PreprocessResponse) -> np.ndarray:
    return subset.data.iloc[idx]['image'].astype('float32')

leap_binder.set_input(
    function=image_input_encoder,
    input_name='image'
)

Usage within the full script can be found at Dataset Script.

Guides

Full examples can be found at the Dataset Integration section of the following guides:

Last updated