nnsa.feature_extraction.brainagemodel.core package
Submodules
nnsa.feature_extraction.brainagemodel.core.config module
Classes:
|
- class nnsa.feature_extraction.brainagemodel.core.config.Config(**kwargs)[source]
Bases:
objectMethods:
assign(**kwargs)copy([deep])copy the item, deep or shallow
items()join(obj[, key_prefix])This function takes two objects (or self, obj) and join the parameters into the first one (self). It raises an error if there is a conflict in the keys. key_prefix: if is not none, it will be added to the keys of the obj. e.g. obj.p (given key_prefix='blabla_') -> self.blabla_p = obj.p.
keys()- join(obj, key_prefix: str | None = None)[source]
This function takes two objects (or self, obj) and join the parameters into the first one (self). It raises an error if there is a conflict in the keys. key_prefix: if is not none, it will be added to the keys of the obj.
e.g. obj.p (given key_prefix=’blabla_’) -> self.blabla_p = obj.p
nnsa.feature_extraction.brainagemodel.core.ensemblemodels module
Classes:
|
To load all ensembled Sinc models. |
- class nnsa.feature_extraction.brainagemodel.core.ensemblemodels.EnsembleModels(CH, trained_model_directory, verbose=True)[source]
Bases:
objectTo load all ensembled Sinc models. Note that it is not a keras model, but it has a predict funtion with similar inputs/outputs.
Parameters:
CH: the number of eeg channels {1, 2, 4, or 8} trained_model_directory: the directory in which the ensemble models are located. The name of the models must be ‘model[x].h5’ (e.g. model1.h5, model2.h5, …). It maximally supports 1000 models. verbose: if True, it shows the loading progress; otherwise, it is silent.
Methods:
aggregate(pmas, recordings_indices)This function takes pmas tensor of all recordings and all models as well as the recording indices/names and returns the aggregated PMA per recording in a dictionary.
predict(eeg)To predict the outputs of all loaded ensembled models.
- aggregate(pmas, recordings_indices)[source]
This function takes pmas tensor of all recordings and all models as well as the recording indices/names and returns the aggregated PMA per recording in a dictionary. This can be called after the ‘predict’ function. The ‘predict_recording’ function internally calls this function and returns its output.