# # hyperparams.py

# class HyperParameters:
#     """
#     Class to store and manage hyperparameters.
#     """

#     def __init__(self,
#                 learning_rate=0.01,
#                 batch_size=32,
#                 epochs=10,
#                 optimizer_type="SGD",
#                 num_layers=2,
#                 neurons_per_layer=[10, 1],
#                 dropout_rate=0.0,
#                 activation_function="ReLU"):
#         self.learning_rate = learning_rate
#         self.batch_size = batch_size
#         self.epochs = epochs
#         self.optimizer_type = optimizer_type
#         self.num_layers = num_layers
#         self.neurons_per_layer = neurons_per_layer
#         self.dropout_rate = dropout_rate
#         self.activation_function = activation_function

#     def to_dict(self):
#         """Return hyperparameters as a dictionary"""
#         return {
#             "learning_rate": self.learning_rate,
#             "batch_size": self.batch_size,
#             "epochs": self.epochs,
#             "optimizer_type": self.optimizer_type,
#             "num_layers": self.num_layers,
#             "neurons_per_layer": self.neurons_per_layer,
#             "dropout_rate": self.dropout_rate,
#             "activation_function": self.activation_function
#         }

#     def __str__(self):
#         return f"HyperParams: LR={self.learning_rate}, BS={self.batch_size}, Epochs={self.epochs}"



# hyperparams.py

class HyperParameters:
    """
    كلاس لتخزين معايير التدريب والهيكل.
    """

    def __init__(self,
            learning_rate=0.001,
            batch_size=32,
            epochs=10,
            optimizer_type="SGD",
            input_size=4,           # ← جديد: حجم المدخلات
            hidden_layers=[64, 32], # ← أحجام الطبقات المخفية
            output_size=1,          # ← حجم المخرجات
            dropout_rate=0.0,
            activation_function="ReLU"):
        self.learning_rate = learning_rate
        self.batch_size = batch_size
        self.epochs = epochs
        self.optimizer_type = optimizer_type
        self.input_size = input_size
        self.hidden_layers = hidden_layers
        self.output_size = output_size
        self.dropout_rate = dropout_rate
        self.activation_function = activation_function

    def to_dict(self):
        return {
            "learning_rate": self.learning_rate,
            "batch_size": self.batch_size,
            "epochs": self.epochs,
            "optimizer_type": self.optimizer_type,
            "input_size": self.input_size,
            "hidden_layers": self.hidden_layers,
            "output_size": self.output_size,
            "dropout_rate": self.dropout_rate,
            "activation_function": self.activation_function
        }

    def __str__(self):
        return f"HyperParams: LR={self.learning_rate}, BS={self.batch_size}, Layers={self.hidden_layers}"