mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-02 23:41:27 +00:00
add early stopping in config
This commit is contained in:
@@ -48,3 +48,6 @@ Convolutional = [
|
||||
{"Flatten": {}},
|
||||
{"Dense": {"activation": "relu"}},
|
||||
]
|
||||
|
||||
# Add early stopping to save time training when validation is plateaued
|
||||
Early_Stop_Patience = 10
|
||||
@@ -28,8 +28,11 @@ from gamestonk_terminal.prediction_techniques.pred_helper import (
|
||||
)
|
||||
from gamestonk_terminal import config_neural_network_models as cfg_nn_models
|
||||
|
||||
es = EarlyStopping(monitor="val_loss", patience=10)
|
||||
|
||||
if cfg_nn_models.Early_Stop_Patience:
|
||||
es = EarlyStopping(monitor="val_loss", patience=cfg_nn_models.Early_Stop_Patience)
|
||||
else:
|
||||
#Set patience to very long value
|
||||
es = EarlyStopping(monitor="val_loss", patience=1000)
|
||||
|
||||
def build_neural_network_model(
|
||||
Recurrent_Neural_Network: List[Any], n_inputs: int, n_days: int
|
||||
|
||||
Reference in New Issue
Block a user