Skip to main content

vame.analysis.generative_functions

Variational Animal Motion Embedding 1.0-alpha Toolbox © K. Luxem & P. Bauer, Department of Cellular Neuroscience Leibniz Institute for Neurobiology, Magdeburg, Germany

https://github.com/LINCellularNeuroscience/VAME Licensed under GNU General Public License v3.0

random_generative_samples_motif

def random_generative_samples_motif(cfg: dict, model: torch.nn.Module,
latent_vector: np.ndarray,
labels: np.ndarray,
n_cluster: int) -> None

Generate random samples for motifs.

Arguments:

  • cfg dict - Configuration dictionary.
  • model torch.nn.Module - PyTorch model.
  • latent_vector np.ndarray - Latent vectors.
  • labels np.ndarray - Labels.
  • n_cluster int - Number of clusters.

Returns:

  • None - Plot of generated samples.

random_generative_samples

def random_generative_samples(cfg: dict, model: torch.nn.Module,
latent_vector: np.ndarray) -> None

Generate random generative samples.

Arguments:

  • cfg dict - Configuration dictionary.
  • model torch.nn.Module - PyTorch model.
  • latent_vector np.ndarray - Latent vectors.

Returns:

None

random_reconstruction_samples

def random_reconstruction_samples(cfg: dict, model: torch.nn.Module,
latent_vector: np.ndarray) -> None

Generate random reconstruction samples.

Arguments:

  • cfg dict - Configuration dictionary.
  • model torch.nn.Module - PyTorch model to use.
  • latent_vector np.ndarray - Latent vectors.

Returns:

None

visualize_cluster_center

def visualize_cluster_center(cfg: dict, model: torch.nn.Module,
cluster_center: np.ndarray) -> None

Visualize cluster centers.

Arguments:

  • cfg dict - Configuration dictionary.
  • model torch.nn.Module - PyTorch model.
  • cluster_center np.ndarray - Cluster centers.

Returns:

None

generative_model

@save_state(model=GenerativeModelFunctionSchema)
def generative_model(config: str,
parametrization: Parametrizations,
mode: str = "sampling",
save_logs: bool = False) -> Dict[str, plt.Figure]

Generative model.

Arguments:

  • config str - Path to the configuration file.
  • mode str, optional - Mode for generating samples. Defaults to "sampling".

Returns:

Dict[str, plt.Figure]: Plots of generated samples for each parametrization.