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 autoencodersave_file (
str) – full save file (path and filename)sess_idx (
int, optional) – session index into data generatordtype (
str, optional) – types of trials to make plot/video with; ‘train’ | ‘val’ | ‘test’conditional (
bool) – conditional vs unconditional samples; for creating reconstruction titlemax_frames (
int, optional) – maximum number of frames to animateframe_rate (
float, optional) – frame rate of saved movien_buffer (
int) – number of blank frames between animated trials if more one are needed to reachmax_framesxtick_locs (
array-like, optional) – tick locations in bin values for plotframe_rate_beh (
float, optional) – behavioral video framerate; to properly relabel xticksformat (
str, optional) – any accepted matplotlib save format, e.g. ‘png’ | ‘pdf’ | ‘jpeg’
- Returns:
matplotlib figure handle if
output_type='plot'oroutput_type='both', else nothing returned (movie is saved)- Return type:
matplotlib.figure.Figure