This packages utilizes two augmentation methods namely.
They were taken from this paper: https://arxiv.org/abs/1910.04176
- Noise injection (aka radiation therapy): this simply upsamples a given list of embeddings with random noise.
- Delta_S: Which takes in a given array and extrapolates data given a target label.
!pip install SpaceAugmentation
First you need to import the library and instantiate it
from aug import Augmentation
ag = Augmentation.Augmentation()
l1, l2 = ag.add_noise(list_of_embeddings, list_of_labels)
l1 will be a new list with doubles the size including original embeddings + new embeddings l2 will be new list of labels
l1, l2 = ag.add_noise(list_of_embeddings, list_of_labels, noise_low= 0.0, nose_high= 0.1)
This stems from formula
X_hat =( Xi − Xj ) + Xk
Xi is random sample 1
Xj is random sample 2
Xk is random sample 3
Sample a pair of sentences (Xi, Xj)
from the target
category.
DELTAS applies deltas from the same target category to another sample Xk
l1, l2 = ag.delta_S(list_of_embeddings, list_of_labels, target=0)
This lambda with delta_s fusion is a novel technique that has not been tested yet or introduced yet.
if lambda_ is used then we use the lambda_ value times the delta
X_hat =( Xi − Xj ) * λ + Xk
l1, l2 = ag.delta_S(list_of_embeddings, list_of_labels, target=0, lambda_= 0.3)
More Features will be added soon. Enjoy!