real_vs_sampled_wrapper

behavenet.plotting.arhmm_utils.real_vs_sampled_wrapper(output_type, hparams, save_file, sess_idx, dtype='test', conditional=True, max_frames=400, frame_rate=20, n_buffer=5, xtick_locs=None, frame_rate_beh=None, format='png')[source]

Produce movie with (AE) reconstructed video and sampled video.

This is a high-level function that loads the model described in the hparams dictionary and produces the necessary state sequences/samples. The sampled video can be completely unconditional (states and latents are sampled) or conditioned on the most likely state sequence.

Parameters:
  • output_type (str) – ‘plot’ | ‘movie’ | ‘both’

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

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

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

  • dtype (str, optional) – types of trials to make plot/video with; ‘train’ | ‘val’ | ‘test’

  • conditional (bool) – conditional vs unconditional samples; for creating reconstruction title

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

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

  • n_buffer (int) – number of blank frames between animated trials if more one are needed to reach max_frames

  • xtick_locs (array-like, optional) – tick locations in bin values for plot

  • frame_rate_beh (float, optional) – behavioral video framerate; to properly relabel xticks

  • format (str, optional) – any accepted matplotlib save format, e.g. ‘png’ | ‘pdf’ | ‘jpeg’

Returns:

matplotlib figure handle if output_type='plot' or output_type='both', else nothing returned (movie is saved)

Return type:

matplotlib.figure.Figure