Configuration Utils
BaseConfig
Base class for managing and validating configurations. |
|
Cast the given value to the expected type. |
|
Retrieve the default value of a specified parameter. |
|
Validate the type of a given value against the expected type. |
|
Validate the value of a parameter against its constraints. |
|
Validate both the type and value of a parameter. |
|
Retrieve the description of a parameter. |
- class prokbert.config_utils.BaseConfig
Base class for managing and validating configurations.
- cast_to_expected_type(parameter_class: str, parameter_name: str, value: any) any
Cast the given value to the expected type.
- Parameters
- Returns
Value casted to the expected type.
- Return type
any
- Raises
ValueError – If casting fails.
- get_parameter(parameter_class: str, parameter_name: str) any
Retrieve the default value of a specified parameter.
- validate(parameter_class: str, parameter_name: str, value: any)
Validate both the type and value of a parameter.
- Parameters
- Raises
TypeError – If the value is not of the expected type.
ValueError – If the value does not meet the parameter’s constraints.
- validate_type(parameter_class: str, parameter_name: str, value: any) bool
Validate the type of a given value against the expected type.
SeqConfig
Class to manage and validate sequence processing configurations. |
|
|
Retrieve the default sequence processing configuration file. |
|
Retrieve and validate the provided parameters for segmentation. |
|
|
|
Reading and validating the computational paramters |
|
Calculating the maximum length of the segment from the token count |
|
Calcuates how long sequence can be covered |
|
Calcuates how long sequence can be covered |
- class prokbert.config_utils.SeqConfig
Bases:
BaseConfigClass to manage and validate sequence processing configurations.
- get_and_set_computational_parameters(parameters: dict = {}) dict
Reading and validating the computational paramters
- get_and_set_segmentation_parameters(parameters: dict = {}) dict
Retrieve and validate the provided parameters for segmentation.
- Parameters
parameters (dict) – A dictionary of parameters to be validated.
- Returns
A dictionary of validated segmentation parameters.
- Return type
- Raises
ValueError – If an invalid segmentation parameter is provided.
- static get_maximum_segment_length_from_token_count(max_token_counts, shift, kmer)
Calcuates how long sequence can be covered
- get_maximum_segment_length_from_token_count_from_params()
Calculating the maximum length of the segment from the token count
- static get_maximum_token_count_from_max_length(max_segment_length, shift, kmer)
Calcuates how long sequence can be covered
- get_maximum_token_count_from_max_length_from_params()
Calculating the maximum length of the segment from the token count
ProkBERTConfig
Class to manage and validate pretraining configurations. |
|
|
Retrieve the default pretraining configuration file. |
|
Retrieve and validate the provided parameters for a given parameter class. |
|
Setting the model parameters |
|
Setting the dataset parameters |
|
Setting the model parameters |
|
Setting the model parameters |
|
|
|
|
|
- class prokbert.config_utils.ProkBERTConfig
Bases:
BaseConfigClass to manage and validate pretraining configurations.
- get_set_parameters(parameter_class: str, parameters: dict = {}) dict
Retrieve and validate the provided parameters for a given parameter class.
- Parameters
- Returns
A dictionary of validated parameters.
- Return type
- Raises
ValueError – If an invalid parameter is provided.