diff --git a/docs/vame-docs-app/docs/reference/sidebar.json b/docs/vame-docs-app/docs/reference/sidebar.json index 1ffa7cb4..77e66f21 100644 --- a/docs/vame-docs-app/docs/reference/sidebar.json +++ b/docs/vame-docs-app/docs/reference/sidebar.json @@ -7,7 +7,7 @@ "reference/vame/analysis/gif_creator", "reference/vame/analysis/pose_segmentation", "reference/vame/analysis/tree_hierarchy", - "reference/vame/analysis/umap_visualization", + "reference/vame/analysis/umap", "reference/vame/analysis/videowriter" ], "label": "vame.analysis", @@ -50,7 +50,9 @@ "reference/vame/util/align_egocentrical", "reference/vame/util/auxiliary", "reference/vame/util/csv_to_npy", - "reference/vame/util/gif_pose_helper" + "reference/vame/util/data_manipulation", + "reference/vame/util/gif_pose_helper", + "reference/vame/util/model_util" ], "label": "vame.util", "type": "category" diff --git a/docs/vame-docs-app/docs/reference/vame/analysis/community_analysis.md b/docs/vame-docs-app/docs/reference/vame/analysis/community_analysis.md index 3fcaadd4..2da540c8 100644 --- a/docs/vame-docs-app/docs/reference/vame/analysis/community_analysis.md +++ b/docs/vame-docs-app/docs/reference/vame/analysis/community_analysis.md @@ -51,24 +51,6 @@ Compute the transition matrix from the adjacency matrix. - `np.ndarray` - Transition matrix. -#### consecutive - -```python -def consecutive(data: np.ndarray, stepsize: int = 1) -> List[np.ndarray] -``` - -Identifies location of missing motif finding consecutive elements in an array and returns array(s) at the split. - -**Arguments**: - -- `data` _np.ndarray_ - Input array. -- `stepsize` _int, optional_ - Step size. Defaults to 1. - - -**Returns**: - -- `List[np.ndarray]` - List of arrays containing consecutive elements. - #### find\_zero\_labels ```python @@ -197,7 +179,7 @@ Create community bag for given files and labels (Markov chain to tree -> comm #### create\_cohort\_community\_bag ```python -def create_cohort_community_bag(files: List[str], labels: List[np.ndarray], +def create_cohort_community_bag(labels: List[np.ndarray], trans_mat_full: np.ndarray, cut_tree: int, n_cluster: int) -> Tuple ``` @@ -207,7 +189,6 @@ Create cohort community bag for given labels, transition matrix, cut tree, and n **Arguments**: -- `files` _List[str]_ - List of files paths (deprecated). - `labels` _List[np.ndarray]_ - List of label arrays. - `trans_mat_full` _np.ndarray_ - Full transition matrix. - `cut_tree` _int_ - Cut line for tree. @@ -260,59 +241,13 @@ Transform kmeans parameterized latent vector into communities. Get cohort commun - `List[np.ndarray]` - List of cohort community labels for each file. -#### umap\_embedding - -```python -def umap_embedding(cfg: dict, file: str, model_name: str, n_cluster: int, - parametrization: str) -> np.ndarray -``` - -Perform UMAP embedding for given file and parameters. - -**Arguments**: - -- `cfg` _dict_ - Configuration parameters. -- `file` _str_ - File path. -- `model_name` _str_ - Model name. -- `n_cluster` _int_ - Number of clusters. -- `parametrization` _str_ - parametrization. - - -**Returns**: - -- `np.ndarray` - UMAP embedding. - -#### umap\_vis - -```python -def umap_vis(cfg: dict, file: str, embed: np.ndarray, - community_labels_all: np.ndarray, save_path: str | None) -> None -``` - -Create plotly visualizaton of UMAP embedding. - -**Arguments**: - -- `cfg` _dict_ - Configuration parameters. -- `file` _str_ - File path. -- `embed` _np.ndarray_ - UMAP embedding. -- `community_labels_all` _np.ndarray_ - Community labels. -- `save_path` - Path to save the plot. If None it will not save the plot. - - -**Returns**: - - None - #### community ```python @save_state(model=CommunityFunctionSchema) def community(config: str, cohort: bool = True, - show_umap: bool = False, cut_tree: int | None = None, - save_umap_figure: bool = True, save_logs: bool = False) -> None ``` @@ -322,7 +257,6 @@ Perform community analysis. - `config` _str_ - Path to the configuration file. - `cohort` _bool, optional_ - Flag indicating cohort analysis. Defaults to True. -- `show_umap` _bool, optional_ - Flag indicating weather to show UMAP visualization. Defaults to False. - `cut_tree` _int, optional_ - Cut line for tree. Defaults to None. diff --git a/docs/vame-docs-app/docs/reference/vame/analysis/generative_functions.md b/docs/vame-docs-app/docs/reference/vame/analysis/generative_functions.md index 6e6c74a0..1b2d4e08 100644 --- a/docs/vame-docs-app/docs/reference/vame/analysis/generative_functions.md +++ b/docs/vame-docs-app/docs/reference/vame/analysis/generative_functions.md @@ -94,24 +94,6 @@ Visualize cluster centers. None -#### load\_model - -```python -def load_model(cfg: dict, model_name: str) -> torch.nn.Module -``` - -Load PyTorch model. - -**Arguments**: - -- `cfg` _dict_ - Configuration dictionary. -- `model_name` _str_ - Name of the model. - - -**Returns**: - -- `torch.nn.Module` - Loaded PyTorch model. - #### generative\_model ```python diff --git a/docs/vame-docs-app/docs/reference/vame/analysis/pose_segmentation.md b/docs/vame-docs-app/docs/reference/vame/analysis/pose_segmentation.md index 6e367bfc..8a520605 100644 --- a/docs/vame-docs-app/docs/reference/vame/analysis/pose_segmentation.md +++ b/docs/vame-docs-app/docs/reference/vame/analysis/pose_segmentation.md @@ -10,25 +10,6 @@ Leibniz Institute for Neurobiology, Magdeburg, Germany https://github.com/LINCellularNeuroscience/VAME Licensed under GNU General Public License v3.0 -#### load\_model - -```python -def load_model(cfg: dict, model_name: str, fixed: bool) -> RNN_VAE -``` - -Load the VAME model. - -**Arguments**: - -- `cfg` _dict_ - Configuration dictionary. -- `model_name` _str_ - Name of the model. -- `fixed` _bool_ - Fixed or variable length sequences. - - -**Returns**: - -- `RNN_VAE` - Loaded VAME model. - #### embedd\_latent\_vectors ```python @@ -52,24 +33,6 @@ Embed latent vectors for the given files using the VAME model. - `List[np.ndarray]` - List of latent vectors for each file. -#### consecutive - -```python -def consecutive(data: np.ndarray, stepsize: int = 1) -> List[np.ndarray] -``` - -Find consecutive sequences in the data array. - -**Arguments**: - -- `data` _np.ndarray_ - Input array. -- `stepsize` _int, optional_ - Step size. Defaults to 1. - - -**Returns**: - -- `List[np.ndarray]` - List of consecutive sequences. - #### get\_motif\_usage ```python diff --git a/docs/vame-docs-app/docs/reference/vame/analysis/tree_hierarchy.md b/docs/vame-docs-app/docs/reference/vame/analysis/tree_hierarchy.md index ae916062..30d39816 100644 --- a/docs/vame-docs-app/docs/reference/vame/analysis/tree_hierarchy.md +++ b/docs/vame-docs-app/docs/reference/vame/analysis/tree_hierarchy.md @@ -109,42 +109,6 @@ Draw a tree. None -#### traverse\_tree - -```python -def traverse_tree(T: nx.Graph, root_node: str | None = None) -> str -``` - -Traverse a tree and return the traversal sequence. - -**Arguments**: - -- `T` _nx.Graph_ - The tree to be traversed. -- `root_node` _str, optional_ - The root node of the tree. If None, traversal starts from the root. - - -**Returns**: - -- `str` - The traversal sequence. - -#### traverse\_tree - -```python -def traverse_tree(T: nx.Graph, root_node: str | None = None) -> str -``` - -Traverse a tree and return the traversal sequence. - -**Arguments**: - -- `T` _nx.Graph_ - The tree to be traversed. -- `root_node` _str, optional_ - The root node of the tree. If None, traversal starts from the root. - - -**Returns**: - -- `str` - The traversal sequence. - #### traverse\_tree\_cutline ```python diff --git a/docs/vame-docs-app/docs/reference/vame/analysis/umap.md b/docs/vame-docs-app/docs/reference/vame/analysis/umap.md new file mode 100644 index 00000000..2571e693 --- /dev/null +++ b/docs/vame-docs-app/docs/reference/vame/analysis/umap.md @@ -0,0 +1,136 @@ +--- +sidebar_label: umap +title: vame.analysis.umap +--- + +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 + +#### umap\_embedding + +```python +def umap_embedding(cfg: dict, file: str, model_name: str, n_cluster: int, + parametrization: str) -> np.ndarray +``` + +Perform UMAP embedding for given file and parameters. + +**Arguments**: + +- `cfg` _dict_ - Configuration parameters. +- `file` _str_ - File path. +- `model_name` _str_ - Model name. +- `n_cluster` _int_ - Number of clusters. +- `parametrization` _str_ - parametrization. + + +**Returns**: + +- `np.ndarray` - UMAP embedding. + +#### umap\_vis\_community\_labels + +```python +def umap_vis_community_labels(cfg: dict, embed: np.ndarray, + community_labels_all: np.ndarray, + save_path: str | None) -> None +``` + +Create plotly visualizaton of UMAP embedding with community labels. + +**Arguments**: + +- `cfg` _dict_ - Configuration parameters. +- `embed` _np.ndarray_ - UMAP embedding. +- `community_labels_all` _np.ndarray_ - Community labels. +- `save_path` - Path to save the plot. If None it will not save the plot. + + +**Returns**: + + None + +#### umap\_vis + +```python +def umap_vis(embed: np.ndarray, num_points: int) -> None +``` + +Visualize UMAP embedding without labels. + +**Arguments**: + +- `embed` _np.ndarray_ - UMAP embedding. +- `num_points` _int_ - Number of data points to visualize. + + +**Returns**: + + None - Plot Visualization of UMAP embedding. + +#### umap\_label\_vis + +```python +def umap_label_vis(embed: np.ndarray, label: np.ndarray, n_cluster: int, + num_points: int) -> None +``` + +Visualize UMAP embedding with motif labels. + +**Arguments**: + +- `embed` _np.ndarray_ - UMAP embedding. +- `label` _np.ndarray_ - Motif labels. +- `n_cluster` _int_ - Number of clusters. +- `num_points` _int_ - Number of data points to visualize. + + +**Returns**: + + fig - Plot figure of UMAP visualization embedding with motif labels. + +#### umap\_vis\_comm + +```python +def umap_vis_comm(embed: np.ndarray, community_label: np.ndarray, + num_points: int) -> None +``` + +Visualize UMAP embedding with community labels. + +**Arguments**: + +- `embed` _np.ndarray_ - UMAP embedding. +- `community_label` _np.ndarray_ - Community labels. +- `num_points` _int_ - Number of data points to visualize. + + +**Returns**: + + fig - Plot figure of UMAP visualization embedding with community labels. + +#### visualization + +```python +@save_state(model=VisualizationFunctionSchema) +def visualization(config: Union[str, Path], + label: Optional[str] = None, + save_logs: bool = False) -> None +``` + +Visualize UMAP embeddings based on configuration settings. + +**Arguments**: + +- `config` _Union[str, Path]_ - Path to the configuration file. +- `label` _str, optional_ - Type of labels to visualize. Default is None. + + +**Returns**: + + None - Plot Visualization of UMAP embeddings. + diff --git a/docs/vame-docs-app/docs/reference/vame/model/create_training.md b/docs/vame-docs-app/docs/reference/vame/model/create_training.md index 2ad64049..707a7c1e 100644 --- a/docs/vame-docs-app/docs/reference/vame/model/create_training.md +++ b/docs/vame-docs-app/docs/reference/vame/model/create_training.md @@ -10,52 +10,11 @@ Leibniz Institute for Neurobiology, Magdeburg, Germany https://github.com/LINCellularNeuroscience/VAME Licensed under GNU General Public License v3.0 -#### nan\_helper - -```python -def nan_helper(y: np.ndarray) -> Tuple -``` - -Identifies indices of NaN values in an array and provides a function to convert them to non-NaN indices. - -**Arguments**: - -- `y` _np.ndarray_ - Input array containing NaN values. - - -**Returns**: - - Tuple[np.ndarray, Union[np.ndarray, None]]: A tuple containing two elements: - - An array of boolean values indicating the positions of NaN values. - - A lambda function to convert NaN indices to non-NaN indices. - -#### interpol - -```python -def interpol(arr: np.ndarray) -> np.ndarray -``` - -Interpolates all NaN values in the given array. - -**Arguments**: - -- `arr` _np.ndarray_ - Input array containing NaN values. - - -**Returns**: - -- `np.ndarray` - Array with NaN values replaced by interpolated values. - #### plot\_check\_parameter ```python -def plot_check_parameter(cfg: dict, - iqr_val: float, - num_frames: int, - X_true: List[np.ndarray], - X_med: np.ndarray, - anchor_1: int | None = None, - anchor_2: int | None = None) -> None +def plot_check_parameter(cfg: dict, iqr_val: float, num_frames: int, + X_true: List[np.ndarray], X_med: np.ndarray) -> None ``` Plot the check parameter - z-scored data and the filtered data. @@ -79,8 +38,7 @@ Plot the check parameter - z-scored data and the filtered data. ```python def traindata_aligned(cfg: dict, files: List[str], testfraction: float, - num_features: int, savgol_filter: bool, - check_parameter: bool) -> None + savgol_filter: bool, check_parameter: bool) -> None ``` Create training dataset for aligned data. diff --git a/docs/vame-docs-app/docs/reference/vame/model/rnn_model.md b/docs/vame-docs-app/docs/reference/vame/model/rnn_model.md index b8672377..b74d1e80 100644 --- a/docs/vame-docs-app/docs/reference/vame/model/rnn_model.md +++ b/docs/vame-docs-app/docs/reference/vame/model/rnn_model.md @@ -65,8 +65,7 @@ Lambda module for computing the latent space parameters. #### \_\_init\_\_ ```python -def __init__(ZDIMS: int, hidden_size_layer_1: int, hidden_size_layer_2: int, - softplus: bool) +def __init__(ZDIMS: int, hidden_size_layer_1: int, softplus: bool) ``` Initialize the Lambda module. diff --git a/docs/vame-docs-app/docs/reference/vame/model/rnn_vae.md b/docs/vame-docs-app/docs/reference/vame/model/rnn_vae.md index fb357f87..8a5624c8 100644 --- a/docs/vame-docs-app/docs/reference/vame/model/rnn_vae.md +++ b/docs/vame-docs-app/docs/reference/vame/model/rnn_vae.md @@ -181,10 +181,10 @@ Train the model. #### test ```python -def test(test_loader: Data.DataLoader, epoch: int, model: nn.Module, - optimizer: torch.optim.Optimizer, BETA: float, kl_weight: float, - seq_len: int, mse_red: str, kloss: str, klmbda: float, - future_decoder: bool, bsize: int) -> Tuple[float, float, float] +def test(test_loader: Data.DataLoader, model: nn.Module, BETA: float, + kl_weight: float, seq_len: int, mse_red: str, kloss: str, + klmbda: float, future_decoder: bool, + bsize: int) -> Tuple[float, float, float] ``` Evaluate the model on the test dataset. diff --git a/docs/vame-docs-app/docs/reference/vame/util/align_egocentrical.md b/docs/vame-docs-app/docs/reference/vame/util/align_egocentrical.md index c0257019..d5a9409a 100644 --- a/docs/vame-docs-app/docs/reference/vame/util/align_egocentrical.md +++ b/docs/vame-docs-app/docs/reference/vame/util/align_egocentrical.md @@ -10,85 +10,6 @@ Leibniz Institute for Neurobiology, Magdeburg, Germany https://github.com/LINCellularNeuroscience/VAME Licensed under GNU General Public License v3.0 -#### crop\_and\_flip - -```python -def crop_and_flip( - rect: Tuple, src: np.ndarray, points: List[np.ndarray], - ref_index: Tuple[int, int]) -> Tuple[np.ndarray, List[np.ndarray]] -``` - -Crop and flip the image based on the given rectangle and points. - -**Arguments**: - -- `rect` _Tuple_ - Rectangle coordinates (center, size, theta). -- `src` _np.ndarray_ - Source image. -- `points` _List[np.ndarray]_ - List of points. -- `ref_index` _Tuple[int, int]_ - Reference indices for alignment. - - -**Returns**: - - Tuple[np.ndarray, List[np.ndarray]]: Cropped and flipped image, and shifted points. - -#### nan\_helper - -```python -def nan_helper(y: np.ndarray) -> Tuple[np.ndarray, np.ndarray] -``` - -Helper function to identify NaN values in an array. - -**Arguments**: - -- `y` _np.ndarray_ - Input array. - - -**Returns**: - - Tuple[np.ndarray, np.ndarray]: Boolean mask for NaN values and function to interpolate them. - -#### interpol - -```python -def interpol(arr: np.ndarray) -> np.ndarray -``` - -Interpolates NaN values in the given array. - -**Arguments**: - -- `arr` _np.ndarray_ - Input array. - - -**Returns**: - -- `np.ndarray` - Array with interpolated NaN values. - -#### background - -```python -def background(path_to_file: str, - filename: str, - video_format: str = '.mp4', - num_frames: int = 1000) -> np.ndarray -``` - -Compute the background image from a fixed camera. - -**Arguments**: - -- `path_to_file` _str_ - Path to the file directory. -- `filename` _str_ - Name of the video file without the format. -- `video_format` _str, optional_ - Format of the video file. Defaults to '.mp4'. -- `num_frames` _int, optional_ - Number of frames to use for background computation. Defaults to 1000. - - -**Returns**: - -- `np.ndarray` - Background image. - #### align\_mouse ```python diff --git a/docs/vame-docs-app/docs/reference/vame/util/csv_to_npy.md b/docs/vame-docs-app/docs/reference/vame/util/csv_to_npy.md index 6e914d9f..1e0c0cd7 100644 --- a/docs/vame-docs-app/docs/reference/vame/util/csv_to_npy.md +++ b/docs/vame-docs-app/docs/reference/vame/util/csv_to_npy.md @@ -10,42 +10,6 @@ Leibniz Institute for Neurobiology, Magdeburg, Germany https://github.com/LINCellularNeuroscience/VAME Licensed under GNU General Public License v3.0 -#### nan\_helper - -```python -def nan_helper(y: np.ndarray) -> Tuple -``` - -Identifies indices of NaN values in an array and provides a function to convert them to non-NaN indices. - -**Arguments**: - -- `y` _np.ndarray_ - Input array containing NaN values. - - -**Returns**: - - Tuple[np.ndarray, Union[np.ndarray, None]]: A tuple containing two elements: - - An array of boolean values indicating the positions of NaN values. - - A lambda function to convert NaN indices to non-NaN indices. - -#### interpol - -```python -def interpol(arr: np.ndarray) -> np.ndarray -``` - -Interpolates all NaN values of a given array. - -**Arguments**: - -- `arr` _np.ndarray_ - A numpy array with NaN values. - - -**Returns**: - -- `np.ndarray` - A numpy array with interpolated NaN values. - #### csv\_to\_numpy ```python diff --git a/docs/vame-docs-app/docs/reference/vame/util/data_manipulation.md b/docs/vame-docs-app/docs/reference/vame/util/data_manipulation.md new file mode 100644 index 00000000..2285c51e --- /dev/null +++ b/docs/vame-docs-app/docs/reference/vame/util/data_manipulation.md @@ -0,0 +1,122 @@ +--- +sidebar_label: data_manipulation +title: vame.util.data_manipulation +--- + +#### consecutive + +```python +def consecutive(data: np.ndarray, stepsize: int = 1) -> List[np.ndarray] +``` + +Find consecutive sequences in the data array. + +**Arguments**: + +- `data` _np.ndarray_ - Input array. +- `stepsize` _int, optional_ - Step size. Defaults to 1. + + +**Returns**: + +- `List[np.ndarray]` - List of consecutive sequences. + +#### nan\_helper + +```python +def nan_helper(y: np.ndarray) -> Tuple +``` + +Identifies indices of NaN values in an array and provides a function to convert them to non-NaN indices. + +**Arguments**: + +- `y` _np.ndarray_ - Input array containing NaN values. + + +**Returns**: + + Tuple[np.ndarray, Union[np.ndarray, None]]: A tuple containing two elements: + - An array of boolean values indicating the positions of NaN values. + - A lambda function to convert NaN indices to non-NaN indices. + +#### interpol\_all\_nans + +```python +def interpol_all_nans(arr: np.ndarray) -> np.ndarray +``` + +Interpolates all NaN values in the given array. + +**Arguments**: + +- `arr` _np.ndarray_ - Input array containing NaN values. + + +**Returns**: + +- `np.ndarray` - Array with NaN values replaced by interpolated values. + +#### interpol\_first\_rows\_nans + +```python +def interpol_first_rows_nans(arr: np.ndarray) -> np.ndarray +``` + +Interpolates NaN values in the given array. + +**Arguments**: + +- `arr` _np.ndarray_ - Input array with NaN values. + + +**Returns**: + +- `np.ndarray` - Array with interpolated NaN values. + +#### crop\_and\_flip + +```python +def crop_and_flip( + rect: Tuple, src: np.ndarray, points: List[np.ndarray], + ref_index: Tuple[int, int]) -> Tuple[np.ndarray, List[np.ndarray]] +``` + +Crop and flip the image based on the given rectangle and points. + +**Arguments**: + +- `rect` _Tuple_ - Rectangle coordinates (center, size, theta). +- `src` _np.ndarray_ - Source image. +- `points` _List[np.ndarray]_ - List of points. +- `ref_index` _Tuple[int, int]_ - Reference indices for alignment. + + +**Returns**: + + Tuple[np.ndarray, List[np.ndarray]]: Cropped and flipped image, and shifted points. + +#### background + +```python +def background(path_to_file: str, + filename: str, + file_format: str = '.mp4', + num_frames: int = 1000, + save_background: bool = True) -> np.ndarray +``` + +Compute background image from fixed camera. + +**Arguments**: + +- `path_to_file` _str_ - Path to the directory containing the video files. +- `filename` _str_ - Name of the video file. +- `file_format` _str, optional_ - Format of the video file. Defaults to '.mp4'. +- `num_frames` _int, optional_ - Number of frames to use for background computation. Defaults to 1000. + + +**Returns**: + +- `np.ndarray` - Background image. + diff --git a/docs/vame-docs-app/docs/reference/vame/util/gif_pose_helper.md b/docs/vame-docs-app/docs/reference/vame/util/gif_pose_helper.md index 36481296..9811fd4c 100644 --- a/docs/vame-docs-app/docs/reference/vame/util/gif_pose_helper.md +++ b/docs/vame-docs-app/docs/reference/vame/util/gif_pose_helper.md @@ -10,84 +10,6 @@ Leibniz Institute for Neurobiology, Magdeburg, Germany https://github.com/LINCellularNeuroscience/VAME Licensed under GNU General Public License v3.0 -#### crop\_and\_flip - -```python -def crop_and_flip(rect: tuple, src: np.ndarray, points: list, - ref_index: list) -> tuple -``` - -Crop and flip an image based on a rectangle and reference points. - -**Arguments**: - -- `rect` _tuple_ - Tuple containing rectangle information (center, size, angle). -- `src` _np.ndarray_ - Source image to crop and flip. -- `points` _list_ - List of points to be aligned. -- `ref_index` _list_ - Reference indices for alignment. - - -**Returns**: - -- `tuple` - Cropped and flipped image, shifted points. - -#### background - -```python -def background(path_to_file: str, - filename: str, - file_format: str = '.mp4', - num_frames: int = 100) -> np.ndarray -``` - -Compute background image from fixed camera. - -**Arguments**: - -- `path_to_file` _str_ - Path to the directory containing the video files. -- `filename` _str_ - Name of the video file. -- `file_format` _str, optional_ - Format of the video file. Defaults to '.mp4'. -- `num_frames` _int, optional_ - Number of frames to use for background computation. Defaults to 1000. - - -**Returns**: - -- `np.ndarray` - Background image. - -#### nan\_helper - -```python -def nan_helper(y: np.ndarray) -> tuple -``` - -Helper function to find indices of NaN values. - -**Arguments**: - -- `y` _np.ndarray_ - Input array. - - -**Returns**: - -- `tuple` - Indices of NaN values. - -#### interpol - -```python -def interpol(arr: np.ndarray) -> np.ndarray -``` - -Interpolates NaN values in the given array. - -**Arguments**: - -- `arr` _np.ndarray_ - Input array with NaN values. - - -**Returns**: - -- `np.ndarray` - Array with interpolated NaN values. - #### get\_animal\_frames ```python diff --git a/docs/vame-docs-app/docs/reference/vame/util/model_util.md b/docs/vame-docs-app/docs/reference/vame/util/model_util.md new file mode 100644 index 00000000..7e5dd81c --- /dev/null +++ b/docs/vame-docs-app/docs/reference/vame/util/model_util.md @@ -0,0 +1,24 @@ +--- +sidebar_label: model_util +title: vame.util.model_util +--- + +#### load\_model + +```python +def load_model(cfg: dict, model_name: str, fixed: bool = True) -> RNN_VAE +``` + +Load the VAME model. + +**Arguments**: + +- `cfg` _dict_ - Configuration dictionary. +- `model_name` _str_ - Name of the model. +- `fixed` _bool_ - Fixed or variable length sequences. + + +**Returns**: + +- `RNN_VAE` - Loaded VAME model. +