whatlies.transformers.Noise

This transformer adds gaussian noise to an embeddingset.

Parameters

Name Type Description Default
sigma the amount of gaussian noise to add 0.1
seed seed value for random number generator 42

Usage:

from whatlies.language import SpacyLanguage
from whatlies.transformers import Noise

words = ["prince", "princess", "nurse", "doctor", "banker", "man", "woman",
         "cousin", "neice", "king", "queen", "dude", "guy", "gal", "fire",
         "dog", "cat", "mouse", "red", "blue", "green", "yellow", "water",
         "person", "family", "brother", "sister"]

lang = SpacyLanguage("en_core_web_md")
emb = lang[words]

emb.transform(Noise(3))