interpolate_point_path¶
- behavenet.plotting.cond_ae_utils.interpolate_point_path(interp_type, model, ims_0, labels_0, points, n_frames=10, ch=0, crop_kwargs=None, apply_inverse_transform=True)[source]¶
Return reconstructed images created by interpolating through multiple points.
This function is a simplified version of
interpolate_1d(); this function computes a traversal for a single dimension instead of all dimensions; also, this function does not support conditional encoders, nor does it attempt to compute the interpolated, scaled values of the labels asinterpolate_1d()does. This function should supercedeinterpolate_1d()in a future refactor. Also note that this function is utilized by the code to make traversal movies, whereasinterpolate_1d()is utilized by the code to make traversal plots.- Parameters:
interp_type (
str) – ‘latents’ | ‘labels’model (
behavenet.modelsobject) – autoencoder modelims_0 (
np.ndarray) – base images for interpolating labels, of shape (1, n_channels, y_pix, x_pix)labels_0 (
np.ndarray) – base labels of shape (1, n_labels); these values will be used if interp_type=’latents’, and they will be ignored if inter_type=’labels’ (since points will be used)points (
list) – one entry for each point in path; each entry is an np.ndarray of shape (n_latents,)n_frames (
intorarray-like) – number of interpolation points between each point; can be an integer that is used for all paths, or an array/list of length one less than number of pointsch (
int, optional) – specify which channel of input images to return; if not an int, all channels are concatenated in the horizontal dimensioncrop_kwargs (
dict, optional) – if crop_type is not None, provides information about the crop (for a fixed crop window) keys : ‘y_0’, ‘x_0’, ‘y_ext’, ‘x_ext’; window is (y_0 - y_ext, y_0 + y_ext) in vertical direction and (x_0 - x_ext, x_0 + x_ext) in horizontal directionapply_inverse_transform (
bool) – if inputs are latents (and model class is ‘cond-ae-msp’ or ‘ps-vae’), apply inverse transform to put in original latent space
- Returns:
ims_list (
listofnp.ndarray) interpolated imagesinputs_list (
listofnp.ndarray) interpolated values
- Return type:
tuple