public class WeightInitEmbedding extends Object implements IWeightInit
EmbeddingInitializer
Note: WeightInitEmbedding supports both JSON serializable and non JSON serializable initializations.
In the case of non-JSON serializable embeddings, they are a one-time only use: once they have been used
to initialize the parameters, they will be removed from the WeightInitEmbedding instance.
This is to prevent unnecessary references to potentially large objects in memory (i.e., to avoid memory leaks)DEFAULT_WEIGHT_INIT_ORDER
Modifier | Constructor and Description |
---|---|
|
WeightInitEmbedding(@NonNull EmbeddingInitializer embeddingInitializer) |
protected |
WeightInitEmbedding(EmbeddingInitializer serializableInit,
EmbeddingInitializer nonSerializableInit) |
Modifier and Type | Method and Description |
---|---|
INDArray |
init(double fanIn,
double fanOut,
long[] shape,
char order,
INDArray paramView)
Initialize parameters in the given view.
|
long[] |
shape() |
public WeightInitEmbedding(@NonNull @NonNull EmbeddingInitializer embeddingInitializer)
protected WeightInitEmbedding(EmbeddingInitializer serializableInit, EmbeddingInitializer nonSerializableInit)
public INDArray init(double fanIn, double fanOut, long[] shape, char order, INDArray paramView)
IWeightInit
init
in interface IWeightInit
fanIn
- Number of input parametersfanOut
- Number of output parametersshape
- Desired shape of array (users shall assume paramView has this shape after method has finished)order
- Order of array, e.g. Fortran ('f') or C ('c')paramView
- View of parameters to initialize (and reshape)public long[] shape()
Copyright © 2020. All rights reserved.