Skip to content

2. VAME config.yaml

KLuxem edited this page Mar 29, 2021 · 17 revisions

This page serves as a quick explanation of the different hyperparameter in the VAME config.yaml


Project configurations

Project: vame_alpha_release(Project name defined by project initialisation)

model_name: VAME_ZERO (can be any name and by using a different name you can train multiple models. Results will be saved in model specific subfolders)

n_cluster: 30 (Number of motifs/poses/states)

pose_confidence: 0.99 (Accuracy of the pose estimation tool. Used in the alignment function to set low accuracy points to NaN)


Project path and videos

project_path: C:\Research\VAME\vame_alpha_release-Mar16-2021** (path to your project in your working directory)

video_sets: (List of videos to analyse)

  • video-1

  • video-2

  • ...


Data

all_data: yes (if "No", VAME will ask you which data you want to use. This is helpful if you want to apply a function only to a subset of your data)


Creation of train set:

robust: true (if "true", VAME will eliminate outliers in the egocentrical alignment via checking the Interquartile range (IQR) by multiplying the resulting IQR value with a factor. If a value is higher than this it will be set to NaN. Equally, if a value is smaller than the negative of this result, it will be set to NaN. Afterwards, we interpolate the NaNs)

iqr_factor: 4 (Factor for the outlier elimination via IQR)

savgol_filter: True (Applies a Savitzky–Golay filter to your data. If you don't want any post-processing/smoothing set to "False")

savgol_length: 5 (Length of the Savitzky–Golay filter)

savgol_order: 2 (Order of the Savitzky–Golay filter)

test_fraction: 0.1 (Determines how many data points will be used for testing, here 10 %)


RNN model general hyperparameter:

pretrained_model: None (Use an already trained model to continue training or as weight initialization for a new model)

pretrained_weights: False (Set "True" if you want to use the weights of an already trained model)

num_features: 12 (Total number of signals in your time series)

batch_size: 256 (Batch size for recurrent neural network)

max_epochs: 500 (Maximum number of Epochs to train. You might want to set this parameter higher given your datasize)

model_snapshot: 50 (Number of epochs until VAME takes a snapshot of the model)

model_convergence: 50 (If the test loss does not improve after a number of steps the training stops)

transition_function: GRU (Currently the no other transition function implemented. Others would be vanilla RNN or LSTM)

beta: 1 (turn VAME into a beta-VAE by changing this number to a higher value)

zdims: 30 (Numbers of dimensions you want to embed your data in. We recommend to start with 30)

learning_rate: 0.0005 (Learning rate of the model)

time_window: 30 (Number of time points the model uses to embed a data point)

prediction_decoder: 1 (If "1", VAME uses an additional decoder to predict the future dynamics of the input time window. This is used to regularize the embedding space and forces the encoder to learn richer dynamics. If "0", no prediction decoder will be used_)

prediction_steps: 15 (Number of future time steps to predict for the prediction decoder)

noise: False (If "True", VAME applies Gaussian noise over the input data. This can help when the dynamics are very simple and you want to avoid learning an identity function. Default "False")

scheduler: 1 (If "1", VAME uses a simple scheduler to adjust the learning rate after a given number of epochs. Turn of by using "0")

scheduler_step_size: 100 (Number of epochs after which VAME adjust the learning rate)

scheduler_gamma: 0.2 (Multiplicative factor of learning rate decay)

softplus: false (Was set to 'true' in original VAME. When 'true', KL-Loss and Kmeans-Loss will have higher impact. Might improve cluster structure in UMAP)


Segmentation:

load_data: -PE-seq-clean (Don't change as VAME uses this internally for data handling)

individual_parameterization: False (If "True", VAME will assign each individual animal its own k-Means Parameterization i.e. clustering)

random_state_kmeans: 42 (Determines random number generation for centroid initialization.)

n_init_kmeans: 15 (Number of time the k-means algorithm will be run with different centroid seeds. The final results will be the best output of n_init consecutive runs in terms of inertia)


Video writer:

lenght_of_motif_video: 1000 (Number of data points for the motif/community videos)


UMAP parameter:

min_dist: 0.1 (Controls how tightly UMAP is allowed to pack points together)

n_neighbors: 200 (Controls how UMAP balances local versus global structure in the data)

random_state: 42 (Fixes the random seed for UMAP)

num_points: 30000 (Number of points embedded by UMAP. Note, the higher you choose this number the longer UMAP takes to compute)


ONLY CHANGE ANYTHING BELOW IF YOU ARE FAMILIAR WITH RNN MODELS

RNN encoder hyperparamter:

hidden_size_layer_1: 256 (The number of features in the hidden state h for the all layer)

hidden_size_layer_2: 256 (For legacy model, The number of features in the hidden state h for the second layer)

dropout_encoder: 0 (Introduces a Dropout layer on the outputs of each GRU layer except the last layer. Can be set between 0.0 and 1.0)


RNN reconstruction hyperparameter:

hidden_size_rec: 256 (The number of features in the hidden state h for the all layer)

dropout_rec: 0 (Introduces a Dropout layer on the outputs of each GRU layer except the last layer. Can be set between 0.0 and 1.0)


RNN prediction hyperparamter:

hidden_size_pred: 256 (The number of features in the hidden state h for the all layer)

dropout_pred: 0 (Introduces a Dropout layer on the outputs of each GRU layer except the last layer. Can be set between 0.0 and 1.0)


RNN loss hyperparameter:

mse_reconstruction_reduction: sum (Specifies the reduction to apply to the output: 'none' | 'mean' | 'sum')

mse_prediction_reduction: sum (Specifies the reduction to apply to the output: 'none' | 'mean' | 'sum')

kmeans_loss: 30 (Specifies how many entries from the resulting diagonal spectral matrix are added up. Should be equal to the number of clusters)

kmeans_lambda: 0.1 (Hyperparameter specifying the weight of the k-Means loss term)

anneal_function: linear (_Annealing of Kullback-Leibler loss to let the model learn first the reconstruction of the data before the KL loss term gets introduced. Can be either 'linear' or 'sigmoid')

kl_start: 2 (Determines at which epoch the KL-Loss kicks in)

annealtime: 4 (Determines the anneal time until KL-Loss reaches its full impact on the date)


Legacy mode

legacy: False (Only switch to 'True' if you want to work with the old version of VAME. There might be bugs and there is no support for newer functions like the community function)