alp

class Experiment(model=None, metrics=None, verbose=0)[source]

An Experiment trains, predicts, saves and logs a model

Variables:
  • model (model) – the model used in the experiment
  • metrics (list) – a list of callables
fit(data, data_val, model=None, *args, **kwargs)[source]

Build and fit a model given data and hyperparameters

Parameters:
  • data (list(dict)) – a list of dictionnaries mapping inputs and outputs names to numpy arrays for training.
  • data_val (list(dict)) – a list of dictionnaries mapping inputs and outputs names to numpy arrays for validation.
  • model (model, optionnal) – a model from a supported backend
Returns:

the id of the model in the db, the id of the data in the db and path to the parameters.

fit_async(data, data_val, model=None, *args, **kwargs)[source]

Build and fit asynchronously a model given data and hyperparameters

Parameters:
  • data (list(dict)) – a list of dictionnaries mapping inputs and outputs names to numpy arrays for training.
  • data_val (list(dict)) – a list of dictionnaries mapping inputs and outputs names to numpy arrays for validation.
  • model (model, optionnal) – a model from a supported backend
Returns:

the id of the model in the db, the id of the data in the db and a path to the parameters.

fit_gen(gen_train, data_val, model=None, *args, **kwargs)[source]

Build and fit asynchronously a model given data and hyperparameters

Parameters:
  • gen_train (list(dict)) – a list of generators.
  • data_val (list(dict)) – a list of dictionnaries mapping inputs and outputs names to numpy arrays or generators for validation.
  • model (model, optionnal) – a model from a supported backend
Returns:

the id of the model in the db, the id of the data in the db and a path to the parameters.

fit_gen_async(gen_train, data_val, model=None, *args, **kwargs)[source]

Build and fit asynchronously a model given generator(s) and hyperparameters.

Parameters:
  • gen_train (list(dict)) – a list of generators.
  • data_val (list(dict)) – a list of dictionnaries mapping inputs and outputs names to numpy arrays or generators for validation.
  • model (model, optionnal) – a model from a supported backend
Returns:

the id of the model in the db, the id of the data in the db and a path to the parameters.

load_model(mod_id=None, data_id=None)[source]

Load a model from the database form it’s mod_id and data_id

Parameters:
  • mod_id (str) – the id of the model in the database
  • data_id (str) – the id of the data in the database
predict(data, *args, **kwargs)[source]

Make predictions given data

Parameters:data (np.array)
Returns:an np.array of predictions
predict_async(data, *args, **kwargs)[source]

Make predictions given data

Parameters:data (np.array)
Returns:an np.array of predictions

alp.celapp module

Celery config

alp.config module

System Message: WARNING/2 (/home/docs/checkouts/readthedocs.org/user_builds/python-alp/checkouts/latest/docs/reference/alp.rst, line 32)

autodoc: failed to import module u’alp.config’; the following exception was raised: Traceback (most recent call last): File “/home/docs/checkouts/readthedocs.org/user_builds/python-alp/envs/latest/local/lib/python2.7/site-packages/sphinx/ext/autodoc.py”, line 551, in import_object __import__(self.modname) ImportError: No module named config