Model Definitions

The model definition is the interface between PEDL and the user’s application framework (e.g., Keras, TensorFlow), in terms of loading training data, describing a model architecture, and specifying the underlying iterative optimization training algorithms.

File Structure

A model definition consists of a directory of files that comprise a Python package. That is, the directory should contain a file at the top-level. When using the standard model definition (see below), the file must expose the Trial implementation and the make_data_loaders() function. cifar10_cnn_pytorch is an example of a directory that contains a model definition.

Since project directories might include large artifacts that should not be packaged as part of the model definition (e.g., data sets or compiled binaries), users can optionally include a .pedlignore file at the top-level that specifies file paths to be omitted from the model definition. The .pedlignore file uses the same syntax as .gitignore. Note that byte-compiled Python files (e.g., .pyc files or __pycache__ directories) are always ignored.

For backward compatibility, PEDL also supports model definitions that consist of a single Python file, in which case creating an file is not necessary.

Model Definition Interfaces

To create a model definition, users should implement the Trial API provided by PEDL. This API returns information about the machine learning task the user wants to perform, like the model architecture to use or the validation metrics that should be computed.

PEDL provides versions of the Trial interface for each of the application frameworks it supports. Specifically, PEDL currently supports five types of Trial interfaces encompassing three application frameworks: