clean code
This commit is contained in:
parent
e8f040bfbd
commit
9906e7d646
@ -38,18 +38,12 @@ class PyTorchMLPClassifier(PyTorchClassifier):
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(self, **kwargs):
|
||||||
self,
|
|
||||||
learning_rate: float = 3e-4,
|
|
||||||
model_kwargs: Dict[str, Any] = {},
|
|
||||||
trainer_kwargs: Dict[str, Any] = {},
|
|
||||||
**kwargs
|
|
||||||
):
|
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
config = self.freqai_info.get("model_training_parameters", {})
|
config = self.freqai_info.get("model_training_parameters", {})
|
||||||
self.learning_rate: float = config.get("learning_rate", learning_rate)
|
self.learning_rate: float = config.get("learning_rate", 3e-4)
|
||||||
self.model_kwargs: Dict[str, Any] = config.get("model_kwargs", model_kwargs)
|
self.model_kwargs: Dict[str, Any] = config.get("model_kwargs", {})
|
||||||
self.trainer_kwargs: Dict[str, Any] = config.get("trainer_kwargs", trainer_kwargs)
|
self.trainer_kwargs: Dict[str, Any] = config.get("trainer_kwargs", {})
|
||||||
|
|
||||||
def fit(self, data_dictionary: Dict, dk: FreqaiDataKitchen, **kwargs) -> Any:
|
def fit(self, data_dictionary: Dict, dk: FreqaiDataKitchen, **kwargs) -> Any:
|
||||||
"""
|
"""
|
||||||
|
@ -39,18 +39,12 @@ class PyTorchMLPRegressor(PyTorchRegressor):
|
|||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(
|
def __init__(self, **kwargs):
|
||||||
self,
|
|
||||||
learning_rate: float = 3e-4,
|
|
||||||
model_kwargs: Dict[str, Any] = {},
|
|
||||||
trainer_kwargs: Dict[str, Any] = {},
|
|
||||||
**kwargs
|
|
||||||
):
|
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
config = self.freqai_info.get("model_training_parameters", {})
|
config = self.freqai_info.get("model_training_parameters", {})
|
||||||
self.learning_rate: float = config.get("learning_rate", learning_rate)
|
self.learning_rate: float = config.get("learning_rate", 3e-4)
|
||||||
self.model_kwargs: Dict[str, Any] = config.get("model_kwargs", model_kwargs)
|
self.model_kwargs: Dict[str, Any] = config.get("model_kwargs", {})
|
||||||
self.trainer_kwargs: Dict[str, Any] = config.get("trainer_kwargs", trainer_kwargs)
|
self.trainer_kwargs: Dict[str, Any] = config.get("trainer_kwargs", {})
|
||||||
|
|
||||||
def fit(self, data_dictionary: Dict, dk: FreqaiDataKitchen, **kwargs) -> Any:
|
def fit(self, data_dictionary: Dict, dk: FreqaiDataKitchen, **kwargs) -> Any:
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user