Embedding initializers.
Classes
A random number generator meant to be used with |
|
Generates vectors using a normal distribution with the same mean and standard deviation of the set of vectors passed to the fit method. |
Functions
|
Returns a normal sampler. |
Reference
embfile.initializers.
Initializer
[source]¶Bases: abc.ABC
A random number generator meant to be used with build_matrix()
.
It can be fit to a sequence of other vectors in order to compute stats to be used for
generation. When passed to build_matrix
, the initializer is fit to the found vectors.
embfile.initializers.
NormalInitializer
[source]¶Bases: embfile.initializers.Initializer
Generates vectors using a normal distribution with the same mean and standard deviation
of the set of vectors passed to the fit method. When used with
build_matrix()
, it initializes out-of-file-vocabulary vectors so
that they have the same mean and deviation of the vectors found in the file.
If not fit before to generate vectors, it raises IllegalOperation