| Require: Training data
and labels
, testing data
and labels
, batch size b, epochs e, number of LSTM units u, dropout rate d, learning rate α, class weight w, and optimizer o
|
| Ensure: Trained model |
| 1: Procedure ATTENTIONLAYER (
) |
| 2:
Initialize biases with zeros |
| 3: return Weighted sum of input |
| 4: end Procedure
|
| 5: Procedure CREATE_MODEL (
) |
| 6: LSTM layer with u units and input shape |
| 7: Attention layer |
| 8: Dropout layer with dropout rate d
|
| 9: Dense layer with sigmoid activation |
| 10: Compile model with binary cross-entropy loss and optimizer o with learning rate α
|
| 11: return Compiled model |
| 12: end Procedure
|
| 13:
CREATE_MODEL(
) |
| 14:
|
| 15: return Trained model |