Abstract Class
Backbones
- class mindnlp.abc.Seq2seqModel(encoder, decoder)[源代码]
seq2seq模型的基类
- 参数
encoder (EncoderBase) – 编码器
decoder (DecoderBase) – 解码器
- class mindnlp.abc.Seq2vecModel(encoder, head, dropout: Optional[float] = None)[源代码]
seq2vec模型的基类
- 参数
encoder (EncoderBase) – 编码器
head (nn.Cell) – 处理编码器输出的模块
dropout (float) – 输入神经元丢弃概率,数值范围在0到1之间。如果值为None,则不丢弃输入神经元。默认值:None
Callback
Metric
Modules
- class mindnlp.abc.TokenEmbedding(vocab: Vocab, init_embed, requires_grad: bool = True, dropout=0.0)[源代码]
Create vocab and Embedding from a given pre-trained vector file.
- 参数
vocab (Vocab) – 传入vocab用于初始化.
init_embed (Tensor) – Passing into Vocab and Tensor,use these values to initialize Embedding directly.
requires_grad (bool) – 参数是否需要梯度下降来更新.
dropout (float) – Dropout of the output of Embedding.