behavenet.plotting¶
Plotting and video documentation.
behavenet.plotting Package¶
Utility functions shared across multiple plotting modules.
Functions¶
|
Concatenate two channels along x or y direction (useful for data with multiple views). |
|
Get crop of image, filling in borders with zeros. |
|
Load all latents as a single array. |
|
Load metrics csv file and return as a pandas dataframe for easy plotting. |
|
Save out matplotlib ArtistAnimation |
behavenet.plotting.ae_utils Module¶
Plotting and video making functions for autoencoders.
Functions¶
Produce movie with original video, reconstructed video, and residual. |
|
|
Produce movie with original video and reconstructed videos. |
behavenet.plotting.cond_ae_utils Module¶
Functions¶
|
Helper function to compute input range for a variety of data types. |
|
Compute min and max of a list of numbers using percentiles. |
|
Return scaled labels (in pixel space) for a given trial. |
|
Return images, latents, and labels for a given trial. |
|
Return reconstructed images created by interpolating through latent/label space. |
|
Return reconstructed images created by interpolating through latent/label space. |
|
Return reconstructed images created by interpolating through multiple points. |
|
Plot list of list of interpolated images output by |
|
Plot list of list of interpolated images output by |
|
Make a latent space interpolation movie. |
|
Make a multi-panel latent space interpolation movie. |
|
Fit classifier model from latent space to session id. |
|
Create training plots for each term in the ps-vae objective function. |
Create a variety of diagnostic plots to assess the ps-vae hyperparameters. |
|
|
Plot labels and their reconstructions from an ps-vae. |
|
Plot video frames representing the traversal of individual dimensions of the latent space. |
|
Create a multi-panel movie with each panel showing traversals of an individual latent dim. |
|
Create training plots for each term in the ps-vae objective function. |
Create a variety of diagnostic plots to assess the msps-vae hyperparameters. |
|
|
Create a multipanel movie, each panel showing reconstruction with different session context. |
behavenet.plotting.arhmm_utils Module¶
Plotting and video making functions for ARHMMs.
Functions¶
|
Find occurences of each discrete state. |
|
Calculate frame count for each state. |
|
Collect data from data generator and put into dictionary with dtypes for keys. |
|
Return arhmm defined in |
|
Present video clips of each individual syllable in separate panels. |
|
Present video clips of each individual syllable in separate panels |
|
Produce movie with (AE) reconstructed video and sampled video. |
|
Produce movie with (AE) reconstructed video and sampled video. |
|
Plot real and sampled latents overlaying real and (potentially sampled) states. |
|
Plot states for a single trial overlaid with latents. |
|
Plot Markov transition matrix for arhmm. |
|
Plot autoregressive dynamics matrices for arhmm. |
|
Plot observation bias vectors for arhmm. |
|
Plot observation covariance matrices for arhmm. |
behavenet.plotting.decoder_utils Module¶
Plotting functions for decoders.
Functions¶
|
For a given session, load R^2 metrics from all decoders defined by hparams. |
|
Find best decoder over l2 regularization and learning rate. |
|
Calculate R^2 across all test trials (rather than on a trial-by-trial basis) |
Produce movie with original video, ae reconstructed video, and neural reconstructed video. |
|
|
Produce movie with original video, ae reconstructed video, and neural reconstructed video. |
Plot ae latents and their neural reconstructions. |
|
|
Plot ae latents and their neural reconstructions. |