export_predictions

behavenet.fitting.eval.export_predictions(data_generator, model, filename=None)[source]

Export decoder predictions using an already initialized data_generator and model.

Predictions are saved based on the model’s hparams dict unless another file is provided. The default filename is [lab_id]_[expt_id]_[animal_id]_[session_id]_predictions.pkl.

This function only supports pytorch decoding models - not autoencoders. To get AE reconstructions see the get_reconstruction function in this module.

Parameters:
  • data_generator (ConcatSessionGenerator object) – data generator to use for latent creation

  • model (NN object) – pytorch model

  • filename (str or NoneType, optional) – absolute path to save latents; if NoneType, latents are stored in model directory

Returns:

list of prediction filenames

Return type:

list