API Reference#
This section documents the vak API.
Command Line Interface#
The vak.cli
module implements the vak command line interface.
Function called by command-line interface for prep command |
|
Commands#
These high-level functions correspond to commands in the commmand-line interface. The commands are to prepare datasets, train and evaluate models, and generate predictions from trained models.
Prep#
Functions for preparing a dataset for neural network models from a dataset of spectrograms. |
|
Constants used by |
|
Helper functions for working with datasets represented as a pandas.DataFrame |
|
Helper functions for datasets annotated as sequences. |
Train-test-validation splits of datasets#
The vak.split
module contains functionality
for generating train-validation-test splits from
datasets. It is called by the vak.prep
function
when running vak prep
through the command line interface.
Functions for creating splits of datasets used with neural network models, such as the standard train-val-test splits used with supervised learning methods. |
Train#
High-level function that trains models. |
|
Function that trains models in the frame classification family. |
|
Function that trains models in the Parametric UMAP family. |
Eval#
High-level function that evaluates trained models. |
|
Function that evaluates trained models in the frame classification family. |
|
Function that evaluates trained models in the parametric UMAP family. |
Predict#
High-level function that generates new inferences from trained models. |
|
Function that generates new inferences from trained models in the frame classification family. |
|
Function that generates new inferences from trained models in the frame classification family. |
Learning Curve#
"code to fit learning curves adapted from https://github.com/NickleDave/learning-curves/ |
|
Helper functions that return names of directories generated during a run of a learning curve. |
|
Function that generates results for a learning curve for frame classification models. |
|
High-level function that generates results for a learning curve for all models. |
Configuration files#
The vak.config
module contains functions to parse
the TOML configuration files used with vak,
and dataclasses that represent tables from those files.
parses [EVAL] section of config |
|
parses [LEARNCURVE] section of config |
|
parses [PREDICT] section of config |
|
parses [PREP] section of config |
|
parses [SPECT_PARAMS] section of config |
|
parses [TRAIN] section of config |
|
validators used by attrs-based classes and by vak.parse.parse_config |
Datasets#
The vak.datasets
module contains datasets built into vak.
Metrics#
The vak.metrics
module contains metrics used
when evaluating neural network model performance.
Models#
The vak.models
module contains models
built into vak, and functions for working with models:
declaring them via definition, registering them
as one of a family of models, getting a model instance
for training, predicting, etc.
Base class for a model in |
|
Parametric UMAP model, as described in [1]_, with a convolutional network as the encoder. |
|
Decorator that makes a model class, given a definition of the model, and another class that represents a family of models that the new model belongs to. |
|
Code that handles classes that represent the definition of a neural network model; the abstraction of how models are declared with code in vak. |
|
A LightningModule that represents a task where a model predicts a label for each frame in a time series, e.g., each time bin in a window from a spectrogram. |
|
|
Get a model instance, given its name and a configuration as a |
Parametric UMAP model, as described in [1]_. |
|
Registry for models. |
|
TweetyNet model [1]_. |
Nets#
The vak.nets
module contains
neural network architectures built into vak.
All models include a neural network architecture
(along with an optimizer, loss function, and metrics).
TweetyNet model |
Neural Network Layers and Operations#
The vak.nn
module contains
operations, layers, and other graph components
used in neural network architectures.
Plotting#
Functions for plotting
that are built in to vak live in the vak.plot
module.
functions for plotting annotations for vocalizations |
|
functions to plot learning curve results |
|
|
plot spectrogram |
Transforms#
The vak.transforms
module contains transforms
that can be applied to input or output of neural networks,
i.e., for pre-processing or post-processing.
Functional forms of transformations related to frame labels, i.e., vectors where each element represents a label for a frame, either a single sample in audio or a single time bin from a spectrogram. |
|
Class forms of transformations related to frame labels, i.e., vectors where each element represents a label for a frame, either a single sample in audio or a single time bin from a spectrogram. |
|
Common#
This module contains helper functions used by multiple other modules.
constants used by multiple modules. |
|
utility functions for logging |
|
functions for working with paths |
|
Functions dealing with |
|
module for functions that deal with vector of times from a spectrogram, i.e. where elements are the times at bin centers. |
|
Functions for input validation |