Concept
- class hybrid_learning.concepts.concepts.Concept(name, data)[source]
Bases:
object
Representation of a concept with data and meta information. Sub-classes should implement the property type and extend the data checks in
_validate_dataset()
. Different general types can be found inConceptTypes
.Public Data Attributes:
The type of the concept including according type checks.
Training data set.
Validation data set.
Test data set.
Combined dataset of the defining training and validation data.
Settings dict to reproduce instance.
Special Methods:
__init__
(name, data)Init.
__eq__
(other)Equality check by checking on values.
__repr__
()Nice printing function.
- Parameters
name (str) –
data (DataTriple) –
- __eq__(other)[source]
Equality check by checking on values. Especially, datasets must be the same objects.
- __init__(name, data)[source]
Init.
- Parameters
name (str) – name and ID of the concept (should be descriptive and unique)
data (DataTriple) – dataset splits of data representing the concept
- static _validate_dataset(data, data_desc='??')[source]
Check whether the given data fulfills all required properties and raise if not. Extend in sub-class.
- Parameters
data (
torch.utils.data.Dataset
) – dataset to validatedata_desc (str) – some description of the data for more informative error messages
- Raises
- Returns
the unchanged given dataset
- Return type
- classmethod new(concept)[source]
Initialize a concept from the attributes of another by references. This is helpful when converting concepts to specific sub-classes (with the corresponding data checks during init).
- Parameters
concept (Concept) –
- __hash__ = None
- data: DataTriple
The data defining the concept, split into train/val/test data.
- property settings: Dict[str, Any]
Settings dict to reproduce instance. Use as keyword args for init.
-
property test_data:
torch.utils.data.Dataset
-
property train_data:
torch.utils.data.Dataset
-
property train_val_data:
torch.utils.data.Dataset
Combined dataset of the defining training and validation data. See
train_val
attribute ofdata
.
- property type: ConceptTypes
The type of the concept including according type checks.
-
property val_data:
torch.utils.data.Dataset