FastAI.jl icon indicating copy to clipboard operation
FastAI.jl copied to clipboard

Interface tests

Open lorenzoh opened this issue 3 years ago • 0 comments

This adds interface tests to various interfaces in FastAI.jl. This allows

  • giving user-friendly error messages by performing checks in high-level functions
  • giving help when implementing an interface, and providing tests for implementations

Examples

Blocks

is_block(block, obs) checks that a piece of data is a valid observation for a Block:

image

When data is not valid, you get detailed information on the reason why:

image

This is extensible for custom Block types. Since tuples of blocks are also valid blocks, we can check them, too:

image

Data containers

is_data(data) checks that data implements MLUtils.jl's data container interface.

image

When that is not the case, precise errors are given indicating which parts are not implemented:

image

is_data(data, block) additionally checks that the observations in the data container are valid for a Block:

image

Status

This depends on Invariants.jl which still needs to be released.

lorenzoh avatar May 31 '22 11:05 lorenzoh