athena.models.rnn_lm¶
RNN language model implementation
Module Contents¶
Classes¶
RNNLM |
Standard implementation of a RNNLM. Model mainly consists of embeding layer, |
-
class
athena.models.rnn_lm.RNNLM(data_descriptions, config=None)¶ Bases:
athena.models.base.BaseModelStandard implementation of a RNNLM. Model mainly consists of embeding layer, rnn layers(with dropout), and the full connection layer, which are all incuded in self.model_for_rnn
-
default_config¶
-
call(self, samples, training: bool = None)¶ call model
-
save_model(self, path)¶ for saving model and current weight, path is h5 file name, like ‘my_model.h5’ usage: new_model = tf.keras.models.load_model(path)
-
get_loss(self, logits, samples, training=None)¶ get loss
-