carate.config_adapter package
Submodules
carate.config_adapter.config module
Module for serialization and deserialization of inputs. The aim is to keep web-first attitude, even though when using files locally. If there is text files then there is a need to convert them.
@author = Julian M. Kleber
- class carate.config_adapter.config.Config(dataset_name: str, num_features: int, num_classes: int, result_save_dir: str, model_save_freq: int, Evaluation: Evaluation, data_set: DatasetObject, model: Any, logger: Any, optimizer: str, device: str = 'auto', net_dimension: int = 364, learning_rate: float = 0.0005, dataset_save_path: str = '.', test_ratio: int = 20, batch_size: int = 64, shuffle: bool = True, num_cv: int = 5, num_epoch: int = 150, override: bool = True, resume: bool = False, normalize: bool = False, num_heads: int = 3, dropout_gat: float = 0.6, dropout_forward: float = 0.5, custom_size: int | None = None)[source]
Bases:
objectThe Config class is an object representation of the configuration of the model. It aims to provide a middle layer between some user input and the run interface. It is also possible to use it via the web because of the method overload of the constructor.
- Author:
Julian M. Kleber
- class carate.config_adapter.config.ConfigInitializer[source]
Bases:
object- classmethod from_file(file_name: str) Config[source]
The from_file function takes a file name as an argument and returns a Config object. The function reads the file, converts it to JSON, then uses the from_json method to create the Config object.
- Parameters:
cls – Used to create a new instance of the class.
file_name:str – Used to specify the name of the file to be used.
- Returns:
A config object.
- Doc-author:
Julian M. Kleber
- classmethod from_json(json_object: Dict[Any, Any]) Config[source]
The from_json function is a class method that takes in a json object and returns an instance of the Config class. The function is used to load the configuration from a file, which can be done by calling:
config = Config.from_json(json_object)
- Parameters:
cls – Used to Create an instance of the class that is calling this method.
json_object:dict – Used to Pass in the json object that is read from the file.
- Returns:
A class object.
- Doc-author:
Julian M. Kleber
- carate.config_adapter.config.EvaluationMap: Dict[str, Evaluation]
- carate.config_adapter.config.ModelMap: Dict[str, Any]