ehrapy.ml.LSTM#

class ehrapy.ml.LSTM(*, trainer=Trainer(max_epochs=100, batch_size=128, learning_rate=0.001, weight_decay=0.0001, patience=10, class_weight=None, device='auto'), hidden_size=64, num_layers=1, dropout=0.1)[source]#

Long short-term memory network on the time series of the variables, whether they were observed and the time since their last observation.

Examples

>>> import ehrapy as ep
>>> model = ep.ml.LSTM(hidden_size=32)

Attributes table#

dropout

Probability of dropping a unit while training.

hidden_size

Number of hidden units.

num_layers

Number of stacked recurrent layers.

sequential

Whether the model reads the time series of variables instead of their summaries.

trainer

How the model is trained.

Methods table#

Attributes#

LSTM.dropout: float = 0.1#

Probability of dropping a unit while training.

LSTM.hidden_size: int = 64#

Number of hidden units.

LSTM.num_layers: int = 1#

Number of stacked recurrent layers.

LSTM.sequential: ClassVar[bool] = True#

Whether the model reads the time series of variables instead of their summaries.

LSTM.trainer: Trainer = Trainer(max_epochs=100, batch_size=128, learning_rate=0.001, weight_decay=0.0001, patience=10, class_weight=None, device='auto')#

How the model is trained.

Methods#