ai2_kit.domain.selector module#

class ai2_kit.domain.selector.CllModelDevSelectorContext(path_prefix: str, resource_manager: ai2_kit.core.resource_manager.ResourceManager)[source]#

Bases: BaseCllContext

path_prefix: str#
resource_manager: ResourceManager#
class ai2_kit.domain.selector.CllModelDeviSelectorInput(config: ai2_kit.domain.selector.CllModelDeviSelectorInputConfig, model_devi_data: List[ai2_kit.core.artifact.Artifact], model_devi_file: str, type_map: List[str])[source]#

Bases: object

config: CllModelDeviSelectorInputConfig#
model_devi_data: List[Artifact]#
model_devi_file: str#
set_model_devi_dataset(data: List[Artifact])[source]#
type_map: List[str]#
class ai2_kit.domain.selector.CllModelDeviSelectorInputConfig(*, f_trust_lo: float = 0.0, f_trust_hi: float = 65535.0, new_explore_system_q: float = 0.25, asap_options: Optional[AsapOptions] = None, screening_fn: Optional[str] = None, max_decent_per_traj: int = - 1)[source]#

Bases: BaseModel

class AsapOptions(*, disable: bool = False, limit_per_cluster: int = 1, sort_by_ssw_energy: bool = False, descriptor: dict = {'soap': {'crossover': False, 'element_wise': False, 'l_max': 6, 'n_max': 6, 'preset': 'minimal', 'r_cut': 3.5, 'rbf': 'gto', 'reducer_type': 'average', 'sigma': 0.5, 'zeta': 1}}, dim_reducer: dict = {'pca': {'parameter': {'n_components': 3, 'scalecenter': True}, 'type': 'PCA'}}, cluster: dict = {'dbscan': {}})[source]#

Bases: BaseModel

cluster: dict#
descriptor: dict#
dim_reducer: dict#
disable: bool#
limit_per_cluster: int#

limit the number of structures to be selected from the same cluster

sort_by_ssw_energy: bool#

sorted the structures by ssw_energy in each cluster

asap_options: Optional[AsapOptions]#

options for ASAP to further select candidates

f_trust_hi: float#

the upper bound of model_devi score to select the structure for labeling

f_trust_lo: float#

the lower bound of model_devi score to select the structure for labeling

max_decent_per_traj: int#

limit the max number of decent structures per trajectory, -1 means unlimited

new_explore_system_q: float#

the quantile of model_devi score to select the structure for next round of exploration

screening_fn: Optional[str]#

the function to screen the candidates, e.g “lambda x: x[‘ssw_energy’] < -1000”

class ai2_kit.domain.selector.CllModelDeviSelectorOutput(candidates: List[ai2_kit.core.artifact.Artifact], passing_rate: float, new_explore_systems: List[ai2_kit.core.artifact.Artifact])[source]#

Bases: ICllSelectorOutput

candidates: List[Artifact]#
get_model_devi_dataset()[source]#
get_new_explore_systems() List[Artifact][source]#
get_passing_rate() float[source]#
new_explore_systems: List[Artifact]#
passing_rate: float#
ai2_kit.domain.selector.bulk_select_distinct_structures(candidates: ~typing.List[~ai2_kit.core.artifact.__ArtifactDict.<locals>.ArtifactDict], descriptor_opt: dict, dim_reducer_opt: dict, cluster_opt: dict, type_map: ~typing.List[str], work_dir: str, limit_per_cluster: int = -1, sort_by_energy: bool = False, workers: int = 4) ArtifactDict]#
ai2_kit.domain.selector.bulk_select_structures_by_model_devi(model_devi_outputs: ~typing.List[~ai2_kit.core.artifact.__ArtifactDict.<locals>.ArtifactDict], model_devi_file: str, f_trust_lo: float, f_trust_hi: float, new_explore_system_q: float, type_map: ~typing.List[str], work_dir: str, max_decent_per_traj: int, screening_fn: ~typing.Optional[str], workers: int = 4) ArtifactDict], dict]]#
async ai2_kit.domain.selector.cll_model_devi_selector(input: CllModelDeviSelectorInput, ctx: CllModelDevSelectorContext)[source]#