Model
Embedding model for Highway2Vec.
This module contains the embedding model from the highway2vec
paper [1].
References
¶
Bases: Model
Autoencoder based embedding model for highway2vec.
PARAMETER | DESCRIPTION |
---|---|
n_features |
Number of features.
TYPE:
|
n_hidden |
Number of hidden units. Defaults to 64.
TYPE:
|
n_embed |
Embedding size. Defaults to 30.
TYPE:
|
lr |
Learning rate. Defaults to 1e-3.
TYPE:
|
Source code in srai/embedders/highway2vec/model.py
¶
Get model config.
Source code in srai/embedders/_base.py
¶
Save the model to a directory.
PARAMETER | DESCRIPTION |
---|---|
path |
Path to the directory.
TYPE:
|
¶
classmethod
Load model from a file.
PARAMETER | DESCRIPTION |
---|---|
path |
Path to the file.
TYPE:
|
**kwargs |
Additional kwargs to pass to the model constructor.
TYPE:
|
Source code in srai/embedders/_base.py
¶
Forward pass.
PARAMETER | DESCRIPTION |
---|---|
x |
Input tensor.
TYPE:
|
¶
Training step.
PARAMETER | DESCRIPTION |
---|---|
batch |
Batch.
TYPE:
|
batch_idx |
Batch index.
TYPE:
|