Skip to main content

vame.model.evaluate

Variational Animal Motion Embedding 0.1 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

plot_reconstruction

def plot_reconstruction(filepath: str,
test_loader: Data.DataLoader,
seq_len_half: int,
model: RNN_VAE,
model_name: str,
FUTURE_DECODER: bool,
FUTURE_STEPS: int,
suffix: Optional[str] = None) -> None

Plot the reconstruction and future prediction of the input sequence.

Arguments:

  • filepath str - Path to save the plot.
  • test_loader Data.DataLoader - DataLoader for the test dataset.
  • seq_len_half int - Half of the temporal window size.
  • model RNN_VAE - Trained VAE model.
  • model_name str - Name of the model.
  • FUTURE_DECODER bool - Flag indicating whether the model has a future prediction decoder.
  • FUTURE_STEPS int - Number of future steps to predict.
  • suffix Optional[str], optional - Suffix for the saved plot filename. Defaults to None.

plot_loss

def plot_loss(cfg: dict, filepath: str, model_name: str) -> None

Plot the losses of the trained model.

Arguments:

  • cfg dict - Configuration dictionary.
  • filepath str - Path to save the plot.
  • model_name str - Name of the model.

eval_temporal

def eval_temporal(cfg: dict,
use_gpu: bool,
model_name: str,
fixed: bool,
snapshot: Optional[str] = None,
suffix: Optional[str] = None) -> None

Evaluate the temporal aspects of the trained model.

Arguments:

  • cfg dict - Configuration dictionary.
  • use_gpu bool - Flag indicating whether to use GPU for evaluation.
  • model_name str - Name of the model.
  • fixed bool - Flag indicating whether the data is fixed or not.
  • snapshot Optional[str], optional - Path to the model snapshot. Defaults to None.
  • suffix Optional[str], optional - Suffix for the saved plot filename. Defaults to None.

evaluate_model

@save_state(model=EvaluateModelFunctionSchema)
def evaluate_model(config: str,
use_snapshots: bool = False,
save_logs: bool = False) -> None

Evaluate the trained model.

Arguments:

  • config str - Path to config file.
  • use_snapshots bool, optional - Whether to plot for all snapshots or only the best model. Defaults to False.