make_neural_reconstruction_movie_wrapper

behavenet.plotting.decoder_utils.make_neural_reconstruction_movie_wrapper(hparams, save_file, trials=None, sess_idx=0, max_frames=400, max_latents=8, zscore_by_dim=False, colored_predictions=False, xtick_locs=None, frame_rate=15)[source]

Produce movie with original video, ae reconstructed video, and neural reconstructed video.

This is a high-level function that loads the model described in the hparams dictionary and produces the necessary predicted video frames. Latent traces are additionally plotted, as well as the residual between the ae reconstruction and the neural reconstruction. Currently produces ae latents and decoder predictions from scratch (rather than saved pickle files).

Parameters:
  • hparams (dict) – needs to contain enough information to specify an autoencoder

  • save_file (str) – full save file (path and filename)

  • trials (int or list, optional) – if NoneType, use first test trial

  • sess_idx (int, optional) – session index into data generator

  • max_frames (int, optional) – maximum number of frames to animate from a trial

  • max_latents (int, optional) – maximum number of ae latents to plot

  • zscore_by_dim (bool, optional) – True to z-score each dim, False to leave relative scales

  • colored_predictions (bool, optional) – False to plot reconstructions in black, True to plot in different colors

  • xtick_locs (array-like, optional) – tick locations in units of bins

  • frame_rate (float, optional) – frame rate of saved movie